Yes -- you need to strip off the extra zones before returning a field
from a ValidateSpatial(N) where N > 0. For instance, this means this
would be a bad definition:
@derived_field(name = "MyField1", validators=[ValidateSpatial(1)])
def _some_field(field, data):
return data["Density"]
but this would be a good one:
@derived_field(name = "MyField1", validators=[ValidateSpatial(1)])
def _some_field(field, data):
return data["Density"][1:-1,1:-1,1:-1]
That's why "ShearMach" doesn't work, because the field is incorrectly
sized when it is returned, and why the error shows up the same for the
next item. I should note that what happens when your field definition
is wrapped in a ValidateSpatial is that *all* of the fields accessed
inside the field definition have the additional ghost zones.
The "data" variable like has a .Level attribute as well, but I do not
think you should rely on it.
That being said, the usage of 2D data for ghost zones is mostly
unexplored. Do you have your data somewhere I can test on it?