MUSE Pipeline Reference Manual  2.5.2
Enumerations | Functions
Autocalibration functions

Enumerations

Functions

cpl_error_code muse_autocalib_slice_median (muse_pixtable *aPixtable, double aClip, muse_table **aFactors)
 Correct the background level of the slices (port from MPDAF). More...
 
muse_mask * muse_autocalib_create_mask (muse_image *aImage, double aNSigma, const char *aQCPrefix)
 Create Select spaxels to be considered as sky for autocalibration. More...
 

Detailed Description

This module contains functions that are used for self calibration of the MUSE instrument.

Function Documentation

muse_mask* muse_autocalib_create_mask ( muse_image *  aImage,
double  aNSigma,
const char *  aQCPrefix 
)

Create Select spaxels to be considered as sky for autocalibration.

Parameters
aImageMUSE (white-light) image of the field of view
aNSigmaSigma level for the statistics to mask
aQCPrefixprefix for the QC keywords (optional, can be NULL)
Returns
CPL_ERROR_NONE on success or a cpl_error_code on failure

Use thresholding and binary filtering to create a mask of sky regions. This function evolved from from muse_sky_create_skymask() but creates more contiguous regions to be used for the selection of pixels that get included in the autocalibration process.

If aQCPrefix is given, two parameters are added to the output mask header, that can be used for QC.

Exceptions
return CPL_ERROR_NULL_INPUTaImage is NULL

Definition at line 771 of file muse_autocalib.c.

References muse_image::data, muse_mask::header, muse_image::header, muse_mask::mask, muse_image_reject_from_dq(), muse_mask_new(), and muse_mask_save().

Referenced by muse_postproc_whitelight().

cpl_error_code muse_autocalib_slice_median ( muse_pixtable *  aPixtable,
double  aClip,
muse_table **  aFactors 
)

Correct the background level of the slices (port from MPDAF).

Parameters
aPixtableinput pixel table
aClipclipping threshold for slice corrections in one IFU
aFactorspointer to output table containing the correction factors (optional, can be NULL)
Returns
CPL_ERROR_NONE on success or a cpl_error_code on failure

This requires a pixel table that is not sky-subtracted. It uses the mean sky level as a reference, and compute a multiplicative correction to apply to each slice to bring its background level to the reference one.

Sources are expected to be masked in that only the sky background pixels (table rows) in aPixtable are selected that this algorithms is supposed to work on.

Remarks
This function adds a FITS header (MUSE_HDR_PT_AUTOCAL_NAME) with the string "slice-median" to the pixel table, so that other functions can detect, if this type of autocalibration has already been carried out. It will return without processing or error, if this is detected in the input pixel table. The comment of that header starts with the value of aClip.
Exceptions
set and return CPL_ERROR_NULL_INPUTaPixtable is NULL

Definition at line 328 of file muse_autocalib.c.

References muse_pixtable::header, muse_autocal_results_def, muse_cpltable_new(), MUSE_HDR_PT_AUTOCAL_NAME, muse_pfits_get_mode(), MUSE_PIXTABLE_DATA, muse_pixtable_get_nrow(), MUSE_PIXTABLE_LAMBDA, muse_pixtable_origin_decode_all(), MUSE_PIXTABLE_STAT, muse_table_new(), muse_utils_memory_dump(), and muse_pixtable::table.

Referenced by muse_postproc_whitelight().