You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The WCSNDMap silently reorders the array data by calling data.reshape(geom.data_shape) if the input data shape does not match the expected shape.
This is most certainly wrong, as you cannot just reshape the same memory into the desired shape and assume the values are correct.
E.g. in the following example, the correct thing would probably have been a transpose operation (I assume WCSGeom assumes FITS / Fortran shape order), not the reshaping operation.
Gammapy version
Current main branch and also released versions.
Bug description
The
WCSNDMap
silently reorders the array data by callingdata.reshape(geom.data_shape)
if the input data shape does not match the expected shape.This is most certainly wrong, as you cannot just reshape the same memory into the desired shape and assume the values are correct.
E.g. in the following example, the correct thing would probably have been a transpose operation (I assume WCSGeom assumes FITS / Fortran shape order), not the reshaping operation.
Expected behavior
An error in case the data shape does not match instead of silently corrupting the input data.
To Reproduce
See example above.
Other information
CC @StFroese @LukasNickel
The text was updated successfully, but these errors were encountered: