31 #include "muse_scipost_correct_dar_z.h" 54 cpl_error_code rc = CPL_ERROR_NONE;
55 cpl_size iframe, nframes = cpl_frameset_get_size(inframes);
56 for (iframe = 0; iframe < nframes; iframe++) {
57 cpl_frame *frame = cpl_frameset_get_position(inframes, iframe);
58 const char *fn = cpl_frame_get_filename(frame);
62 if (pixtable == NULL) {
63 cpl_msg_error(__func__,
"NULL pixel table for %s", fn);
64 rc = CPL_ERROR_NULL_INPUT;
70 cpl_propertylist_erase_regexp(pixtable->
header,
"ESO QC ", 0);
72 if (rc != CPL_ERROR_NONE) {
73 cpl_msg_error(__func__,
"while muse_dar_correct(%s)",
74 cpl_frame_get_filename(frame));
79 if (aParams->
darcheck != MUSE_SCIPOST_CORRECT_DAR_PARAM_DARCHECK_NONE) {
80 cpl_boolean dorefine = aParams->
darcheck 81 == MUSE_SCIPOST_CORRECT_DAR_PARAM_DARCHECK_CORRECT;
82 cpl_msg_info(__func__,
"Carrying out DAR %s", dorefine ?
"correction" :
"check");
85 if (rc != CPL_ERROR_NONE) {
86 cpl_msg_error(__func__,
"Maximum detected shift %f\'\' (failure for " 87 "\"%s\"; rc = %d: %s)", maxshift,
88 cpl_frame_get_filename(frame), rc, cpl_error_get_message());
92 cpl_msg_info(__func__,
"Maximum detected shift %f\'\'", maxshift);
96 MUSE_TAG_PIXTABLE_REDUCED,
100 cpl_frameset_delete(inframes);
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_dar_check(muse_pixtable *aPixtable, double *aMaxShift, cpl_boolean aCorrect, muse_datacube **aCube)
check that the continuum of objects in the frame is well-aligned perpendicular to the spatial axis...
Structure definition of MUSE pixel table.
double lambdaref
Reference wavelength used for correction of differential atmospheric refraction. The R-band (peak wav...
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.
Structure to hold the parameters of the muse_scipost_correct_dar recipe.
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.
int darcheck
Carry out a check of the theoretical DAR correction using source centroiding. If "correct" it will al...
double lambdamin
Cut off the data below 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.
double lambdamax
Cut off the data above 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)