use np.sum directly instead of apply_over_axes
@@ -272,9 +272,8 @@ class WcsNDMap(WcsMap):
vals = self.get_by_idx(self.geom.get_idx())
map_out.fill_by_coord(self.geom.get_coord()[:2], vals)
else:
- data = np.apply_over_axes(np.sum, self.data,
- axes=np.arange(self.data.ndim - 2))
- map_out.data = np.squeeze(data)
+ axis = tuple(np.arange(self.data.ndim - 2).tolist())
+ map_out.data = np.sum(self.data, axis=axis)
return map_out
