[yt-users] units of cic mesh output from covering_grid
Brendan Griffen
brendan.f.griffen at gmail.com
Tue Jul 1 15:05:45 PDT 2014
I have made a mesh using covering_grid:
pf = load(basepath+ext+'.0.hdf5', unit_base = unit_base, bounding_box =
bbox)
unit_base = {'UnitLength_in_cm' : 3.08568e+21,
'UnitMass_in_g' : 1.989e+43,
'UnitVelocity_in_cm_per_s' : 100000}
In [3]: bbox
Out[3]:
array([[ 0., 100.],
[ 0., 100.],
[ 0., 100.]])
ndim = 512
level = int(math.log(ndim,2))
cg = pf.covering_grid(level=level, left_edge=[0,0,0],dims=[ndim,ndim,ndim])
arr = cg['deposit', 'all_cic']
When I do arr.mean() etc. I get the output:
--> Doing dimension: 512
== Mass density ==
--- Max: 2.367e-13 [g/cm^-3]
--- Min: 0.000e+00 [g/cm^-3]
--- Mean: 1.764e-21 [g/cm^-3]
== Number density ==
--- Max: 1.158e+11 [cm^-3]
--- Min: 0.000e+00 [cm^-3]
--- Mean: 8.630e+02 [cm^-3]
Written out mesh:
/bigbang/data/bgriffen/c2ray/cicfiles/parent/512/density/z0.000.dat
I thought it returns the mesh in g/cm^3. Compared to just using the
particles number, box width and particle mass I get (mass & number density):
orig_mass =
(head.massarr[1]*10**10*head.nall[1]/head.hubble)/(head.boxwidth/head.hubble)**3
# just total_mass/total_volume where "head" => header info of HDF5 gadget
snapshot
In [29]: orig_mass*MsolMpc3_to_gcm3
Out[29]: 2.701e-30
In [30]: orig_mass*MsolMpc3_to_gcm3*coeff
Out[30]: 1.321e-06
These seem reasonable but the values back from yt don't. Can anyone confirm
the yt units of the mesh returned? Does it take care of hubble parameter as
read from block? Though this would only account for some minor discrepancy
- it is orders of magnitude off at this stage.
Thanks.
Brendan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.spacepope.org/pipermail/yt-users-spacepope.org/attachments/20140701/618188d4/attachment.htm>
More information about the yt-users
mailing list