{ "metadata": { "name": "", "signature": "sha256:5970a30f0b99a94317b8c89e5461f62eb72a9c92fe9c1fb35c15ce913a06400e" }, "nbformat": 3, "nbformat_minor": 0, "worksheets": [ { "cells": [ { "cell_type": "code", "collapsed": false, "input": [ "import yt" ], "language": "python", "metadata": {}, "outputs": [], "prompt_number": 1 }, { "cell_type": "code", "collapsed": false, "input": [ "ds = yt.load(\"GasSloshing/sloshing_nomag2_hdf5_plt_cnt_0150\")" ], "language": "python", "metadata": {}, "outputs": [], "prompt_number": 2 }, { "cell_type": "code", "collapsed": false, "input": [ "print ds.domain_left_edge\n", "print ds.domain_right_edge" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "[ -3.70272000e+24 -3.70272000e+24 -3.70272000e+24] code_length\n", "[ 3.70272000e+24 3.70272000e+24 3.70272000e+24] code_length\n" ] } ], "prompt_number": 3 }, { "cell_type": "code", "collapsed": false, "input": [ "# default width figures out units properly\n", "yt.SlicePlot(ds, 'x', 'density')" ], "language": "python", "metadata": {}, "outputs": [ { "html": [ "
" ], "metadata": {}, "output_type": "pyout", "prompt_number": 4, "text": [ "" ] } ], "prompt_number": 4 }, { "cell_type": "code", "collapsed": false, "input": [ "# use domain_*_edge (units of code_length) to specify width of Slice; plot has code_length instead of ds.length_unit\n", "w = (ds.domain_right_edge[1], ds.domain_right_edge[2])\n", "yt.SlicePlot(ds, 'x', 'density', width=w)" ], "language": "python", "metadata": {}, "outputs": [ { "html": [ "
" ], "metadata": {}, "output_type": "pyout", "prompt_number": 5, "text": [ "" ] } ], "prompt_number": 5 }, { "cell_type": "code", "collapsed": false, "input": [ "# use a combination of domain_right_edge and ds.quan really screws up\n", "w = (ds.domain_right_edge[1], ds.quan(1, 'Mpc'))\n", "yt.SlicePlot(ds, 'x', 'density', width=w)" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stderr", "text": [ "/Users/cmalone/code/yt-x86_64/lib/python2.7/site-packages/matplotlib-1.4.0-py2.7-macosx-10.4-x86_64.egg/matplotlib/axis.py:1016: UserWarning: Unable to find pixel distance along axis for interval padding; assuming no interval padding needed.\n", " warnings.warn(\"Unable to find pixel distance along axis for interval padding; assuming no interval padding needed.\")\n", "/Users/cmalone/code/yt-x86_64/lib/python2.7/site-packages/matplotlib-1.4.0-py2.7-macosx-10.4-x86_64.egg/matplotlib/axis.py:1023: UserWarning: Unable to find pixel distance along axis for interval padding; assuming no interval padding needed.\n", " warnings.warn(\"Unable to find pixel distance along axis for interval padding; assuming no interval padding needed.\")\n" ] }, { "html": [ "
" ], "metadata": {}, "output_type": "pyout", "prompt_number": 6, "text": [ "" ] } ], "prompt_number": 6 }, { "cell_type": "code", "collapsed": false, "input": [], "language": "python", "metadata": {}, "outputs": [] } ], "metadata": {} } ] }