30 #include "muse_scipost_subtract_sky_simple_z.h" 47 cpl_msg_warning(__func__,
"Could not load %s", MUSE_TAG_SKY_SPECTRUM);
51 cpl_table_name_column(spectrum,
"data",
"flux");
53 cpl_errorstate prestate = cpl_errorstate_get();
57 cpl_error_code rc = CPL_ERROR_NONE;
58 cpl_size iframe, nframes = cpl_frameset_get_size(inframes);
59 for (iframe = 0; iframe < nframes; iframe++) {
60 cpl_frame *frame = cpl_frameset_get_position(inframes, iframe);
61 const char *fn = cpl_frame_get_filename(frame);
66 if (pixtable == NULL) {
67 cpl_msg_error(__func__,
"NULL pixel table for \"%s\"", fn);
68 rc = CPL_ERROR_NULL_INPUT;
74 cpl_propertylist_erase_regexp(pixtable->
header,
"ESO QC ", 0);
77 cpl_msg_error(__func__,
"Pixel table \"%s\" already sky subtracted", fn);
79 rc = CPL_ERROR_ILLEGAL_INPUT;
84 if (rc != CPL_ERROR_NONE) {
85 cpl_msg_error(__func__,
"while subtracting sky spectrum from \"%s\"", fn);
90 MUSE_TAG_PIXTABLE_REDUCED,
94 cpl_frameset_delete(inframes);
95 cpl_table_delete(spectrum);
97 return cpl_errorstate_is_equal(prestate) ? 0 : rc;
double lambdamax
Cut off the data above this wavelength after loading the pixel table(s).
cpl_boolean muse_pixtable_is_skysub(muse_pixtable *aPixtable)
Determine whether the pixel table is sky subtracted.
Structure definition of MUSE pixel table.
cpl_error_code muse_sky_subtract_continuum(muse_pixtable *, cpl_table *)
Subtract sky continuum from pixel table.
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.
muse_pixtable * muse_pixtable_load_restricted_wavelength(const char *aFilename, double aLambdaMin, double aLambdaMax)
Load a pixel table from file and cut down the wavelength range.
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.
Structure to hold the parameters of the muse_scipost_subtract_sky_simple recipe.
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.
double lambdamin
Cut off the data below this wavelength after loading the pixel table(s).
void muse_pixtable_delete(muse_pixtable *aPixtable)
Deallocate memory associated to a pixel table object.
cpl_propertylist * header
The FITS header.
cpl_frameset * muse_frameset_find_tags(const cpl_frameset *aFrames, const cpl_array *aTags, unsigned char aIFU, cpl_boolean aInvert)
return frameset containing data from an IFU/channel with the given tag(s)