[yt-users] getting slice array

Slavin, Jonathan jslavin at cfa.harvard.edu
Tue Aug 11 11:10:55 PDT 2015


Hi all,

I'm new to using yt, though I'm an experienced python and matplotlib user.
I've been doing runs with FLASH and would like to be able to plot the
results with matplotlib.  I've used yt "interactively" in an ipython
notebook and found it a bit cumbersome - e.g. you can't pan and zoom like
you can with matplotlib.  On the other hand yt has some nice facilities for
accessing the data.  So my question is, how do I get a slice, such as is
plotted using the yt.SlicePlot function, in an array that I can then
manipulate, plot, etc.?  If I do:
ds = yt.load(file)
slc = ds.slice(2,0.)
d = slc['density']
I have a YTArray that's apparently 1-D:
d.shape
(138496,)
I should mention that this is a 2-D, cylindrically symmetric (r-z) run.
Thanks in advance for any help you can offer.

Regards,
Jon Slavin

-- 
________________________________________________________
Jonathan D. Slavin                 Harvard-Smithsonian CfA
jslavin at cfa.harvard.edu       60 Garden Street, MS 83
phone: (617) 496-7981       Cambridge, MA 02138-1516
cell: (781) 363-0035             USA
________________________________________________________
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.spacepope.org/pipermail/yt-users-spacepope.org/attachments/20150811/8c58d19b/attachment.htm>


More information about the yt-users mailing list