I have created an array named distance that contains 1242 values. I want to add this array as the 11th column in an already existing FITS file that contains
Finally they released an updated library that allows the modification of a table extension in a human way!
Last release of FITSIO. You can easily add a column with a code looking like the following:
import fitsio
from fitsio import FITS,FITSHDR
...
fits = FITS('file.fits','rw')
fits[-1].insert_column(name = 'newcolumn', data = mydata) # add the extra column
fits.close()