30 #include "muse_scipost_raman_z.h" 53 cpl_msg_error(__func__,
"no science exposures found in input");
56 int nexposures = cpl_table_get_nrow(exposures);
57 if (nexposures != 1) {
58 cpl_msg_error(__func__,
"More than one exposure (%i) in raman",
64 for (i = 0; i < nexposures; i++) {
65 cpl_table *thisexp = cpl_table_extract(exposures, i, 1);
69 cpl_table_delete(thisexp);
76 cpl_propertylist_erase_regexp(p->
header,
"ESO QC ", 0);
77 if (pixtable == NULL) {
81 cpl_table_get_nrow(pixtable->
table));
85 cpl_table_delete(exposures);
88 MUSE_TAG_STD_RESPONSE, 0),
90 MUSE_TAG_STD_TELLURIC, 0);
92 MUSE_TAG_EXTINCT_TABLE, 0);
94 if ((pixtable != NULL) && (response != NULL)) {
96 cpl_msg_error(__func__,
97 "Pixel table already flux calibrated. Dont specify %s, %s, %s",
98 MUSE_TAG_STD_RESPONSE, MUSE_TAG_EXTINCT_TABLE,
99 MUSE_TAG_STD_TELLURIC);
108 if (rc != CPL_ERROR_NONE) {
109 cpl_msg_error(__func__,
"while muse_flux_calibrate");
118 cpl_table_delete(extinction);
120 if (pixtable != NULL) {
122 CPL_NOT_EQUAL_TO, EURO3D_GOODPIXEL);
123 cpl_table_erase_selected(pixtable->
table);
127 cpl_msg_debug(__func__,
"WFM detected: starting DAR correction");
129 cpl_msg_debug(__func__,
"DAR correction returned rc=%d: %s", rc,
130 rc != CPL_ERROR_NONE ? cpl_error_get_message() :
"");
150 muse_pixtable *pixtable = muse_raman_load_pixtable(aProcessing, aParams);
151 if (pixtable == NULL) {
152 cpl_msg_error(__func__,
"Could not load pixel table");
173 cpl_msg_info(__func__,
"Write output pixel table");
175 MUSE_TAG_PIXTABLE_REDUCED,
179 cpl_msg_info(__func__,
"Write other output file");
184 return cpl_error_get_code();
Structure definition of a MUSE datacube.
muse_postproc_properties * muse_postproc_properties_new(muse_postproc_type aType)
Create a post-processing properties object.
double width
Wavelength range around Raman lines [Angstrom].
double lambdaref
Reference wavelength used for correction of differential atmospheric refraction. The R-band (peak wav...
cpl_error_code muse_postproc_correct_raman(muse_pixtable *aPT, muse_postproc_properties *aProp, const cpl_table *aOffsets, muse_datacube **aRamanCube)
Set up and run Raman-light removal.
cpl_error_code muse_dar_correct(muse_pixtable *aPixtable, double aLambdaRef)
Correct the pixel coordinates of all pixels of a given pixel table for differential atmospheric refra...
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.
cpl_table * muse_raman_lines_load(muse_processing *aProcessing)
Load the raman lines file.
double crsigma
Sigma level clipping for cube-based CR rejection (using "median", see muse_scipost). It can be switched off, by passing zero or a negative value.
void muse_datacube_delete(muse_datacube *aCube)
Deallocate memory associated to a muse_datacube object.
double fraction
Fraction of the image (without the ignored part) to be considered as sky. If an input sky mask is pro...
cpl_error_code muse_flux_calibrate(muse_pixtable *aPixtable, const muse_table *aResponse, const cpl_table *aExtinction, const muse_table *aTelluric)
Convert the input pixel table from counts to fluxes.
cpl_table * table
The pixel table.
Structure definition of MUSE pixel table.
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.
double ignore
Lowest fraction of the image to be ignored. If an input sky mask is provided, the fraction is applied...
cpl_boolean muse_pixtable_is_fluxcal(muse_pixtable *aPixtable)
Determine whether the pixel table is flux calibrated.
muse_lsf_cube ** muse_lsf_cube_load_all(muse_processing *aProcessing)
Load all LSF cubes for all IFUs into an array.
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.
Structure definition of the post-processing properties.
void muse_postproc_properties_delete(muse_postproc_properties *aProp)
Free memory taken by a post-processing properties object and all its components.
double lambdamin
Cut off the data below this wavelength after loading the pixel table(s).
Structure to store a table together with a property list.
muse_mask * muse_processing_load_mask(muse_processing *aProcessing, const char *aTag)
Load a mask file and its FITS header.
Structure to hold the parameters of the muse_scipost_raman recipe.
void muse_table_delete(muse_table *aTable)
Deallocate memory associated to a muse_table object.
muse_lsf_cube ** lsf_cube
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.
muse_pixtable * muse_pixtable_load_merge_channels(cpl_table *aExposureList, double aLambdaMin, double aLambdaMax)
Load and merge the pixel tables of the 24 MUSE sub-fields.
double lambdamax
Cut off the data above this wavelength after loading the pixel table(s).
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.
muse_sky_params skymodel_params
cpl_table * muse_processing_sort_exposures(muse_processing *aProcessing)
Sort input frames (containing lists of pixel table filenames) into different exposures.
void muse_pixtable_delete(muse_pixtable *aPixtable)
Deallocate memory associated to a pixel table object.
muse_ins_mode muse_pfits_get_mode(const cpl_propertylist *aHeaders)
find out the observation mode
cpl_propertylist * header
The FITS header.