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

Junhwan Choi (최준환) choi.junhwan at gmail.com
Fri Oct 3 08:16:14 PDT 2014


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]
================

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



More information about the yt-users mailing list