Open V-Nathir opened 3 weeks ago
I can replicate this with the following MWE:
import yt
ds = yt.load_sample("output_00080")
print(ds.current_redshift)
print(ds.critical_density.to("Msun/kpc**3"))
print(ds.critical_density.to("Msun/kpccm**3"))
Outputs (incorrectly):
0.14255728632206321
155.7792235477523 Msun/kpc**3
155.7792235477523 Msun/kpccm**3
Bug report
After loading an output (RAMSESDataset) and asking for critical density in different units, the value does not change. I computed by hand to see the comparative:
Code for reproduction
Actual outcome
Redshift 1.127658514889251 unyt_quantity(465.91611928, 'Msun/kpc3') unyt_quantity(465.91611928, 'Msun/kpccm3')
The comovil units have not been change.
Expected outcome
Computed by hand (ref: BRYAN and NORMAN 1998, section 2.1)
OUTPUT: unyt_quantity(465.88541137, 'Msun/kpc3'), unyt_quantity(48.36969333, 'Msun/kpccm3')
Version Information