[yt-users] particle_mass

Ali Snedden asnedden at nd.edu
Fri Mar 23 14:12:14 PDT 2012


Hello,

I was trying to get the position and mass information for the dark matter
(and stellar) particles in an Enzo simulation.  I have tried a couple of
different ways and I was curious about the units on the following method.
In this case I am presumably accessing the dark matter particles
(particle_type = 1)

*from yt.mods import **
*pf = load("DD0252/DD0252")*
*array = pf.h.find_particles_by_type(ptype=1, max_num=3)*
*print "(%.5f, %.5f, %.5f) = %f\n" %(array['particle_position_x'][0],
array['particle_position_y'][0], array['particle_position_z'][0],
array['particle_mass'][0])*

This returns *(0.01055, 0.01873, 0.00224) = 0.835448. *What are the mass
units on the *0.835448*?  I don't think that they are cgs, and there
doesn't appear to be a conversion factor available via pf[' * '].  If I
continue and enter

*print pf.field_info['Density'].get_units()*
*print pf.field_info['particle_mass'].get_units()*
*
*
The 'Density' line returns *\rm{g}/\rm{cm}^3, *but the 'particle_mass'
line returns nothing. So I can't get the units from here. I can, however,
access the same particle (or at least a particle at the same location) by
using

*from yt.mods import **
*pf = load("DD0252/DD0252")*
*dd = pf.h.all_data()*
*print "(%f %f %f) =  %f Msun, ptype= %i\n"%(dd["particle_position_x"][0],
dd["particle_pos    ition_y"][0], dd["particle_position_z"][0],
dd["ParticleMassMsun"][0],dd["particle_type"][0])*

Which returns *(0.010554 0.018727 0.002239) =  82255596.670652 Msun, ptype=
1*

This seems to give reasonable values. Both methods should be equivalent
ways of to access the particle (both stellar and dark matter) data,
correct?  So how do I get my units in solar masses when using *
pf.h.find_particles_by_type()*?  Thanks for your time!

~ali
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.spacepope.org/pipermail/yt-users-spacepope.org/attachments/20120323/2770a656/attachment.htm>


More information about the yt-users mailing list