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
ImageHDU accepts a ndarray with shape () (zero-dimensional) as a data array. This later causes issues when writing to a file because io.fits assumes that the data has at least 1 dimension, resulting in a corrupt FITS file.
Expected behavior
io.fits should never silently create a corrupt FITS file.
Description
ImageHDU
accepts a ndarray with shape()
(zero-dimensional) as a data array. This later causes issues when writing to a file becauseio.fits
assumes that the data has at least 1 dimension, resulting in a corrupt FITS file.Expected behavior
io.fits
should never silently create a corrupt FITS file.How to Reproduce
Minimal reproducible example:
Although this causes no errors/warnings, the resulting file is not valid FITS and will fail to properly open with
fits.getdata(filename)
.Versions
Windows-10-10.0.19044-SP0
Python 3.10.10 (tags/v3.10.10:aad5f6a, Feb 7 2023, 17:20:36) [MSC v.1929 64 bit (AMD64)]
astropy 5.2.1
Numpy 1.24.2
pyerfa 2.0.0.1
Scipy 1.10.0
Matplotlib 3.6.3
The text was updated successfully, but these errors were encountered: