I'm trying to append data to a fits file using astropy.io.
Here is an example of my code:
import numpy as np
from astropy.io import fits
a1 = np.array([1,2,4,8])
a2 = np.array([0,1,2,3])
hdulist = fits.BinTableHDU.from_columns(
[fits.Column(name='FIRST', format='E', array=a1),
fits.Column(name='SECOND', format='E', array=a2)])
hdulist.writeto('file.fits')
The error I get is
type object 'BinTableHDU' has no attribute 'from_columns'
- Could this be a problem with the astropy.io version I'm using?
- Is there an easier way to add extensions or columns to a fits file using astropy.io?
Any help would be appreciated.