[yt-users] units_override not working for Flash or Enzo datasets

Alex Hill ashill at haverford.edu
Thu Jul 16 11:35:27 PDT 2015


Hi,

I’m trying to use the units_override option in loaddata (because I have a data set with metadata labeling itself as cgs but is actually in kpc-Myr-Msun units), following the example in the documentation here: <http://yt-project.org/doc/analyzing/units/comoving_units_and_code_units.html>

I find that, for data sets created with FLASH 2.5 and FLASH 4.2, units_override does nothing. units_override also does nothing for the sample enzo data sets enzo_tiny_cosmology and IsolatedGalaxy. It *does* work for the sample Athena data set.

Any suggestions? Is units_override supported for Athena but not for Flash or Enzo?

Examples here and copied below with the output: <http://paste.yt-project.org/show/5713/>

units_override={"length_unit":(1.0,"cm"),"time_unit":(1.0,"s"),"mass_unit":(1.0,"g")}
ds=yt.load('/Users/hil32p/src/yt/doc/source/quickstart/IsolatedGalaxy/galaxy0030/galaxy0030')
print ds.length_unit
print ds.mass_unit
print ds.time_unit

output:

3.086e+24 cm
8.11471080586e+43 g
2.32946e+18 s

ds=yt.load('/Users/hil32p/src/yt/doc/source/quickstart/IsolatedGalaxy/galaxy0030/galaxy0030',units_override=units_override)
print ds.length_unit
print ds.mass_unit
print ds.time_unit

output:

3.086e+24 cm
8.11471080586e+43 g
2.32946e+18 s

However, it does work for the Athena dataset used in the example:

ds = yt.load('/Users/hil32p/Downloads/MHDSloshing/virgo_low_res.0054.vtk')
1.0 cm
1.0 g
1.0 s

units_override={"length_unit":(1.0,"kpc"),"time_unit":(1.0,"Myr"),"mass_unit":(1.0,"Msun")}
ds = yt.load('/Users/hil32p/Downloads/MHDSloshing/virgo_low_res.0054.vtk', units_override=units_override)
1.0 kpc
1.0 Msun
1.0 Myr

I am running yt 3.1 with python 2.7, both installed via conda.

Cheers,
 Alex

---------
Alex Hill
Senior Postdoctoral Research Associate
Strawbridge Observatory
Department of Astronomy, Haverford College
370 Lancaster Ave, Haverford, PA 19041 USA
phone: +1 484 297 2136
email/iMessage: ashill at haverford.edu




More information about the yt-users mailing list