gavo.formats.fitstable module

Writing data in FITS binary tables

gavo.formats.fitstable.makeFITSTable(dataSet, acquireSamples=False)[source]

returns a hdulist containing extensions for the tables in dataSet.

This function may block basically forever. Never call this from the main server, always use threads or separate processes (until pyfits is fixed to be thread-safe).

This will add table parameters as header cards on the resulting FITS header.

gavo.formats.fitstable.makeFITSTableFile(dataSet, acquireSamples=True)[source]

returns the name of a temporary file containing a fits file representing dataSet.

The caller is responsible to remove the file.

gavo.formats.fitstable.writeDataAsFITS(data, outputFile, acquireSamples=False)[source]

a formats.common compliant data writer.

This will write out table params as header cards. To serialise those yourself (as is required for spectral data model compliant tables), set an attribute IgnoreTableParams (with an arbitrary value) on the table.

gavo.formats.fitstable.writeFITSTableFile(hdulist)[source]

returns the name of a temporary file containing the FITS data for hdulist.