Hi all,<div><br></div><div>For a ndarray-subclass I'm working on I <a href="https://github.com/sunpy/sunpy/blob/master/sunpy/map/basemap.py#L145-165">extended the array_wrap and array_finalize functions</a> so that operations like __sub__() would return a new instance of the subclass, instead of an ndarray (although<a href="http://mail.scipy.org/pipermail/scipy-user/2011-August/030179.html"> I still haven't completely figured this out yet</a>.)</div>
<div><br></div><div>One side-effect of this, however, is that now other operations which should <i>not</i> return a subclass (such as std) are returning one;</div><div><br></div><div><div> def __array_finalize__(self, obj):</div>
<div>        """Finishes instantiation of the new map object"""</div><div>        if obj is None:</div><div>            return</div><div><br></div><div>        if hasattr(obj, 'header'):</div>
<div>            self.header = obj.header</div><div><br></div><div>            # preserve object properties</div><div>            properties = self.get_properties(obj.header)</div><div>            for attr, value in list(properties.items()):</div>
<div>                setattr(self, attr, getattr(obj, attr, value))</div><div>                </div><div>            self.center = obj.center</div><div>            self.scale = obj.scale</div><div>            self.units = obj.units</div>
<div>        </div><div>    def __array_wrap__(self, out_arr, context=None):</div><div>        """Returns a wrapped instance of a Map object"""</div><div>        return np.ndarray.__array_wrap__(self, out_arr, context)</div>
</div><div><br></div><div>I'm sure it is simply a coding error on my part, but so far I havne't been able to track it down.</div><div><br></div><div>Any ideas?</div><div><br></div><div>Thanks,</div><div>Keith</div>