E astropy.utils.exceptions.AstropyUserWarning: ERROR loading embedded ASDF: non-ASCII characters are present in the FITS file header and have been replaced by "?" characters
This can be further reduced to just astropy:
from astropy.io import fits
import numpy as np
hdulist = fits.HDUList()
hdulist.append(fits.PrimaryHDU())
arr = np.arange(32 * 16).reshape((32, 16)).astype(dtype=[('col', 'f8')])
hdulist.append(fits.BinTableHDU())
hdulist[-1].data = arr
hdulist.writeto('foo.fits', overwrite=True)
with fits.open('foo.fits') as ff:
ff.info()
Running the above code results in:
UnicodeDecodeError: 'ascii' codec can't decode byte 0x80 in position 2: ordinal not in range(128)
and
OSError: Header missing END card.
Note that in all cases the error doesn't occur until the data is read. No errors are issued on write.
Let's assume we have a schema for
TableModel
that containsIf we assign data to the model as follows, the produced file is corrupt:
The above code fails on
TableModel(fn)
with:This can be further reduced to just astropy:
Running the above code results in:
Note that in all cases the error doesn't occur until the data is read. No errors are issued on write.