I am trying to add data to the 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 the problem with the version of astropy.io that I am using?
- Is there an easier way to add extensions or columns to an astropy.io-enabled file?
Any help would be appreciated.
source share