MUSE Pipeline Reference Manual
2.1.1
|
Data Structures | |
struct | muse_postproc_properties |
Structure definition of the post-processing properties. More... | |
struct | muse_postproc_sky_outputs |
Structure definition of the post-processing output sky data. More... | |
Enumerations |
Functions | |
muse_postproc_properties * | muse_postproc_properties_new (muse_postproc_type aType) |
Create a post-processing properties object. More... | |
void | muse_postproc_properties_delete (muse_postproc_properties *aProp) |
Free memory taken by a post-processing properties object and all its components. More... | |
cpl_boolean | muse_postproc_check_save_param (const char *aSave, const char *aValid) |
Check the –save parameter contents against allowed options. More... | |
muse_resampling_type | muse_postproc_get_resampling_type (const char *aResampleString) |
Select correct resampling type for resample string. More... | |
muse_resampling_crstats_type | muse_postproc_get_cr_type (const char *aCRTypeString) |
Select correct cosmic ray rejection type for crtype string. More... | |
muse_cube_type | muse_postproc_get_cube_format (const char *aFormatString) |
Select correct cube format for format string. More... | |
muse_xcombine_types | muse_postproc_get_weight_type (const char *aWeightString) |
Select correct weighting type for weight string. More... | |
cpl_table * | muse_postproc_load_nearest (const cpl_propertylist *aHeader, const cpl_frame *aFrame, float aWarnLimit, float aErrLimit, double *aRA, double *aDEC) |
Load the calibration from a multi-table FITS file that is nearest on the sky. More... | |
cpl_error_code | muse_postproc_revert_ffspec_maybe (muse_pixtable *aPt, const muse_table *aResponse) |
Revert correction of on-sky data with the flat-field spectrum. More... | |
void * | muse_postproc_process_exposure (muse_postproc_properties *aProp, unsigned int aIndex, muse_postproc_sky_outputs *aSkyOut) |
Merge and process pixel tables from one exposure. More... | |
cpl_propertylist * | muse_postproc_cube_load_output_wcs (muse_processing *aProcessing) |
Find a file with a usable output WCS in the input frameset. More... | |
cpl_error_code | muse_postproc_cube_resample_and_collapse (muse_processing *aProcessing, muse_pixtable *aPixtable, muse_cube_type aFormat, muse_resampling_params *aParams, const char *aFilter) |
High level function to resample to a datacube and collapse that to an image of the field of view and save both objects. More... | |
cpl_error_code | muse_postproc_qc_fwhm (muse_processing *aProcessing, muse_datacube *aCube) |
Compute QC1 parameters for datacubes and save them in the FITS header. More... | |
This module contains functions that are common to some post-processing recipes.
cpl_boolean muse_postproc_check_save_param | ( | const char * | aSave, |
const char * | aValid | ||
) |
Check the –save parameter contents against allowed options.
aSave | –save parameter string constant |
aValid | comma-delimited string of all valid options |
Definition at line 135 of file muse_postproc.c.
References muse_cplarray_new_from_delimited_string().
cpl_propertylist* muse_postproc_cube_load_output_wcs | ( | muse_processing * | aProcessing | ) |
Find a file with a usable output WCS in the input frameset.
aProcessing | the processing structure |
The file to search should be tagged as MUSE_TAG_OUTPUT_WCS in the input aProcessing->inFrames. This function then takes the header of the first extension that has NAXIS=2 or 3 (or WCSAXES=2 or 3) and supported CTYPEi entries for all relevant axes (supported are RA—TAN for axis1, DEC–TAN for axis 2, and AWAV and AWAV-LOG for axis 3). If aProcessing->inFrames contains multiple files with the required tag, only the first one is taken into account.
set CPL_ERROR_NULL_INPUT, return NULL | aProcessing is NULL |
set CPL_ERROR_NONE, return NULL | no file tagged MUSE_TAG_OUTPUT_WCS was found |
Definition at line 874 of file muse_postproc.c.
References muse_processing::inframes, muse_frameset_find(), and muse_processing_append_used().
cpl_error_code muse_postproc_cube_resample_and_collapse | ( | muse_processing * | aProcessing, |
muse_pixtable * | aPixtable, | ||
muse_cube_type | aFormat, | ||
muse_resampling_params * | aParams, | ||
const char * | aFilter | ||
) |
High level function to resample to a datacube and collapse that to an image of the field of view and save both objects.
aProcessing | the processing structure |
aPixtable | the MUSE pixel table to resample |
aFormat | the output format of the datacube |
aParams | the structure of resampling parameters |
aFilter | the string with comma-separated filter names to load |
return CPL_ERROR_NULL_INPUT | aProcessing, aPixtable, or aParams are NULL |
return CPL_ERROR_ILLEGAL_INPUT | aFormat contains an invalid format ID |
propagate error code of muse_resampling_<format> | resampling to cube fails |
propagate error code of muse_processing_save_cube() | saving cube fails |
Definition at line 964 of file muse_postproc.c.
References muse_image::header, muse_cplarray_new_from_delimited_string(), MUSE_CUBE_TYPE_EURO3D, MUSE_CUBE_TYPE_EURO3D_X, MUSE_CUBE_TYPE_FITS, MUSE_CUBE_TYPE_FITS_X, MUSE_CUBE_TYPE_SDP, muse_datacube_collapse(), muse_datacube_convert_dq(), muse_datacube_delete(), muse_euro3dcube_collapse(), muse_euro3dcube_delete(), muse_image_delete(), muse_image_dq_to_nan(), muse_imagelist_get_size(), muse_imagelist_new(), muse_imagelist_set(), MUSE_PHYS_AIR_STANDARD, muse_phys_air_to_vacuum(), muse_pixgrid_delete(), muse_postproc_qc_fwhm(), muse_processing_save_cube(), muse_processing_save_image(), muse_resampling_collapse_pixgrid(), muse_resampling_cube(), MUSE_RESAMPLING_DISP_WAVE, MUSE_RESAMPLING_DISP_WAVE_LOG, muse_resampling_euro3d(), muse_table_delete(), muse_table_load_filter(), muse_utils_copy_modified_header(), and muse_resampling_params::tlambda.
muse_resampling_crstats_type muse_postproc_get_cr_type | ( | const char * | aCRTypeString | ) |
Select correct cosmic ray rejection type for crtype string.
aCRTypeString | the format string from the recipe parameters |
The framework in principle ensures that no unsupported/unknown crtypes arrive here but nevertheless fall back to MUSE_RESAMPLING_CRSTATS_MEDIAN as the default in case something really weird happens.
set CPL_ERROR_NULL_INPUT, return MUSE_RESAMPLING_CRSTATS_MEDIAN | aCRTypeString is NULL |
Definition at line 228 of file muse_postproc.c.
References MUSE_RESAMPLING_CRSTATS_IRAF, MUSE_RESAMPLING_CRSTATS_MEAN, and MUSE_RESAMPLING_CRSTATS_MEDIAN.
muse_cube_type muse_postproc_get_cube_format | ( | const char * | aFormatString | ) |
Select correct cube format for format string.
aFormatString | the format string from the recipe parameters |
The framework in principle ensures that no unsupported/unknown formats arrive here but nevertheless fall back to MUSE_CUBE_TYPE_FITS as the default in case something really weird happens.
set CPL_ERROR_NULL_INPUT, return MUSE_CUBE_TYPE_FITS | aFormatString is NULL |
Definition at line 259 of file muse_postproc.c.
References MUSE_CUBE_TYPE_EURO3D, MUSE_CUBE_TYPE_EURO3D_X, MUSE_CUBE_TYPE_FITS, MUSE_CUBE_TYPE_FITS_X, and MUSE_CUBE_TYPE_SDP.
muse_resampling_type muse_postproc_get_resampling_type | ( | const char * | aResampleString | ) |
Select correct resampling type for resample string.
aResampleString | the format string from the recipe parameters |
The framework in principle ensures that no unsupported/unknown resampling types arrive here but nevertheless fall back to MUSE_RESAMPLE_WEIGHTED_DRIZZLE as the default in case something really weird happens.
set CPL_ERROR_NULL_INPUT, return MUSE_RESAMPLE_WEIGHTED_DRIZZLE | aResampleString is NULL |
Definition at line 187 of file muse_postproc.c.
References MUSE_RESAMPLE_NEAREST, MUSE_RESAMPLE_WEIGHTED_DRIZZLE, MUSE_RESAMPLE_WEIGHTED_LANCZOS, MUSE_RESAMPLE_WEIGHTED_LINEAR, MUSE_RESAMPLE_WEIGHTED_QUADRATIC, and MUSE_RESAMPLE_WEIGHTED_RENKA.
muse_xcombine_types muse_postproc_get_weight_type | ( | const char * | aWeightString | ) |
Select correct weighting type for weight string.
aWeightString | the weight string from the recipe parameters |
The framework in principle ensures that no unsupported/unknown weight types arrive here but nevertheless fall back to MUSE_XCOMBINE_EXPTIME as the default in case something really weird happens.
set CPL_ERROR_NULL_INPUT, return MUSE_XCOMBINE_EXPTIME | aWeightString is NULL |
Definition at line 296 of file muse_postproc.c.
References MUSE_XCOMBINE_EXPTIME, MUSE_XCOMBINE_FWHM, and MUSE_XCOMBINE_NONE.
cpl_table* muse_postproc_load_nearest | ( | const cpl_propertylist * | aHeader, |
const cpl_frame * | aFrame, | ||
float | aWarnLimit, | ||
float | aErrLimit, | ||
double * | aRA, | ||
double * | aDEC | ||
) |
Load the calibration from a multi-table FITS file that is nearest on the sky.
aHeader | the FITS header with the reference position (RA, DEC) |
aFrame | the frame containing the multi-table file information |
aWarnLimit | minimum distance in arcsec before warning is given |
aErrLimit | minimum distance in arcsec before failing |
aRA | RA of reference source to return (can be NULL) |
aDEC | DEC of reference source to return (can be NULL) |
This loops through all FITS extensions present in the file in aFrame and computes the distance on the sky relative to the position taken from aHeader. The table from the extension with the nearest distance is then loaded.
A warning is output if the distance is larger than half the MUSE field size, i.e. more than aWarnLimit arcsec.
set CPL_ERROR_NULL_INPUT, return NULL | aHeader and/or aFrame are NULL |
set CPL_ERROR_DATA_NOT_FOUND, return NULL | aHeader does not contain RA and/or DEC |
set CPL_ERROR_INCOMPATIBLE_INPUT, return NULL | position in aHeader is more than aErrLimit away from all reference sources |
Definition at line 338 of file muse_postproc.c.
References muse_astro_angular_distance(), muse_pfits_get_dec(), and muse_pfits_get_ra().
Referenced by muse_postproc_process_exposure().
void* muse_postproc_process_exposure | ( | muse_postproc_properties * | aProp, |
unsigned int | aIndex, | ||
muse_postproc_sky_outputs * | aSkyOut | ||
) |
Merge and process pixel tables from one exposure.
aProp | the post-processing properties object |
aIndex | index of the exposure (starting with 0) |
aSkyOut | sky output structure |
Depending on processing type requested in the properties object, either apply all calibrations (and return a pixel table), or derive the flux response (and return a response table plus a telluric correction table), or derive an astrometric calibration (and return it).
On output, the components of the aSkyOut structure may have been filled (depending on the inputs and parameters given in aProp). Then, they need to be deallocated with the respective functions.
pixeltable = muse_pixtable_load_merge_channels() if not standard: muse_flux_calibrate() muse_sky_subtract_pixtable(pixeltable) if WFM: muse_dar_correct() muse_dar_check() if standard: muse_flux_integrate_std() muse_flux_response_compute() muse_flux_get_response_table() muse_flux_get_telluric_table() return if astrometry: muse_wcs_locate_sources() muse_wcs_solve() return muse_wcs_project_tan()
set CPL_ERROR_NULL_INPUT, return NULL | aProp or aProp->exposures are NULL |
set CPL_ERROR_ILLEGAL_INPUT, return NULL | aIndex is larger than the last index in the aProp->exposures table |
Definition at line 500 of file muse_postproc.c.
References muse_postproc_properties::centroid, muse_postproc_sky_outputs::continuum, muse_postproc_properties::crpix2, muse_resampling_params::crsigma, muse_resampling_params::crtype, muse_postproc_properties::darcheck, muse_image::data, muse_flux_object::decref, muse_postproc_properties::detsigma, muse_postproc_properties::exposures, muse_postproc_properties::extinction, muse_postproc_properties::faccuracy, muse_pixtable::header, muse_flux_object::intimage, muse_postproc_properties::lambdamax, muse_postproc_properties::lambdamin, muse_postproc_properties::lambdaref, muse_postproc_sky_outputs::lines, muse_postproc_properties::lsf_cube, muse_postproc_properties::lsf_params, muse_postproc_sky_outputs::mask, muse_astro_airmass(), muse_cplerrorstate_dump_some(), muse_cpltable_extract_column(), muse_dar_check(), muse_dar_correct(), muse_datacube_collapse(), muse_datacube_delete(), muse_flux_calibrate(), muse_flux_compute_qc(), muse_flux_get_response_table(), muse_flux_get_telluric_table(), muse_flux_integrate_std(), muse_flux_object_new(), muse_flux_reference_table_check(), muse_flux_response_compute(), muse_image_delete(), muse_lsf_average_cube_all(), muse_lsf_fold_rectangle(), muse_mask_delete(), muse_pfits_get_dec(), muse_pfits_get_mode(), muse_pfits_get_ra(), muse_pixtable_and_selected_mask(), muse_pixtable_delete(), muse_pixtable_duplicate(), muse_pixtable_load_merge_channels(), muse_postproc_load_nearest(), muse_postproc_revert_ffspec_maybe(), MUSE_RESAMPLE_WEIGHTED_DRIZZLE, MUSE_RESAMPLING_CRSTATS_MEDIAN, muse_resampling_cube(), muse_resampling_params_delete(), muse_resampling_params_new(), muse_resampling_spectrum(), muse_resampling_spectrum_iterate(), muse_rvcorrect(), muse_sky_continuum_create(), muse_sky_create_skymask(), muse_sky_lines_fit(), muse_sky_lines_fit_old(), muse_sky_lines_set_range(), muse_sky_subtract_continuum(), muse_sky_subtract_lines(), muse_sky_subtract_lines_old(), muse_table_delete(), muse_table_load_filter(), muse_wcs_locate_sources(), muse_wcs_object_new(), muse_wcs_optimize_solution(), muse_wcs_project_tan(), muse_wcs_solve(), muse_postproc_properties::niter, muse_postproc_properties::profile, muse_postproc_properties::radius, muse_flux_object::raref, muse_postproc_properties::refframe, muse_postproc_properties::rejsigma, muse_postproc_properties::response, muse_postproc_properties::rvtype, muse_postproc_properties::select, muse_postproc_properties::sky_continuum, muse_postproc_properties::sky_lines, muse_postproc_properties::sky_mask, muse_postproc_properties::skymethod, muse_postproc_properties::skymodel_params, muse_postproc_properties::smooth, muse_postproc_sky_outputs::spectrum, muse_pixtable::table, muse_postproc_properties::tellregions, muse_postproc_properties::telluric, muse_postproc_properties::type, and muse_postproc_properties::wcs.
void muse_postproc_properties_delete | ( | muse_postproc_properties * | aProp | ) |
Free memory taken by a post-processing properties object and all its components.
aProp | the post-processing properties object |
Definition at line 104 of file muse_postproc.c.
References muse_postproc_properties::exposures, muse_postproc_properties::extinction, muse_postproc_properties::lsf_cube, muse_postproc_properties::lsf_params, muse_lsf_cube_delete_all(), muse_lsf_params_delete_all(), muse_mask_delete(), muse_table_delete(), muse_postproc_properties::refframe, muse_postproc_properties::response, muse_postproc_properties::sky_continuum, muse_postproc_properties::sky_lines, muse_postproc_properties::sky_mask, muse_postproc_properties::tellregions, muse_postproc_properties::telluric, and muse_postproc_properties::wcs.
muse_postproc_properties* muse_postproc_properties_new | ( | muse_postproc_type | aType | ) |
Create a post-processing properties object.
aType | the type of processing to set |
In the returned structure, all pointer objects are NULL. The sky subtraction method is set to MUSE_POSTPROC_SKYMETHOD_NONE.
set CPL_ERROR_ILLEGAL_INPUT, return NULL | unsupported aType is given |
Definition at line 77 of file muse_postproc.c.
References muse_postproc_properties::type.
cpl_error_code muse_postproc_qc_fwhm | ( | muse_processing * | aProcessing, |
muse_datacube * | aCube | ||
) |
Compute QC1 parameters for datacubes and save them in the FITS header.
aProcessing | the processing structure |
aCube | the datacube |
The prefix of the generated QC1 FITS keywords is set depending on the recipe name in the aProcessing structure.
return CPL_ERROR_NULL_INPUT | aProcessing or aCube are NULL |
return CPL_ERROR_DATA_NOT_FOUND | no sources were detected |
output info message, return CPL_ERROR_NONE | unknown recipe called this function |
Definition at line 1132 of file muse_postproc.c.
References muse_datacube::data, muse_datacube::header, muse_pfits_get_cd(), muse_pfits_get_crpix(), muse_pfits_get_crval(), muse_pfits_get_ctype(), muse_pfits_get_mode(), and muse_processing::name.
Referenced by muse_postproc_cube_resample_and_collapse().
cpl_error_code muse_postproc_revert_ffspec_maybe | ( | muse_pixtable * | aPt, |
const muse_table * | aResponse | ||
) |
Revert correction of on-sky data with the flat-field spectrum.
aPt | pixel table with the on-sky data |
aResponse | the response table with header |
This function is a dirty trick to improve backward compatibility: if an old (pre v2.0, without flat-field spectrum correction) STD_RESPONSE was passed to the one of the post-processing recipes, then make the (merged) pixel table compatible to that response, by reverting application of the flat-field spectrum. In effect, this function divides the pixel table again by the averaged flat-field spectrum.
Definition at line 416 of file muse_postproc.c.
References muse_pixtable::ffspec, muse_table::header, muse_pixtable::header, muse_cpltable_extract_column(), MUSE_HDR_PT_FFCORR, MUSE_PIXTABLE_FFDATA, MUSE_PIXTABLE_FFLAMBDA, and muse_pixtable_spectrum_apply().
Referenced by muse_postproc_process_exposure().