MUSE Pipeline Reference Manual
2.1.1
|
Data Structures | |
struct | muse_processing_framecounter |
struct | muse_processing |
Typedefs | |
typedef struct muse_processinginfo_s | muse_processinginfo_t |
Enumerations |
Functions | |
muse_processing * | muse_processing_new (const char *aName, cpl_recipe *aRecipe) |
Create a new processing structure. More... | |
void | muse_processing_delete (muse_processing *aProcessing) |
Free the muse_processing structure. More... | |
void | muse_processing_append_used (muse_processing *aProcessing, cpl_frame *aFrame, cpl_frame_group aGroup, int aDuplicate) |
Add a frame to the set of used frames. More... | |
cpl_frame * | muse_processing_new_frame (muse_processing *aProcessing, int aIFU, cpl_propertylist *aHeader, const char *aTag, cpl_frame_type aType) |
Create a new frame for a result file. More... | |
int | muse_processing_save_image (muse_processing *aProcessing, int aIFU, muse_image *aImage, const char *aTag) |
Save a computed MUSE image to disk. More... | |
cpl_error_code | muse_processing_save_cube (muse_processing *aProcessing, int aIFU, void *aCube, const char *aTag, muse_cube_type aType) |
Save a MUSE datacube to disk. More... | |
cpl_table * | muse_processing_load_ctable (muse_processing *aProcessing, const char *aTag, unsigned char aIFU) |
Load a CPL table according to its tag and IFU/channel number. More... | |
muse_table * | muse_processing_load_table (muse_processing *aProcessing, const char *aTag, unsigned char aIFU) |
Load a MUSE table according to its tag and IFU/channel number. More... | |
cpl_error_code | muse_processing_save_table (muse_processing *aProcessing, int aIFU, void *aTable, cpl_propertylist *aHeader, const char *aTag, muse_table_type aType) |
Save a computed table to disk. More... | |
int | muse_processing_save_cimage (muse_processing *aProcessing, int aIFU, cpl_image *aImage, cpl_propertylist *aHeader, const char *aTag) |
Save a computed FITS image to disk. More... | |
cpl_propertylist * | muse_processing_load_header (muse_processing *aProcessing, const char *aTag) |
load a header according to its tag More... | |
cpl_error_code | muse_processing_save_header (muse_processing *aProcessing, int aIFU, cpl_propertylist *aHeader, const char *aTag) |
Save a FITS header to disk. More... | |
muse_mask * | muse_processing_load_mask (muse_processing *aProcessing, const char *aTag) |
Load a mask file and its FITS header. More... | |
int | muse_processing_save_mask (muse_processing *aProcessing, int aIFU, muse_mask *aMask, const char *aTag) |
Save a computed MUSE mask to disk. More... | |
cpl_boolean | muse_processing_check_intags (muse_processing *aProcessing, const char *aTag, int aNChars) |
Check that a tag is part of the input tags of a processing structure. More... | |
cpl_error_code | muse_processing_check_input (muse_processing *aProcessing, unsigned char aIFU) |
Check the input files for completeness. More... | |
cpl_table * | muse_processing_sort_exposures (muse_processing *aProcessing) |
Sort input frames (containing lists of pixel table filenames) into different exposures. More... | |
static muse_processinginfo_t * | muse_processinginfo_get (const cpl_recipe *aRecipe) |
Get processinginfo for a certain recipe. | |
void | muse_processinginfo_register (cpl_recipe *plugin, cpl_recipeconfig *recipeconfig, muse_processing_prepare_header_func *prepare_header, muse_processing_get_frame_level_func *get_frame_level, muse_processing_get_frame_mode_func *get_frame_mode) |
Register extended functionalities for MUSE recipes. More... | |
void | muse_processinginfo_delete (cpl_recipe *aRecipe) |
Clear all information from the processing info and from the recipe config. More... | |
cpl_error_code | muse_processing_prepare_header (const cpl_recipe *aRecipe, const char *aFrametag, cpl_propertylist *aHeader) |
Prepare and check a FITS header for a certain frame tag. More... | |
cpl_frame_level | muse_processing_get_frame_level (const cpl_recipe *aRecipe, const char *aFrametag) |
Get the level for a product frame with a certain tag. More... | |
int | muse_processing_get_frame_mode (const cpl_recipe *aRecipe, const char *aFrametag) |
Get the mode for a product frame with a certain tag. More... | |
cpl_recipeconfig * | muse_processing_get_recipeconfig (cpl_recipe *aRecipe) |
Get the recipe (frame) configuration. More... | |
cpl_error_code | muse_processing_prepare_property (cpl_propertylist *aHeader, const char *aName, cpl_type aType, const char *aDescription) |
Prepare and check the specified property. More... | |
void | muse_processing_recipeinfo (cpl_plugin *aPlugin) |
Output main pipeline configuration, inputs, and parameters. More... | |
Variables | |
static muse_processinginfo_t * | muse_processinginfo = NULL |
The following functions are used to make the data processing in MUSE easier and uniform.
typedef struct muse_processinginfo_s muse_processinginfo_t |
Structure to hold the extended processing information.
enum muse_cube_type |
Cube format types supported by the MUSE pipeline.
Definition at line 76 of file muse_processing.h.
enum muse_frame_mode |
Frames modes used in the MUSE pipeline.
Definition at line 57 of file muse_processing.h.
enum muse_table_type |
Table format types supported by the MUSE pipeline.
Enumerator | |
---|---|
MUSE_TABLE_TYPE_CPL |
Normal FITS tables handled by CPL |
MUSE_TABLE_TYPE_PIXTABLE |
MUSE pixel table |
MUSE_TABLE_TYPE_MUSE |
normal FITS tables, read with headers |
Definition at line 69 of file muse_processing.h.
void muse_processing_append_used | ( | muse_processing * | aProcessing, |
cpl_frame * | aFrame, | ||
cpl_frame_group | aGroup, | ||
int | aDuplicate | ||
) |
Add a frame to the set of used frames.
aProcessing | the processing structure |
aFrame | the new used frame |
aGroup | the frame group to assign to the frame |
aDuplicate | if not zero, duplicate the frame before appending it into the used frameset |
Insert aFrame into the usedframes frameset of aProcessing if it is not already present in that frameset (present being checked using the filename and tag information of existing frames against aFrame). If aDuplicate is zero, the frame is destroyed here, assuming that it was duplicated from some other frame before being passed into this function. In this case, any property (e.g. filename) queried from the frame can no longer be used afterwards!
Definition at line 194 of file muse_processing.c.
References muse_processing_framecounter::counter, counter, muse_processing_framecounter::ifu, inframes, muse_frameset_sort_raw_other(), name, parameters, muse_processing_framecounter::tag, and usedframes.
Referenced by muse_basicproc_load_reduced(), muse_basicproc_params_delete(), muse_lsf_cube_load_all(), muse_postproc_cube_load_output_wcs(), muse_processing_load_header(), muse_processing_load_mask(), muse_processing_load_table(), muse_processing_lsf_params_load(), muse_processing_sort_exposures(), muse_sky_continuum_load(), muse_sky_lines_load(), and muse_table_load_filter().
cpl_error_code muse_processing_check_input | ( | muse_processing * | aProcessing, |
unsigned char | aIFU | ||
) |
Check the input files for completeness.
aProcessing | the processing structure |
aIFU | the IFU/channel number |
Check the input frames for completeness. We check the min and max of all raw input files and the calibration files associated to the raw inputs. On error, a message will be printed and the relevant CPL error code will be returned.
return CPL_ERROR_NULL_INPUT | aProcessing is NULL |
return CPL_ERROR_ILLEGAL_INPUT | recipe config not found in aProcessing |
output error message, return CPL_ERROR_DATA_NOT_FOUND | a least one input requirement is not fulfilled |
Definition at line 999 of file muse_processing.c.
References inframes, intags, muse_frameset_find(), muse_processing_get_recipeconfig(), and recipe.
Referenced by muse_basicproc_load().
cpl_boolean muse_processing_check_intags | ( | muse_processing * | aProcessing, |
const char * | aTag, | ||
int | aNChars | ||
) |
Check that a tag is part of the input tags of a processing structure.
aProcessing | the processing structure |
aTag | the tag to check for |
aNChars | the number of characters to check |
Check the intags array of aProcessing against aTag, using strncmp() and up to aNChars length.
return CPL_ERROR_NULL_INPUT | aProcessing and/or aTag are NULL |
Definition at line 962 of file muse_processing.c.
References intags.
Referenced by muse_basicproc_params_delete(), and muse_processing_sort_exposures().
void muse_processing_delete | ( | muse_processing * | aProcessing | ) |
Free the muse_processing structure.
aProcessing | the structure to be freed |
Definition at line 158 of file muse_processing.c.
References counter, inframes, intags, outframes, parameters, muse_processing_framecounter::tag, and usedframes.
cpl_frame_level muse_processing_get_frame_level | ( | const cpl_recipe * | aRecipe, |
const char * | aFrametag | ||
) |
Get the level for a product frame with a certain tag.
aRecipe | the CPL recipe |
aFrametag | the tag of the output frame |
Definition at line 188 of file muse_processinginfo.c.
References muse_processinginfo_get().
Referenced by muse_processing_new_frame().
int muse_processing_get_frame_mode | ( | const cpl_recipe * | aRecipe, |
const char * | aFrametag | ||
) |
Get the mode for a product frame with a certain tag.
aRecipe | the CPL recipe |
aFrametag | the tag of the output frame |
Definition at line 203 of file muse_processinginfo.c.
References MUSE_FRAME_MODE_ALL, and muse_processinginfo_get().
Referenced by muse_processing_new_frame().
cpl_recipeconfig* muse_processing_get_recipeconfig | ( | cpl_recipe * | aRecipe | ) |
Get the recipe (frame) configuration.
aRecipe | Pointer to the recipe |
Definition at line 217 of file muse_processinginfo.c.
References muse_processinginfo_get().
Referenced by muse_processing_check_input().
cpl_table* muse_processing_load_ctable | ( | muse_processing * | aProcessing, |
const char * | aTag, | ||
unsigned char | aIFU | ||
) |
Load a CPL table according to its tag and IFU/channel number.
aProcessing | the processing structure, includes the input frames list |
aTag | the tag |
aIFU | the IFU/channel number |
This function tries to find an extension that is specific for the given IFU number, and loads that, if available. If not, it is assumed that either the table is a general one applicable for all IFUs or only contains data for this one IFU.
In effect, it uses muse_processing_load_table() and strips off the header component.
set CPL_ERROR_NULL_INPUT, return NULL | aProcessing is NULL |
propagate error code, return NULL | muse_processing_load_table() fails |
Definition at line 606 of file muse_processing.c.
References muse_processing_load_table(), muse_table_delete(), and muse_table::table.
cpl_propertylist* muse_processing_load_header | ( | muse_processing * | aProcessing, |
const char * | aTag | ||
) |
load a header according to its tag
aProcessing | the processing structure, includes the input frames list |
aTag | the tag |
This function tries to find the frame in the input frameset and loads the propertylist from it.
set CPL_ERROR_NULL_INPUT, return NULL | aProcessing is NULL |
Definition at line 805 of file muse_processing.c.
References inframes, muse_frameset_find_master(), and muse_processing_append_used().
muse_mask* muse_processing_load_mask | ( | muse_processing * | aProcessing, |
const char * | aTag | ||
) |
Load a mask file and its FITS header.
aProcessing | the processing structure, includes the input frames list |
aTag | the tag |
muse_mask *
or NULL on error muse_mask_delete()
. return NULL, propagate CPL error code | muse_frameset_find() fails to find a frame of the given tag |
return NULL, propagate CPL error code | muse_mask_load() returns NULL |
Definition at line 887 of file muse_processing.c.
References inframes, muse_mask::mask, muse_frameset_find(), muse_mask_load(), and muse_processing_append_used().
muse_table* muse_processing_load_table | ( | muse_processing * | aProcessing, |
const char * | aTag, | ||
unsigned char | aIFU | ||
) |
Load a MUSE table according to its tag and IFU/channel number.
aProcessing | the processing structure, includes the input frames list |
aTag | the tag |
aIFU | the IFU/channel number |
This function tries to find an extension that is specific for the given IFU number, and loads that, if available. If not, it is assumed that either the table is a general one applicable for all IFUs or only contains data for this one IFU.
The header component of the returned MUSE table is always loaded from the primary FITS extension.
set CPL_ERROR_NULL_INPUT, return NULL | aProcessing is NULL |
Definition at line 644 of file muse_processing.c.
References inframes, muse_frameset_find_master(), muse_processing_append_used(), muse_table_delete(), and muse_table_load().
Referenced by muse_processing_load_ctable().
muse_processing* muse_processing_new | ( | const char * | aName, |
cpl_recipe * | aRecipe | ||
) |
Create a new processing structure.
aName | name of the recipe |
aRecipe | the CPL recipe |
Definition at line 135 of file muse_processing.c.
References counter, inframes, intags, muse_cplparameterlist_duplicate(), name, outframes, parameters, recipe, muse_processing_framecounter::tag, and usedframes.
cpl_frame* muse_processing_new_frame | ( | muse_processing * | aProcessing, |
int | aIFU, | ||
cpl_propertylist * | aHeader, | ||
const char * | aTag, | ||
cpl_frame_type | aType | ||
) |
Create a new frame for a result file.
aProcessing | the processing structure |
aIFU | the IFU/channel number (use negative value to suppress -nn postfix) |
aHeader | the custom properties to be included in the header |
aTag | tag to apply for output frames, used as default prefix |
aType | the type of data to be stored |
Create a new frame for a result file. Set the correct type, group, level, tag. The filename consists of the prefix, possibly an underscore and a running number (for non-unique files), a minus and the IFU number, and the suffix ".fits".
As prefix, the frame tag is used on default. One may create a different prefix by providing the "MUSE PRIVATE FILE PREFIX" property in the header.
All "MUSE PRIVATE " properties are removed from the header.
set CPL_ERROR_NULL_INPUT, return NULL | aProcessing is NULL |
Definition at line 406 of file muse_processing.c.
References MUSE_FRAME_MODE_DATEOBS, MUSE_FRAME_MODE_MASTER, MUSE_FRAME_MODE_SEQUENCE, MUSE_FRAME_MODE_SUBSET, muse_pfits_get_dateobs(), muse_processing_get_frame_level(), muse_processing_get_frame_mode(), muse_processing_prepare_header(), and recipe.
Referenced by muse_processing_save_cimage(), muse_processing_save_cube(), muse_processing_save_header(), muse_processing_save_image(), muse_processing_save_mask(), muse_processing_save_table(), muse_sky_lines_save(), and muse_sky_save_continuum().
cpl_error_code muse_processing_prepare_header | ( | const cpl_recipe * | aRecipe, |
const char * | aFrametag, | ||
cpl_propertylist * | aHeader | ||
) |
Prepare and check a FITS header for a certain frame tag.
aRecipe | the CPL recipe |
aFrametag | the tag of the output frame |
aHeader | the FITS header of the output frame |
Definition at line 172 of file muse_processinginfo.c.
References muse_processinginfo_get().
Referenced by muse_processing_new_frame().
cpl_error_code muse_processing_prepare_property | ( | cpl_propertylist * | aHeader, |
const char * | aName, | ||
cpl_type | aType, | ||
const char * | aDescription | ||
) |
Prepare and check the specified property.
aHeader | the header to be prepared |
aName | the property name |
aType | the property type |
aDescription | the description (comment) of this property |
Check the specified property for its existence and correct type and append the comment to it.
return CPL_ERROR_DATA_NOT_FOUND | the property was not found |
return CPL_ERROR_TYPE_MISMATCH | the property has different type |
return CPL_ERROR_NULL_INPUT | the header or the name was NULL |
Definition at line 240 of file muse_processinginfo.c.
void muse_processing_recipeinfo | ( | cpl_plugin * | aPlugin | ) |
Output main pipeline configuration, inputs, and parameters.
aPlugin | the CPL plugin of the recipe in question |
Output pipeline name (PACKAGE_NAME) and version (PACKAGE_VERSION) and if aPlugin is non-NULL, give all input frames (filenames and tags), non-default parameters, and relevant (MUSE and OpenMP) environment variables.
This function is meant to be called at the beginning of a MUSE recipe.
Definition at line 343 of file muse_processinginfo.c.
int muse_processing_save_cimage | ( | muse_processing * | aProcessing, |
int | aIFU, | ||
cpl_image * | aImage, | ||
cpl_propertylist * | aHeader, | ||
const char * | aTag | ||
) |
Save a computed FITS image to disk.
aProcessing | the processing structure |
aIFU | the IFU/channel number |
aImage | the image to be saved |
aHeader | the custom properties to be included in the header |
aTag | tag to apply for output frames, used as prefix |
Save an image to disk. The filename consists of the prefix, a "-" sign, the IFU number of the CCD, and the suffix ".fits". If the image saving was successful, add the output frame to the list of output frames in the processing structure.
CPL_ERROR_NULL_INPUT | an argument was NULL |
Definition at line 769 of file muse_processing.c.
References muse_processing_new_frame(), and outframes.
cpl_error_code muse_processing_save_cube | ( | muse_processing * | aProcessing, |
int | aIFU, | ||
void * | aCube, | ||
const char * | aTag, | ||
muse_cube_type | aType | ||
) |
Save a MUSE datacube to disk.
aProcessing | the processing structure |
aIFU | the IFU/channel number |
aCube | the cube to be saved |
aTag | tag to apply for output frames, used as default prefix |
aType | type of cube to save (MUSE_CUBE_TYPE_FITS, MUSE_CUBE_TYPE_EURO3D, MUSE_CUBE_TYPE_SDP, or MUSE_CUBE_TYPE_LSF) |
Save a datacube to disk. The filename consists on the prefix, a "-" sign, the IFU number of the CCD and the suffix ".fits". If saving went without error, add the output frame to the list of output frames in the processing structure.
CPL_ERROR_NULL_INPUT | an argument was NULL |
CPL_ERROR_ILLEGAL_INPUT | an unknown aType was given |
Definition at line 530 of file muse_processing.c.
References MUSE_CUBE_TYPE_EURO3D, MUSE_CUBE_TYPE_FITS, MUSE_CUBE_TYPE_LSF, MUSE_CUBE_TYPE_SDP, muse_datacube_save(), muse_euro3dcube_save(), muse_lsf_cube_save(), muse_processing_new_frame(), and outframes.
Referenced by muse_postproc_cube_resample_and_collapse().
cpl_error_code muse_processing_save_header | ( | muse_processing * | aProcessing, |
int | aIFU, | ||
cpl_propertylist * | aHeader, | ||
const char * | aTag | ||
) |
Save a FITS header to disk.
aProcessing | the processing structure |
aIFU | the IFU/channel number |
aHeader | the header to be saved |
aTag | tag to apply for output frames, used as prefix |
Save a bare header to disk. The filename consists of the prefix, a "-" sign, the IFU number of the CCD, and the suffix ".fits". If the header saving was successful, add the output frame to the list of output frames in the processing structure.
CPL_ERROR_NULL_INPUT | an argument was NULL |
Definition at line 849 of file muse_processing.c.
References muse_processing_new_frame(), and outframes.
int muse_processing_save_image | ( | muse_processing * | aProcessing, |
int | aIFU, | ||
muse_image * | aImage, | ||
const char * | aTag | ||
) |
Save a computed MUSE image to disk.
aProcessing | the processing structure |
aIFU | the IFU/channel number |
aImage | the image to be saved |
aTag | tag to apply for output frames, used as prefix |
Save an image to disk. The filename consists on the prefix, a "-" sign, the IFU number of the CCD and the suffix ".fits". If the image saving was successful, add the output frame to the list of output frames in the processing structure.
CPL_ERROR_NULL_INPUT | an argument was NULL |
Definition at line 489 of file muse_processing.c.
References muse_image::header, muse_image_save(), muse_processing_new_frame(), and outframes.
Referenced by muse_postproc_cube_resample_and_collapse().
int muse_processing_save_mask | ( | muse_processing * | aProcessing, |
int | aIFU, | ||
muse_mask * | aMask, | ||
const char * | aTag | ||
) |
Save a computed MUSE mask to disk.
aProcessing | the processing structure |
aIFU | the IFU/channel number |
aMask | the mask to be saved |
aTag | tag to apply for output frames, used as prefix |
Save an mask to disk. The filename consists on the prefix, a "-" sign, the IFU number of the CCD and the suffix ".fits". If the mask saving was successful, add the output frame to the list of output frames in the processing structure.
CPL_ERROR_NULL_INPUT | an argument was NULL |
Definition at line 928 of file muse_processing.c.
References muse_mask::header, muse_mask_save(), muse_processing_new_frame(), and outframes.
cpl_error_code muse_processing_save_table | ( | muse_processing * | aProcessing, |
int | aIFU, | ||
void * | aTable, | ||
cpl_propertylist * | aHeader, | ||
const char * | aTag, | ||
muse_table_type | aType | ||
) |
Save a computed table to disk.
aProcessing | the processing structure |
aIFU | the IFU/channel number |
aTable | the table to be saved |
aHeader | the custom properties to be included in the header (for aType == MUSE_TABLE_TYPE_CPL) |
aTag | tag to apply for output frames, used as prefix |
aType | type of table to save (MUSE_TABLE_TYPE_CPL or MUSE_TABLE_TYPE_PIXTABLE) |
Save a table to disk. The filename consists on the prefix, a "-" sign, the IFU number of the CCD and the suffix ".fits". If the image saving was successful, add the output frame to the list of output frames in the processing structure.
CPL_ERROR_NULL_INPUT | a mandatory argument was NULL |
CPL_ERROR_ILLEGAL_INPUT | an unknown aType was given |
Definition at line 702 of file muse_processing.c.
References muse_pixtable_save(), muse_processing_new_frame(), muse_table_save(), MUSE_TABLE_TYPE_CPL, MUSE_TABLE_TYPE_MUSE, MUSE_TABLE_TYPE_PIXTABLE, and outframes.
cpl_table* muse_processing_sort_exposures | ( | muse_processing * | aProcessing | ) |
Sort input frames (containing lists of pixel table filenames) into different exposures.
aProcessing | the processing structure, especially containing input/output frames and the tag |
This function uses the DATE-OBS header keyword to check which of the input objects belong to the same exposure. As they all have been split up from the same exposure in the beginning, DATE-OBS should be identical for related files.
If one IFU of the same exposure is given multiple times in the input frameset, only the first one is used and a warning is printed for all others.
set CPL_ERROR_NULL_INPUT, return NULL | invalid processing pointer |
set CPL_ERROR_DATA_NOT_FOUND, return NULL | no exposures found |
Definition at line 1113 of file muse_processing.c.
References inframes, muse_pfits_get_dateobs(), muse_processing_append_used(), muse_processing_check_intags(), and muse_utils_get_ifu().
void muse_processinginfo_delete | ( | cpl_recipe * | aRecipe | ) |
Clear all information from the processing info and from the recipe config.
aRecipe | the CPL recipe |
To be called before closing the program.
Definition at line 143 of file muse_processinginfo.c.
References muse_processinginfo, and muse_processinginfo_get().
void muse_processinginfo_register | ( | cpl_recipe * | plugin, |
cpl_recipeconfig * | recipeconfig, | ||
muse_processing_prepare_header_func * | prepare_header, | ||
muse_processing_get_frame_level_func * | get_frame_level, | ||
muse_processing_get_frame_mode_func * | get_frame_mode | ||
) |
Register extended functionalities for MUSE recipes.
plugin | the CPL recipe |
recipeconfig | the recipe configuration |
prepare_header | function to declare the properties of a frame |
get_frame_level | function that returns the processing level of |
get_frame_mode | function that returns the output mode of a frame |
This functions registers all extensions that are used to use our framework.
Definition at line 108 of file muse_processinginfo.c.
References muse_processinginfo.
Referenced by muse_processinginfo_get().
|
static |
NULL-terminated array of all registered processing information
Definition at line 72 of file muse_processinginfo.c.
Referenced by muse_processinginfo_delete(), muse_processinginfo_get(), and muse_processinginfo_register().