<div dir="ltr">Hi Matt,<div><br></div><div>Thanks for the message and suggestions.  </div><div class="gmail_extra"><br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div class="im">
<br>
</div>Yes -- you need to strip off the extra zones before returning a field<br>
from a ValidateSpatial(N) where N > 0.  For instance, this means this<br>
would be a bad definition:<br>
<br>
@derived_field(name = "MyField1", validators=[ValidateSpatial(1)])<br>
def _some_field(field, data):<br>
    return data["Density"]<br>
<br>
but this would be a good one:<br>
<br>
@derived_field(name = "MyField1", validators=[ValidateSpatial(1)])<br>
def _some_field(field, data):<br>
    return data["Density"][1:-1,1:-1,1:-1]<br>
<br></blockquote><div><br></div><div>I agree that this makes sense, but I actually mostly copied the shear field definition from the VorticitySquared field definition in the code, which did not observe this rule.  In fact, neither does DivV.  These fields return a field which is [x+2][y+2][z+2] in shape, which I found odd, but that is why I left it as it was in my code.  Either way, when I make the correction to return a field of size [x][y][z], it doesn't seem to fix the problem, unfortunately.  The error seems to occur prior to the field being returned, so I think that it may be an independent problem.</div>

<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
That's why "ShearMach" doesn't work, because the field is incorrectly<br>
sized when it is returned, and why the error shows up the same for the<br>
next item.  I should note that what happens when your field definition<br>
is wrapped in a ValidateSpatial is that *all* of the fields accessed<br>
inside the field definition have the additional ghost zones.<br></blockquote><div><br></div><div>I don't understand this.  How is my entire field definition wrapped in a ValidateSpatial?  I only include ValidateSpatial in the validators when I add the field--it doesn't seem to me that it is wrapping the whole thing in any of my 3 field definitions, but maybe I'm just missing this.  In my ShearMach3, I simply have a list of separate validators for different fields, one ValidateSpatial with 1 ghost zone for the velocity fields, and one ValidateSpatial with 0 ghost zones for the dx and GridLevel fields.  I guess my use of whitespace makes it look like they are nested, but they are not.</div>

<div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
The "data" variable like has a .Level attribute as well, but I do not<br>
think you should rely on it.<br>
<br></blockquote><div>I'll look at this level attribute to see if this helps.</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
That being said, the usage of 2D data for ghost zones is mostly<br>
unexplored.  Do you have your data somewhere I can test on it?<br></blockquote><div><br></div><div>The dataset is up at <a href="http://www.astro.columbia.edu/~chummels/DD0100.tar.gz">http://www.astro.columbia.edu/~chummels/DD0100.tar.gz</a> if you want to take a look at it.  It's small and a quick download.</div>

<div><br></div><div>Thanks for the help with this!</div><div><br></div><div>Cameron</div></div><div><br></div>-- <br>Cameron Hummels<div>Postdoctoral Researcher</div><div>Steward Observatory</div><div>University of Arizona</div>

<div><a href="http://chummels.org" target="_blank">http://chummels.org</a></div>
</div></div>