The bug that prevented you from plotting the 'dx' field has been fixed:


On Monday, September 23, 2013, Sam Skillman wrote:
Hi Cameron,

Just for completeness, Nathan and I were discussing in irc but I'll respond here my thoughts up until now. At least the first piece about dx is a bug:

I think this comes from dx being an "excluded" field in a fixed resolution buffer, and when the SlicePlot goes to loop over all the data source fields, it gets explicitly ignored. Obviously this should not be the case if the user explicitly adds a slice of dx. This is a bug.  In yt/visualization/ you can see why dy works:
_exclude_fields = ['pz','dpz','dx','x','y','z']

For the rest of the issues, I think if you get rid of ValidateSpatial for everything that you have in the notebook, it runs fine. ValidateSpatial of more than 0 will mean you need to account for that and take the correct slices.  That said, in 2d I can't make sense of the shapes that come out of ValidateSpatial(1) for GridLevel. I don't know what is up with that.

I'll also just say that either:
sl.set_log(field, boolean) 
pf.h; pf.field_info[field].take_log=False is easier than a derived field just to set the log.

One last thing -- I'm not sure why the following code has 2 returns in the

def _dy(field, data):
    return[1] <--- note the return here. The rest should probably be removed. Not sure why it is even there.
    return np.ones(data.ActiveDimensions, dtype='float64') *[1]
add_field('dy_lin', function=_dy, display_field=False,
          validators=[ValidateSpatial(0)], take_log=False)


On Mon, Sep 23, 2013 at 8:00 PM, Cameron Hummels <> wrote:
Hello fellow yt'ers:

I'm having some issues with some fields that I don't think are behaving the way they should be in yt.  I'm encountering a number of problems with a simple 2D enzo dataset (x and y), so I put together a notebook demonstrating my various issues.

To summarize the weirdness from the notebook:

1) The 'dx' field doesn't seem to be able to be displayed (i.e. when I try to slice it), whereas the 'dy' field is fine.  'dz' even exists, but it's just uniformly 0, as is expected from a 2D dataset.

2) When I try to produce a new field which is 2^GridLevel, I get weird results (ignored levels and more).

3-5) I get strange behavior when trying to make a new field combining GridLevel and 'dy', since GridLevel  has twice as many indices as any of the spatial fields (in the z direction no less).  This results in some odd behavior when I try to pair various subsets of GridLevel with 'dy'.

Any clarification of these ideas is welcome.  The docs and source haven't yet revealed what is going on here.  Thanks!


Cameron Hummels
Postdoctoral Researcher
Steward Observatory
University of Arizona

yt-users mailing list