[yt-users] different hydrogen densities from different versions of yt

Nathan Goldbaum nathan12343 at gmail.com
Fri Mar 3 14:10:19 PST 2017

Ah, I see, this is covered in YTEP-0003:


And what Lauren wants to use in yt-3 is the "H_nuclei_number_density"
field. Except now that I check, we don't have that field at all, we only
have 'H_nuclei_density'. I'll submit a pull request that adds the number
density field automatically, but for now Lauren is going to need to define
her own nuclei number density field.

Apologies for the noise about bugs!


On Fri, Mar 3, 2017 at 4:06 PM, Britton Smith <brittonsmith at gmail.com>

> Hi Nathan,
> This is not a bug.  I will dig up the reference when I can, but at some
> point it was decided that X_density should alias to X_p0_density, for
> whatever X is.  Actually, I believe that this may go all the way back to
> when this naming convention was decided upon, and it was actually the other
> way around.  X_density was originally designated to be the neutral density
> of element X, and sometime later X_p0 was added as an alias of this.  I'll
> look to see if I can find the exact references for when this happened.
> britton
> On Fri, Mar 3, 2017 at 2:01 PM, Nathan Goldbaum <nathan12343 at gmail.com>
> wrote:
>> Hi Lauren,
>> Thanks for the detailed report. It was very straightforward to reproduce
>> what you're seeing using one of the test cosmological datasets on
>> yt-project.org/data.
>> I'm pretty sure you've stumbled across a bug in the way species fields
>> are set up for Enzo.
>> Here's what's happening:
>> In yt-2, the field "H_NumberDensity" corresponds to the number density of
>> all hydrogen ion species (i.e. HI + HII number density).
>> In yt-3, for some reason, ('gas', 'H_number_density') represents the
>> number density of just HI ions. To get what you had before, you'd need to
>> defined a new field which sums ('gas', 'H_number_density') and ('gas',
>> 'H_p1_number_density').
>> The following IPython session illustrates the issue:
>> In [10]: ds.fields.gas.H_density
>> Out[10]: Alias Field for "('enzo', 'HI_Density')" (gas, H_density):
>> (units: g/cm**3)
>> In [11]: ds.fields.gas.H_p0_density
>> Out[11]: Alias Field for "('gas', 'H_density')" (gas, H_p0_density):
>> (units: g/cm**3)
>> In [12]: ds.fields.gas.H_p1_density
>> Out[12]: Alias Field for "('enzo', 'HII_Density')" (gas, H_p1_density):
>> (units: g/cm**3)
>> Right now ('gas', 'H_density') is an alias to ('enzo', 'HI_Density'), and
>> ('gas', 'H_p0_density') is an alias to ('gas', 'H_density'). I'm pretty
>> sure that's wrong, ('gas', 'H_p0_density') should be an alias to ('enzo',
>> 'HI_Density') and ('gas', 'H_density') should be a derived field formed by
>> summing HI_density and HII_density.
>> Now, I'm pretty sure this is a bug, but I also don't normally with with
>> Enzo multispecies data, so I'd like some confirmation about this from
>> others who are more experienced with cosmological enzo data before I make a
>> pull request.
>> -Nathan
>> On Fri, Mar 3, 2017 at 2:44 PM, Lauren Corlies <laurennc009 at gmail.com>
>> wrote:
>>> Hello,
>>> I've been a yt user for a while now but have recently noticed something
>>> concerning. A few months ago, I made the switch to yt3 and am currently
>>> using the new yt 3.3.4
>>> I've been working with recently generated, cosmological zoom in
>>> simulations and I've generated a basic yt ray object.  When I plot the
>>> hydrogen number density along the ray, the values that it's generating are
>>> un-physically low (seen here <http://i.imgur.com/1C1oAVr.png>).
>>> It's especially concerning because when I use the old yt2 installation:
>>> Version = 2.7-dev
>>> Changeset = 1f9ca06815d0
>>> and generate a yt ray object with the exact same trajectory, the
>>> hydrogen number density values are much more sensible (seen here
>>> <http://i.imgur.com/tcDcNd8.png>). The rays in both yt versions have
>>> mostly the same shape but there are some strong features in the yt2 version
>>> than in the yt3 one.
>>> The discrepancy is specifically with this field and not other intrinsic
>>> fields like temperature or regular density (also attached).
>>> Am I accessing the field incorrectly and there's a better way to get
>>> these values with the new version of yt? Or is there something deeper
>>> happening? The hydrogen number density is particularly important for the
>>> ion densities and emission that I've been interested in.
>>> All of the plots and the script <http://paste.yt-project.org/show/7066/>
>>> to generate them are attached and posted online as described on the docs
>>> page, tagged with my last name with links included as an attachment.
>>> Thanks for the help,
>>> Lauren Corlies
>>> _______________________________________________
>>> yt-users mailing list
>>> yt-users at lists.spacepope.org
>>> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>> _______________________________________________
>> yt-users mailing list
>> yt-users at lists.spacepope.org
>> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
> _______________________________________________
> yt-users mailing list
> yt-users at lists.spacepope.org
> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.spacepope.org/pipermail/yt-users-spacepope.org/attachments/20170303/c823d5d4/attachment.html>

More information about the yt-users mailing list