These are chat archives for astropy/ci-helpers

Jul 2016
Thomas Robitaille
Jul 20 2016 00:26
@Danni3l - sorry for the delay, in future ask your question in the astropy channel (this is ci-helpers) since it is more active :) But since you are here, I can help you. Basically, if you have FITS files, the easiest way to append rows is to read in the FITS file via the Table interface and use add_row
so e.g.:
t ='myfile.fits')
Daniel Mendes
Jul 20 2016 10:14
Thank you for your help !
Daniel Mendes
Jul 20 2016 10:28

When i try to open the fits file with t ='myfile.fits') i got an error.*
My first idea was to open it like:

inp = 
tbl = inp[1].data
tbl = Table(ttbl)

but doing this i also get an error when i use add_row()

ValueError                                Traceback (most recent call last)
C:\Users\daniel\Desktop\ in <module>()
    148     qTbl = Table(qtbl)
--> 150     mtbl.add_row(gTbl)
    151     mtbl.add_row(qTbl)
    152     '''

C:\Users\daniel\Downloads\WinPython-64bit-\python-3.4.4.amd64\lib\site-packages\astropy\table\ in add_row(self, vals, mask)
   2030              3   6   9
   2031         """
-> 2032         self.insert_row(len(self), vals, mask)
   2034     def insert_row(self, index, vals=None, mask=None):

C:\Users\daniel\Downloads\WinPython-64bit-\python-3.4.4.amd64\lib\site-packages\astropy\table\ in insert_row(self, index, vals, mask)
   2120             if len(self.columns) != len(vals):
-> 2121                 raise ValueError('Mismatch between number of vals and columns')
   2123             if mask is not None:

ValueError: Mismatch between number of vals and columns