[yt-users] override code units

Yingchao Lu yingchao.lu at rice.edu
Fri Feb 17 09:54:59 PST 2017


Hi All,

 

My simulation seems to have no detail information on units, so I want to
assign cgs to the output. However, when I do the following 

 

---------------------------------------------------------------------

import yt

units_override = {"length_unit":(1.0,"cm"),

                  "time_unit":(1.0,"s"),

                  "mass_unit":(1.0,"g"),

                  'nele_unit': (1.0, "cm**-3"),

                 "magnetic_unit":(1.0,"gauss")}

ds = yt.load('flash_hdf5_plt_cnt_0000', units_override=units_override)

print ds.point([0,0,0])['magz']

print ds.point([0,0,0])['nele']

---------------------------------------------------------------------

 

 

The output is:

---------------------------------------------------------------------

[ 0.] code_magnetic

[  2.87595814e+15] code_length**(-3)

---------------------------------------------------------------------

 

How can I get:

---------------------------------------------------------------------

[ 0.] gauss

[  2.87595814e+15] cm**(-3)

---------------------------------------------------------------------

 

 

Thanks,

Yingchao

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.spacepope.org/pipermail/yt-users-spacepope.org/attachments/20170217/82ad6934/attachment.htm>


More information about the yt-users mailing list