MUSE Pipeline Reference Manual  2.1.1
Data Structures | Functions
Table handling

Data Structures

struct  muse_table
 Structure to store a table together with a property list. More...
 

Functions

muse_tablemuse_table_new (void)
 Allocate memory for a new muse_table object. More...
 
void muse_table_delete (muse_table *aTable)
 Deallocate memory associated to a muse_table object. More...
 
muse_tablemuse_table_load (const char *aFilename, unsigned char aIFU)
 Load a table file and its primary FITS header. More...
 
cpl_error_code muse_table_save (muse_table *aTable, const char *aFilename)
 Save the data and the FITS headers of a MUSE table to a file. More...
 

Detailed Description

This module contains a simple wrapper around the cpl_table object, so that we can easily pass a table together with its properties (i.e. its primary FITS header) around to between functions.

Function Documentation

void muse_table_delete ( muse_table aTable)

Deallocate memory associated to a muse_table object.

Parameters
aTableinput MUSE table

Just calls cpl_table_delete() and cpl_propertylist_delete() for the four components of a muse_table, and frees memory for the aTable pointer. As a safeguard, it checks if a valid pointer was passed, so that crashes cannot occur.

Definition at line 80 of file muse_table.c.

References header, and table.

Referenced by muse_flux_object_delete(), muse_postproc_cube_resample_and_collapse(), muse_postproc_process_exposure(), muse_postproc_properties_delete(), muse_processing_load_ctable(), muse_processing_load_table(), muse_table_load(), muse_table_load_filter(), and muse_wcs_locate_sources().

muse_table* muse_table_load ( const char *  aFilename,
unsigned char  aIFU 
)

Load a table file and its primary FITS header.

Parameters
aFilenamename of the file to load
aIFUMUSE IFU to load the data for (0 for generic tables).
Returns
a new muse_table * or NULL on error
Remarks
The new table has to be deallocated using muse_table_delete().
Only FITS keywords from the primary FITS header will be loaded into the header component.
Exceptions
set CPL_ERROR_NULL_INPUT, return NULLaFilename is NULL
return NULL, propagate CPL error codecpl_table_load() fails

Definition at line 106 of file muse_table.c.

References header, muse_pfits_get_extname(), muse_table_delete(), muse_table_new(), muse_utils_get_extension_for_ifu(), and table.

Referenced by muse_processing_load_table().

muse_table* muse_table_new ( void  )

Allocate memory for a new muse_table object.

Returns
a new muse_table * or NULL on error
Remarks
The returned object has to be deallocated using muse_table_delete().
This function does not allocate the contents of the elements, these have to be allocated with cpl_table_new() or cpl_propertylist_new(), respectively, or equivalent functions.

Simply allocate memory to store the pointers of the muse_table structure.

Definition at line 63 of file muse_table.c.

Referenced by muse_flux_get_response_table(), muse_flux_get_telluric_table(), muse_table_load(), and muse_table_load_filter().

cpl_error_code muse_table_save ( muse_table aTable,
const char *  aFilename 
)

Save the data and the FITS headers of a MUSE table to a file.

Parameters
aTableinput MUSE table
aFilenamename of the output file
Returns
CPL_ERROR_NONE or the relevant cpl_error_code on error
Remarks
The primary headers of the output file will be constructed from the header component of the muse_table structure.
Exceptions
return CPL_ERROR_NULL_INPUTaImage or aFilename are NULL
return CPL error codefailure to save any of the components

Definition at line 173 of file muse_table.c.

References header, and table.

Referenced by muse_processing_save_table().