Solved!  Thanks!

-Stephanie

--
Dr. Stephanie Tonnesen
Alvin E. Nashman Postdoctoral Fellow
Carnegie Observatories, Pasadena, CA
stonnes@gmail.com

On Thu, Aug 18, 2016 at 4:48 PM, Nathan Goldbaum <nathan12343@gmail.com> wrote:


On Thu, Aug 18, 2016 at 5:42 PM, Stephanie Tonnesen <stonnes@gmail.com> wrote:
Hi yt-users,

I am trying to get HI_Density in units of g/cm^3 but can only seem to get it in terms of code mass/code length^3. 

The relevant parts of my code look like this:

print(ds.field_list)

#only select the refined region of the box
ads = ds.r[0.42426:0.599523,0.450995:0.65,0.423461:0.590858]
adv = dv.r[0.373047:0.628906,0.369141:0.625,0.369141:0.662109]
ads.set_field_parameter('omega_baryon',0.046)
adv.set_field_parameter('omega_baryon',0.046)

plot = yt.PhasePlot(ads,"baryon_overdensity","temperature",["HI_Density"])

plot.save()

plot = yt.PhasePlot(adv,"baryon_overdensity","temperature",["HI_Density"])

plot.save()

Then I see that one of my fields is ('enzo','HI_Density') and I get a phaseplot that looks good except HI_Density is in code mass/code length^3.  If I try "hi_density" I get that there is no field ('stars','hi_density').  If I try ('gas','hi_density') I get that there is no field ('stars',('gas','hi_density').  If I try "gas","hi_density" then I get that there is no field 'stars','gas'.  I also tried to write ["HI_Density"].in_cgs() and that didn't work.  [("HI_Density").in_cgs()] also didn't work. 

Can anyone help me get cgs units in this phaseplot?

Hi Stephanie,

You have two options:

plot.set_unit('HI_Density', 'g/cm**3')

Or you can create the plot with the ('gas', 'H_p0_density') density field, which is an alias to the ('enzo', 'HI_Density') field. This is the universal yt field name for HI density. The HI_Density field is an on-disk field, so by default it is always represented in code units in plots unless you specify otherwise. The name for this field uses yt's notation for ions, where p0 means netural, p1 means singly ionized, etc.
 

Thanks!

Stephanie

--
Dr. Stephanie Tonnesen
Alvin E. Nashman Postdoctoral Fellow
Carnegie Observatories, Pasadena, CA
stonnes@gmail.com

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



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