MUSE Pipeline Reference Manual
1.0.2
|
Data Structures | |
struct | muse_basicproc_params |
Structure of basic processing parameters. More... | |
Functions | |
muse_basicproc_params * | muse_basicproc_params_new (cpl_parameterlist *aParameters, const char *aPrefix) |
Create a new structure of basic processing parameters. More... | |
muse_basicproc_params * | muse_basicproc_params_new_from_propertylist (const cpl_propertylist *aHeader) |
Create a structure of basic processing parameters from a FITS header. More... | |
void | muse_basicproc_params_delete (muse_basicproc_params *aBPars) |
Free a structure of basic processing parameters. More... | |
muse_imagelist * | muse_basicproc_load (muse_processing *aProcessing, unsigned char aIFU, muse_basicproc_params *aBPars) |
Load the raw input files from disk and do basic processing. More... | |
muse_imagelist * | muse_basicproc_load_reduced (muse_processing *aProcessing, unsigned char aIFU) |
Load reduced input files from disk. More... | |
cpl_table * | muse_basicproc_prepare_illum (muse_pixtable *aPT) |
Apply an illum/attached flat-field to a pixel table. More... | |
cpl_error_code | muse_basicproc_apply_illum (muse_pixtable *aPT, cpl_table *aAttached) |
Apply an illum/attached flat-field to a pixel table. More... | |
cpl_error_code | muse_basicproc_apply_twilight (muse_pixtable *aPT, muse_datacube *aTwilight) |
Apply an attached flat-field to a pixel table. More... | |
muse_imagelist * | muse_basicproc_combine_images_lampwise (muse_processing *aProcessing, unsigned char aIFU, muse_basicproc_params *aBPars, cpl_frameset ***aLabeledFrames) |
Combine several images into a lampwise image list. More... | |
cpl_error_code | muse_basicproc_shift_pixtable (muse_pixtable *aPt, cpl_array *aLines, double aHalfWidth, double aBinWidth) |
Compute wavelength corrections for science data based on reference sky lines. More... | |
cpl_error_code | muse_basicproc_stats_append_header (cpl_image *aImage, cpl_propertylist *aHeader, const char *aPrefix, unsigned aStats) |
Compute image statistics of an image and add them to a header. More... | |
cpl_error_code | muse_basicproc_stats_append_header_window (cpl_image *aImage, cpl_propertylist *aHeader, const char *aPrefix, unsigned aStats, int aX1, int aY1, int aX2, int aY2) |
Compute image statistics of an image window and add them to a header. More... | |
cpl_error_code | muse_basicproc_qc_saturated (muse_image *aImage, const char *aPrefix) |
Add QC parameter about saturated pixels to a muse_image. More... | |
This group contains functions that are common to some basic-processing recipes.
cpl_error_code muse_basicproc_apply_illum | ( | muse_pixtable * | aPT, |
cpl_table * | aAttached | ||
) |
Apply an illum/attached flat-field to a pixel table.
aPT | the pixel table |
aAttached | the table computed from the attached flat |
This function expects the attached flat-field to be in form of a table, in the format created by muse_basicproc_prepare_attached().
set and return CPL_ERROR_NULL_INPUT | aPT, one of it's components, or aAttached are NULL |
Definition at line 1687 of file muse_basicproc.c.
References muse_pixtable::header, MUSE_HDR_PT_ILLUM_MEAN, MUSE_HDR_PT_ILLUM_STDEV, MUSE_HDR_PT_ILLUMi, muse_pixtable_extracted_delete(), muse_pixtable_extracted_get_size(), muse_pixtable_extracted_get_slices(), muse_pixtable_origin_get_slice(), muse_utils_get_ifu(), and muse_pixtable::table.
cpl_error_code muse_basicproc_apply_twilight | ( | muse_pixtable * | aPT, |
muse_datacube * | aTwilight | ||
) |
Apply an attached flat-field to a pixel table.
aPT | the pixel table |
aTwilight | the cube of the twilight skyflat exposure |
This function applies the twilight-sky based illumination correction using a cube of the skyflat prepared by the muse_twilight recipe.
Spatially, the geometry-table based spatial pixel coordinates are used to find the nearest neighbor. In dispersion direction, the (up to two pixels) in the nearest wavelength plane(s) are interpolated linearly.
set and return CPL_ERROR_NULL_INPUT | aPT, one of it's components, or aAttached are NULL |
Definition at line 1746 of file muse_basicproc.c.
References muse_datacube::data, muse_datacube::header, muse_pixtable::header, muse_pixtable_get_nrow(), muse_utils_get_ifu(), and muse_pixtable::table.
muse_imagelist* muse_basicproc_combine_images_lampwise | ( | muse_processing * | aProcessing, |
unsigned char | aIFU, | ||
muse_basicproc_params * | aBPars, | ||
cpl_frameset *** | aLabeledFrames | ||
) |
Combine several images into a lampwise image list.
aProcessing | the processing structure |
aIFU | the IFU/channel number |
aBPars | basic processing parameters |
aLabeledFrames | optional output array of framesets containing used frames for each lamp |
Combine several images into one, using method and parameters specified by aProcessing->parameters. Note that this function changes the input images if the "scale" option is used. If all images are found to be of the same lamp, they are all combined into a single output image, which is the only entry in the returned image list.
If aLabeledFrames is not NULL, it will contain a list of framesets or the same size as the returned imagelist. Each frameset contains the frames that were used to preprocess the image at the same index in the image list, and has to be deallocated using cpl_frameset_delete(). The returned pointer has to be deallocated with cpl_free(). The returned pointer will be NULL on error.
set CPL_ERROR_NULL_INPUT, return NULL | aProcessing is NULL |
call muse_basicproc_load() with NULL parameter | aBPars is NULL |
propagate error code, return NULL | image combination failed |
Definition at line 1993 of file muse_basicproc.c.
References muse_image::header, muse_processing::inframes, muse_processing::intags, muse_basicproc_load(), muse_combine_images(), muse_combinepar_delete(), muse_combinepar_new(), muse_frameset_find_tags(), muse_imagelist_delete(), muse_imagelist_get(), muse_imagelist_get_size(), muse_imagelist_new(), muse_imagelist_set(), muse_processing::name, muse_processing::parameters, and muse_processing::usedframes.
muse_imagelist* muse_basicproc_load | ( | muse_processing * | aProcessing, |
unsigned char | aIFU, | ||
muse_basicproc_params * | aBPars | ||
) |
Load the raw input files from disk and do basic processing.
aProcessing | the processing structure |
aIFU | the IFU/channel number |
aBPars | basic processing parameters |
Read the raw input files from disk and store them as images in the images structure. Apply bad pixel table, bias, dark, and flat files to them, thereby adding two images with bad pixel information and variance to each of them, so that they are all of format muse_image. Saturated pixels are added to the bad pixel extension of every image.
For raw bias exposures, the overscan levels are checked against the first input file. A mean overscan level is then added to the header of the first image to be propagated into the final combined master bias.
For raw flat-field exposures, the gain is estimated from the data and compared to the one listed in the input FITS header.
The necessary calibrations for each step are loaded as required.
propagate error from muse_processing_check_input(), return NULL | input data is invalid somehow (NULL aProcessing pointer etc.) |
set an error code, return NULL | raw images could not be loaded |
reset errors and continue | applying the bad pixel table failed |
set a cpl_error_code, return NULL | saturation check failed |
set a cpl_error_code, return NULL | correcting quadrants by overscan fitting failed |
set a cpl_error_code, return NULL | computing overscan statistics and rejecting cosmic rays in overscans failed |
set a cpl_error_code, return NULL | images could not be trimmed |
output warning and continue | overscan correction was requested but failed |
set a cpl_error_code, return NULL | overscan check failed |
set a cpl_error_code, return NULL | applying bias failed |
ignore errors and continue | checking gain failed |
set a cpl_error_code, return NULL | coversion from adu to count failed |
set a cpl_error_code, return NULL | applying dark failed |
set a cpl_error_code, return NULL | carrying out cr rejection failed |
set a cpl_error_code, return NULL | applying simple sky subtraction failed |
set a cpl_error_code, return NULL | applying flat failed |
Definition at line 1506 of file muse_basicproc.c.
References muse_imagelist_delete(), and muse_processing_check_input().
Referenced by muse_basicproc_combine_images_lampwise().
muse_imagelist* muse_basicproc_load_reduced | ( | muse_processing * | aProcessing, |
unsigned char | aIFU | ||
) |
Load reduced input files from disk.
aProcessing | the processing structure |
aIFU | the IFU/channel number |
Read the reduced input files from disk and store them as images in the images structure.
propagate error from muse_processing_check_input(), return NULL | input data is invalid somehow (NULL aProcessing pointer etc.) |
Definition at line 1596 of file muse_basicproc.c.
References muse_processing::inframes, muse_processing::intags, muse_frameset_find_tags(), muse_image_load(), muse_image_load_from_extensions(), muse_imagelist_new(), muse_imagelist_set(), and muse_processing_append_used().
void muse_basicproc_params_delete | ( | muse_basicproc_params * | aBPars | ) |
Free a structure of basic processing parameters.
aBPars | the structure of basic processing parameters |
This deallocates the string components and the structure itself.
Definition at line 163 of file muse_basicproc.c.
References muse_basicproc_params::crmethod, muse_basicproc_params::overscan, and muse_basicproc_params::rejection.
muse_basicproc_params* muse_basicproc_params_new | ( | cpl_parameterlist * | aParameters, |
const char * | aPrefix | ||
) |
Create a new structure of basic processing parameters.
aParameters | the list of parameters |
aPrefix | the prefix of the recipe |
Create a new set of basic processing parameters from a recipe parameter list. It takes the parameters "overscan", "ovscreject", "ovscsigma", and "ovscignore" and converts them into the structure. If aPrefix contains "muse_scibasic", it also takes the parameters "cr", "xbox", "ybox", "passes", and "thres".
The error handling is done by the cpl_parameterlist functions that this function calls.
Use muse_basicproc_params_delete() to free memory allocated by this function.
Definition at line 82 of file muse_basicproc.c.
References muse_basicproc_params::crmethod, muse_basicproc_params::dcrpasses, muse_basicproc_params::dcrthres, muse_basicproc_params::dcrxbox, muse_basicproc_params::dcrybox, muse_cplparamerterlist_find_prefix(), muse_basicproc_params::overscan, muse_basicproc_params::ovscignore, muse_basicproc_params::ovscsigma, and muse_basicproc_params::rejection.
Referenced by muse_basicproc_params_new_from_propertylist().
muse_basicproc_params* muse_basicproc_params_new_from_propertylist | ( | const cpl_propertylist * | aHeader | ) |
Create a structure of basic processing parameters from a FITS header.
aHeader | the FITS header |
This creates a new parameter list from the ESO.PRO.REC1 keywords present in the input FITS header, and then gives the result to muse_basicproc_params_new() to actually create the output structure.
Use muse_basicproc_params_delete() to free memory allocated by this function.
Definition at line 138 of file muse_basicproc.c.
References muse_basicproc_params_new(), and muse_cplparameterlist_from_propertylist().
cpl_table* muse_basicproc_prepare_illum | ( | muse_pixtable * | aPT | ) |
Apply an illum/attached flat-field to a pixel table.
aPT | pixel table of an attached flat-field exposure |
This function converts the pixel table of the attached flat-field into the form expected by muse_basicproc_apply_attached(), with columns "slice" and "fflat".
set CPL_ERROR_NULL_INPUT, return NULL | aPT or one of it's components are NULL |
Definition at line 1635 of file muse_basicproc.c.
References muse_pixtable::header, muse_pixtable_extracted_delete(), muse_pixtable_extracted_get_size(), muse_pixtable_extracted_get_slices(), muse_pixtable_origin_get_slice(), muse_pixtable_restrict_wavelength(), muse_utils_get_ifu(), and muse_pixtable::table.
cpl_error_code muse_basicproc_qc_saturated | ( | muse_image * | aImage, |
const char * | aPrefix | ||
) |
Add QC parameter about saturated pixels to a muse_image.
aImage | the image to count on and modify |
aPrefix | prefix of the QC header |
Count EURO3D_SATURATED pixels in the dq component of aImage and add a aPrefix+QC_BASIC_NSATURATED (if aPrefix does not contain a trailing space, one is added in between) keyword to its header component.
return CPL_ERROR_NULL_INPUT | aImage or its dq or header components, or aPrefix are NULL |
propagate error code | keyword updating failed |
Definition at line 2327 of file muse_basicproc.c.
References muse_image::dq, and muse_image::header.
cpl_error_code muse_basicproc_shift_pixtable | ( | muse_pixtable * | aPt, |
cpl_array * | aLines, | ||
double | aHalfWidth, | ||
double | aBinWidth | ||
) |
Compute wavelength corrections for science data based on reference sky lines.
aPt | the pixel table with the science data |
aLines | array with the reference wavelengths of sky emission lines |
aHalfWidth | half-width of the wavelength region around each sky line |
aBinWidth | pixel size in Angstrom of the intermediate spectrum |
This function subsequently calls muse_utils_pixtable_fit_line_gaussian() for all sky lines given in aLines. It computes a weighted mean offset and applies this shift in wavelength to the data in aPt.
The input array aLines needs to be of simple floating-point type.
return CPL_ERROR_NULL_INPUT | aPt and/or aLines are NULL |
return CPL_ERROR_ILLEGAL_INPUT | aLines is not of floating-point type |
Definition at line 2175 of file muse_basicproc.c.
References muse_pixtable::header, MUSE_HDR_PT_LHI, MUSE_HDR_PT_LLO, muse_utils_get_ifu(), muse_utils_pixtable_fit_line_gaussian(), and muse_pixtable::table.
cpl_error_code muse_basicproc_stats_append_header | ( | cpl_image * | aImage, |
cpl_propertylist * | aHeader, | ||
const char * | aPrefix, | ||
unsigned | aStats | ||
) |
Compute image statistics of an image and add them to a header.
aImage | the image to derive statistics for and add them to |
aHeader | the header to add them to |
aPrefix | the prefix of the output FITS keywords |
aStats | the statistics properties to compute |
This function only supports a subset of the properties supported by cpl_stats_new_from_image(), see muse_basicproc_stats_append_header_window().
Definition at line 2233 of file muse_basicproc.c.
References muse_basicproc_stats_append_header_window().
cpl_error_code muse_basicproc_stats_append_header_window | ( | cpl_image * | aImage, |
cpl_propertylist * | aHeader, | ||
const char * | aPrefix, | ||
unsigned | aStats, | ||
int | aX1, | ||
int | aY1, | ||
int | aX2, | ||
int | aY2 | ||
) |
Compute image statistics of an image window and add them to a header.
aImage | the image to derive statistics for and add them to |
aHeader | the header to add them to |
aPrefix | the prefix of the output FITS keywords |
aStats | the statistics properties to compute |
aX1 | the lower left x-coordinate of the window |
aY1 | the lower left y-coordinate of the window |
aX2 | the upper right x-coordinate of the window |
aY2 | the upper right y-coordinate of the window |
This function only supports a subset of the properties supported by cpl_stats_new_from_image_window(), namely median, mean, stdev, min, max, and flux,
Definition at line 2263 of file muse_basicproc.c.
Referenced by muse_basicproc_stats_append_header().