Hi,

On-disk fields are always presented in code units. As you saw, for your data you've specified that code units *are* cgs, however that doesn't change the rule that I -disk fields are presented using code units.

To get fields that are presented in CGS, you should use "universal" field names. Unfortunately I'm on my phone right now so I can't look up the universal field names for those two fields.

Finally, you can always convert to CGS:

ds.point([0,0,0])['magz'].to('G')

On Fri, Feb 17, 2017 at 11:55 AM Yingchao Lu <yingchao.lu@rice.edu> wrote:

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

_______________________________________________
yt-users mailing list
yt-users@lists.spacepope.org
http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org