Adding a new column to a FITS file via python
Question: 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 10 columns.

I am using pyfits.

I tried pyfits.append(filename, distance) which showed no errors but did not
add my column to the FITS file.

Any suggestions??


Answer: Finally they released an updated library that allows the modification of a
table extension in a human way!

Last release of [FITSIO](https://pypi.python.org/pypi/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()
    

