Hi John,

I think this PR will fix your issue:


The problem is that Enzo's particle fields are a little bit special, because yt uses Enzo particle field names across all frontends as the "universal" field names. Since we want to present universal fields in CGS units by default, this means we need to take special care to figure out the units we need to attach to a piece of data for enzo particle fields. In practice, it means we need to make a distinction between the units a field has on-disk and the "output units" that we want to present to users. In this case, the profile machinery was using the on-disk units and not the output units. In the long run I'd like to get rid of output_units, because it's a constant source of issues, as most yt contributors are not working with Enzo particle data, which is the only place this distinction matters.

Here's the simple test script I used to test the PR:


Before the PR it prints numbers of order ~10^-3 g, now it prints numbers of order 10^46 g, which seems a bit more accurate!

Let me know if that fixes your issue, it's possible that there are other issues I'm missing just using my simple test script.


On Thu, Oct 20, 2016 at 5:49 AM, John Regan <johnanthonyregan@gmail.com> wrote:
Hi All,

I'm getting some strange results when I try to profile the particle distribution.
I'm using the Enzo64 dataset pulled from the YTHub.
I use the following very simple script but get values which are different by 50 orders of magnitude. I must be doing something very wrong with the create_profile routine but its not obvious

prof = create_profile(sp, [("all", "particle_radius")], [("all", "particle_mass")], weight_field=None)

Any ideas what's going wrong here? Looks at a minimum that the units are getting messed up?


yt-users mailing list