FWIW, I recall discussions about leaving particle positions in code units in line with leaving cell centers and cell widths in code units. Otherwise, I agree.
John ZuHone Laboratory for High-Energy Astrophysics NASA/Goddard Space Flight Center 8800 Greenbelt Rd., Mail Code 662 Greenbelt, MD 20771 (w) 301-286-2531 (m) 781-708-5004 email@example.com firstname.lastname@example.org
On Apr 5, 2014, at 7:39 PM, Nathan Goldbaum email@example.com wrote:
Does anyone know why particle fields are turned in code units? For example:
import yt ds = yt.load('IsolatedGalaxy/galaxy0030/galaxy0030') ad = ds.all_data() print ad['all', 'particle_mass'] [ 5.24322377e-06 5.24322377e-06 5.24423058e-06 ..., 2.51688903e-06 2.52040900e-06 2.52345330e-06] code_mass print ad['all', 'particle_position_x'] [ 0.50070677 0.50118382 0.50118984 ..., 0.49867166 0.49857796 0.49865383] code_length
For fluid fields, we have aliases for on-disk fields that get returned in code units, but the 'standard' yt fields are all in CGS by default:
print ad['gas', 'density'] [ 4.92775113e-31 4.94005233e-31 4.93824694e-31 ..., 1.12879234e-25 1.59561490e-25 1.09824903e-24] g/cm**3
print ad['enzo', 'Density'] [ 1.78469285e-01 1.78914800e-01 1.78849414e-01 ..., 4.08816836e+04 5.77886836e+04 3.97754906e+05] code_mass/code_length**3
I guess we don't really have a distinction like that on the particle side of things.
I tend to think that it should be easier to access particle fields in CGS units and that we should default to having 'standard' particle fields in CGS, just like the fluid fields.
That said, looking at YTEP-0003, it seems we focused mostly on fluid fields and didn't think very hard about how particle fields should work. For example, 'particle_mass' is never mentioned.
I realize that completely refactoring the particle fields will be a fair bit of work so we may not be able to change things before yt 3.0 is released, but I think this should be part of the discussion as we develop a more consistent set of rules for how yt fields should work, including multifluid, multiparticle, and multispecies datasets.
I'd love to hear other's thoughts on this.
yt-dev mailing list firstname.lastname@example.org http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org