[yt-users] accessing the row simulation data using yt

Matthew Turk matthewturk at gmail.com
Fri Oct 3 08:33:11 PDT 2014


On Fri, Oct 3, 2014 at 10:16 AM, Junhwan Choi (최준환)
<choi.junhwan at gmail.com> wrote:
> Hi yt user,
>
> I have one basic question how I can access row data using yt.
> For example, I would like to access finset cell information and
> manipulate form it.
> Does following script print the x, y, z, vx, vy, vz, and mass for all
> finest cells in the spherical region?
> =================
> from yt.mods import *
>
> pf = load("../DD%04d/DD%04d" % (snapshot,snapshot))
> center = pf.h.find_max("Density")[1]
> sp = pf.h.sphere(center, (rmax,'pc'))
>
> for icell in range(0,sp["CellMassMsun"].size):
>     print sp["x"][icell], sp["y"][icell], sp["z"][icell]
>     print sp["x-velocity"][icell], sp["y-velocity"][icell],
> sp["z-velocity"][icell]
>     print sp["CellMassMsun"][icell]
> ================

Yup, this will do it.

>
> I know that this kind of the procedure violate the bases of yt philosophy.
> However, it is sometimes useful, particularly when I want to compute
> very specific quantities.
> If you have other suggestion regarding to access simulation raw data
> in yt way, please let me know.
>
> Thank you,
> Junhwan
> _______________________________________________
> yt-users mailing list
> yt-users at lists.spacepope.org
> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org



More information about the yt-users mailing list