[yt-users] Some questions about plot and load

Stephen Skory s at skory.us
Mon Nov 7 13:17:56 PST 2011


Hi Chao,

welcome to yt! We're happy that you're trying it out and going through
the orientation session. I'm going to answer your questions
out-of-order.

> far so I wonder if someone could explain a little bit about the relation
> between python, ipython, yt and iyt.  Thanks very much!

Invoking 'python' will get you the standard python interpreter. This
will not have any of the extras that yt needs/provides.

'ipython' calls 'python' but it adds in the IPython module which makes
the python interpreter more powerful, with things like tab-complete,
history and other nice features. You can learn more about it here:
http://ipython.org/

'yt' calls 'python' and provides some extra conveniences. If you just
call 'yt', it will be the same as if you had typed 'python', and then
'from yt.mods import *' inside of the python interpreter. It will also
allow you to use the command-line options (you can see them all with
"yt --help") on a dataset without entering the python interpreter,
first.

'iyt' calls 'yt' and adds the IPython module so you get all of yt's
functionality as well as IPython's.

> Then I tried to do this in python interpreter, ipython interface, and iyt
> respectively. In python and ipython, I first import yt by typing "from
> yt.mods import *", and then tried to load and plot the file moving7_0010.
> While I can load the file successfully, the interpreter told me that "plot"
> is not defined. So is the command "stats".  However in iyt interface, load
> and plot are both ok but stats is not defined.

This is expected behavior. The commands that you can use on the shell
command line ('yt plot moving7_0010', 'yt stats moving7_0010') don't
work the same way from the Python interpreter.

> Then it showed at the last three lines that three .png files corresponding
> to density slices on x,y,z directions have been saved to ./frames. How can I
> make the image come out automatically after they were plotted?

I'm guessing that you mean you want the images to show on your screen
once they've been plotted? This is possible with interactive plotting:

http://yt-project.org/doc/visualizing/plots.html#interactive-plotting

Good luck, and let us know if you have more questions!

-- 
Stephen Skory
s at skory.us
http://stephenskory.com/
510.621.3687 (google voice)



More information about the yt-users mailing list