MUSE Pipeline Reference Manual  2.1.1
Data Structures | Functions
Mask handling

Data Structures

struct  muse_mask
 Handling of "mask" files. More...
 

Functions

muse_maskmuse_mask_new (void)
 Allocate memory for a new muse object. More...
 
void muse_mask_delete (muse_mask *aMask)
 Deallocate memory associated to a muse_mask object. More...
 
muse_maskmuse_mask_load (const char *aFilename)
 Load a mask file and its FITS header. More...
 
cpl_error_code muse_mask_save (muse_mask *aMask, const char *aFilename)
 Save the data and the FITS headers of a MUSE mask to a file. More...
 

Detailed Description

This module contains a simple wrapper around the cpl_mask object, so that we can easily pass a mask together with its (FITS) header around to between functions.

Function Documentation

void muse_mask_delete ( muse_mask aMask)

Deallocate memory associated to a muse_mask object.

Parameters
aMaskinput MUSE mask

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

Definition at line 78 of file muse_mask.c.

References header, and mask.

Referenced by muse_mask_load(), muse_postproc_process_exposure(), and muse_postproc_properties_delete().

muse_mask* muse_mask_load ( const char *  aFilename)

Load a mask file and its FITS header.

Parameters
aFilenamename of the file to load
Returns
a new muse_mask * or NULL on error
Remarks
The new mask has to be deallocated using muse_mask_delete().
Only FITS keywords from the primary FITS header will be loaded.
Exceptions
return NULL, propagate CPL error codecpl_propertylist_load() fails (this handles the case of an invalid or empty filename)
return NULL, propagate CPL error codecpl_mask_load() fails

Definition at line 103 of file muse_mask.c.

References header, mask, muse_mask_delete(), and muse_mask_new().

Referenced by muse_processing_load_mask().

muse_mask* muse_mask_new ( void  )

Allocate memory for a new muse object.

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

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

Definition at line 61 of file muse_mask.c.

Referenced by muse_mask_load(), and muse_sky_create_skymask().

cpl_error_code muse_mask_save ( muse_mask aMask,
const char *  aFilename 
)

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

Parameters
aMaskinput MUSE mask
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 member of the muse_mask structure.
Exceptions
return CPL_ERROR_NULL_INPUTaImage or aFilename are NULL
return CPL error codefailure to save any of the components

Definition at line 143 of file muse_mask.c.

References header, and mask.

Referenced by muse_processing_save_mask().