Guys,
What are the implicit units of the deposited field? In the following script using implicit units returns an incorrect result, while setting them explicitly gives the correct one.
import yt
import numpy as np
d = yt.load("rei10_a0.1001/rei10_a0.1001.art")
xcen = d.arr([5,5,5],"Mpccm/h")
s = d.sphere(xcen,(100,"kpc"))
sf = ('STAR','particle_mass')
df = ('deposit','STAR_density')
print("sum=%9.3e int=%9.3e"%(np.sum(s[sf]),np.sum(s[df]*s[('gas','cell_volume ')])))
print("sum=%9.3e int=%9.3e"%(np.sum(s[sf].in_units("Msun")),np.sum(s[df].in_ units("Msun/kpc**3")*s[('gas', 'cell_volume')].in_units("kpc* *3"))))
>
sum=6.894e-05 int=1.818e-31
sum=3.252e+04 int=3.252e+04
n
_______________________________________________
yt-users mailing list -- yt-users@python.org
To unsubscribe send an email to yt-users-leave@python.org