35 #include "muse_scipost_z.h" 92 static const char *muse_scipost_help =
93 "Sort input pixel tables into lists of files per exposure, merge pixel tables from all IFUs of each exposure. Correct each exposure for differential atmospheric refraction (unless --lambdaref is far outside the MUSE wavelength range). Then the flux calibration is carried out, if a response curve was given in the input; it includes a correction of telluric absorption, if a telluric absorption correction file was given. Next, the slice autocalibration is computed and the flux correction factors are applied to the pixel table (if --autocalib=\"deepfield\"). If observations were done with AO and a RAMAN_LINES file was given, a procedure is run to clean the Raman scattering emission lines from the data. Then the sky subtraction is carried out (unless --skymethod=\"none\"), either directly subtracting an input sky continuum and an input sky emission lines (for --skymethod=\"subtract-model\"), or (--skymethod=\"model\") create a sky spectrum from the darkest fraction (--skymodel_fraction, after ignoring the lowest --skymodel_ignore as artifacts) of the field of view, then fitting and subtracting sky emission lines using an initial estimate of the input sky lines; then the continuum (residuals after subtracting the sky lines from the sky spectrum) is subtracted as well. If --save contains \"skymodel\", all sky-related products are saved for each exposure. Afterwards the data is corrected for the radial velocity of the observer (--rvcorr), before the input (or a default) astrometric solution is applied. Now each individual exposure is fully reduced; the pixel tables at this stage can be saved by setting \"individual\" in --save. If multiple exposures were given, they are then combined. If --save contains \"combined\", this final merged pixel table is saved. Finally (if --save contains \"cube\"), the data is resampled into a datacube, using all parameters given to the recipe. The extent and orientation of the cube is normally computed from the data itself, but this can be overridden by passing a file with the output world coordinate system (OUTPUT_WCS), for example a MUSE cube. This can also be used to sample the wavelength axis logarithmically (in that file set \"CTYPE3='AWAV-LOG'\"). As a last step, the computed cube is integrated over all filter functions given (--filter) that are also present in the input filter list table.";
95 static const char *muse_scipost_help_esorex =
96 "\n\nInput frames for raw frame tag \"PIXTABLE_OBJECT\":\n" 97 "\n Frame tag Type Req #Fr Description" 98 "\n -------------------- ---- --- --- ------------" 99 "\n PIXTABLE_OBJECT raw Y Pixel table of a science object" 100 "\n EXTINCT_TABLE calib Y 1 Atmospheric extinction table" 101 "\n STD_RESPONSE calib Y 1 Response curve as derived from standard star(s)" 102 "\n STD_TELLURIC calib . 1 Telluric absorption correction as derived from standard star(s)" 103 "\n ASTROMETRY_WCS calib . 1 Astrometric solution derived from astrometric science frame" 104 "\n OFFSET_LIST calib . 1 List of coordinate offsets (and optional flux scale factors); can influence how the SKY_MASK is interpreted" 105 "\n FILTER_LIST calib . 1 File to be used to create field-of-view images." 106 "\n OUTPUT_WCS calib . 1 WCS to override output cube location / dimensions (see data format chapter for details)" 107 "\n RAMAN_LINES calib . 1 List of Raman line transitions of O2 and N2" 108 "\n SKY_LINES calib . 1 List of OH transitions and other sky lines" 109 "\n SKY_CONTINUUM calib . 1 Sky continuum to use" 110 "\n LSF_PROFILE calib . Slice specific LSF parameters." 111 "\n SKY_MASK calib . 1 Sky mask to use; if it contains a WCS, it is aligned to the data before masking" 112 "\n\nProduct frames for raw frame tag \"PIXTABLE_OBJECT\":\n" 113 "\n Frame tag Level Description" 114 "\n -------------------- -------- ------------" 115 "\n DATACUBE_FINAL final Output datacube" 116 "\n IMAGE_FOV final Field-of-view images corresponding to the \"filter\" parameter." 117 "\n OBJECT_RESAMPLED final Stacked image (if --save contains \"stacked\")" 118 "\n PIXTABLE_REDUCED intermed Fully reduced pixel tables for each exposure (if --save contains \"individual\")" 119 "\n PIXTABLE_POSITIONED intermed Fully reduced and positioned pixel table for each individual exposure (if --save contains \"positioned\")" 120 "\n PIXTABLE_COMBINED intermed Fully reduced and combined pixel table for the full set of exposures (if --save contains \"combined\")" 121 "\n AUTOCAL_MASK intermed Created sky mask for autocalibration (if --autocalib=deepfield and --save contains \"autocal\" but no input SKY_MASK was given)" 122 "\n AUTOCAL_FACTORS intermed Table with factors applied during autocalibration (if --autocalib=deepfield and --save contains \"autocal\")" 123 "\n RAMAN_IMAGES intermed Images for Raman correction diagnostics (if an input RAMAN_LINES was given, the instrument used AO and --save contains \"raman\"). Extensions are: DATA: model of the Raman light distribution in the field of view (arbitrary units), RAMAN_IMAGE_O2: reconstructed image in the O2 band, SKY_MASK_O2: sky mask used for the O2 band, RAMAN_IMAGE_N2: reconstructed image in the N2 band, SKY_MASK_N2: sky mask used for the N2 band, RAMAN_FIT_O2: model of Raman flux distribution in the O2 band, RAMAN_FIT_N2: model of Raman flux distribution in the N2 band." 124 "\n SKY_IMAGE intermed Reconstructed sky image which is then used to create the SKY_MASK (if --skymethod=model and --save contains \"skymodel\")" 125 "\n SKY_MASK intermed Created sky mask (if --skymethod=model and --save contains \"skymodel\")" 126 "\n SKY_SPECTRUM intermed Sky spectrum within the sky mask (if --skymethod=model and --save contains \"skymodel\")" 127 "\n SKY_LINES final Estimated sky line flux table (if --skymethod=model and --save contains \"skymodel\")" 128 "\n SKY_CONTINUUM final Estimated continuum flux spectrum (if --skymethod=model and --save contains \"skymodel\")";
139 static cpl_recipeconfig *
140 muse_scipost_new_recipeconfig(
void)
142 cpl_recipeconfig *recipeconfig = cpl_recipeconfig_new();
144 cpl_recipeconfig_set_tag(recipeconfig,
"PIXTABLE_OBJECT", 1, -1);
145 cpl_recipeconfig_set_input(recipeconfig,
"PIXTABLE_OBJECT",
"EXTINCT_TABLE", 1, 1);
146 cpl_recipeconfig_set_input(recipeconfig,
"PIXTABLE_OBJECT",
"STD_RESPONSE", 1, 1);
147 cpl_recipeconfig_set_input(recipeconfig,
"PIXTABLE_OBJECT",
"STD_TELLURIC", -1, 1);
148 cpl_recipeconfig_set_input(recipeconfig,
"PIXTABLE_OBJECT",
"ASTROMETRY_WCS", -1, 1);
149 cpl_recipeconfig_set_input(recipeconfig,
"PIXTABLE_OBJECT",
"OFFSET_LIST", -1, 1);
150 cpl_recipeconfig_set_input(recipeconfig,
"PIXTABLE_OBJECT",
"FILTER_LIST", -1, 1);
151 cpl_recipeconfig_set_input(recipeconfig,
"PIXTABLE_OBJECT",
"OUTPUT_WCS", -1, 1);
152 cpl_recipeconfig_set_input(recipeconfig,
"PIXTABLE_OBJECT",
"RAMAN_LINES", 0, 1);
153 cpl_recipeconfig_set_input(recipeconfig,
"PIXTABLE_OBJECT",
"SKY_LINES", 0, 1);
154 cpl_recipeconfig_set_input(recipeconfig,
"PIXTABLE_OBJECT",
"SKY_CONTINUUM", 0, 1);
155 cpl_recipeconfig_set_input(recipeconfig,
"PIXTABLE_OBJECT",
"LSF_PROFILE", 0, -1);
156 cpl_recipeconfig_set_input(recipeconfig,
"PIXTABLE_OBJECT",
"SKY_MASK", 0, 1);
157 cpl_recipeconfig_set_output(recipeconfig,
"PIXTABLE_OBJECT",
"AUTOCAL_MASK");
158 cpl_recipeconfig_set_output(recipeconfig,
"PIXTABLE_OBJECT",
"AUTOCAL_FACTORS");
159 cpl_recipeconfig_set_output(recipeconfig,
"PIXTABLE_OBJECT",
"RAMAN_IMAGES");
160 cpl_recipeconfig_set_output(recipeconfig,
"PIXTABLE_OBJECT",
"SKY_IMAGE");
161 cpl_recipeconfig_set_output(recipeconfig,
"PIXTABLE_OBJECT",
"SKY_MASK");
162 cpl_recipeconfig_set_output(recipeconfig,
"PIXTABLE_OBJECT",
"SKY_SPECTRUM");
163 cpl_recipeconfig_set_output(recipeconfig,
"PIXTABLE_OBJECT",
"SKY_LINES");
164 cpl_recipeconfig_set_output(recipeconfig,
"PIXTABLE_OBJECT",
"SKY_CONTINUUM");
180 static cpl_error_code
181 muse_scipost_prepare_header(
const char *aFrametag, cpl_propertylist *aHeader)
183 cpl_ensure_code(aFrametag, CPL_ERROR_NULL_INPUT);
184 cpl_ensure_code(aHeader, CPL_ERROR_NULL_INPUT);
185 if (!strcmp(aFrametag,
"DATACUBE_FINAL")) {
188 "Number of detected sources in output cube.");
191 "[Angstrom] Wavelength of plane in combined cube that was used for object detection.");
194 "[pix] Position of source k in x-direction in output cube. If the FWHM measurement fails, this value will be -1.");
197 "[pix] Position of source k in y-direction in output cube. If the FWHM measurement fails, this value will be -1.");
200 "[arcsec] FWHM of source k in x-direction in output cube. If the FWHM measurement fails, this value will be -1.");
203 "[arcsec] FWHM of source k in y-direction in output cube. If the FWHM measurement fails, this value will be -1.");
206 "Number of detected sources with valid FWHM in output cube.");
209 "[arcsec] Median FWHM of all sources with valid FWHM measurement (in x- and y-direction) in output cube. If less than three sources with valid FWHM are detected, this value is zero.");
212 "[arcsec] Median absolute deviation of the FWHM of all sources with valid FWHM measurement (in x- and y-direction) in output cube. If less than three sources with valid FWHM are detected, this value is zero.");
213 }
else if (!strcmp(aFrametag,
"IMAGE_FOV")) {
216 "[pix] Position of source k in x-direction in combined frame");
219 "[pix] Position of source k in y-direction in combined frame");
222 "[arcsec] FWHM of source k in x-direction in combined frame");
225 "[arcsec] FWHM of source k in y-direction in combined frame");
226 }
else if (!strcmp(aFrametag,
"OBJECT_RESAMPLED")) {
227 }
else if (!strcmp(aFrametag,
"PIXTABLE_REDUCED")) {
228 }
else if (!strcmp(aFrametag,
"PIXTABLE_POSITIONED")) {
229 }
else if (!strcmp(aFrametag,
"PIXTABLE_COMBINED")) {
230 }
else if (!strcmp(aFrametag,
"AUTOCAL_MASK")) {
233 "Low limit in the white light considered as sky, used to create this mask, everything lower are likely artifacts.");
236 "Threshold in the white light considered as sky, used to create this mask, higher values are likely objects in the field.");
237 }
else if (!strcmp(aFrametag,
"AUTOCAL_FACTORS")) {
238 }
else if (!strcmp(aFrametag,
"RAMAN_IMAGES")) {
241 "2D Polynomial x^2 coefficient");
244 "2D Polynomial xy coefficient");
247 "2D Polynomial y^2 coefficient");
250 "2D Polynomial x coefficient");
253 "2D Polynomial y coefficient");
256 "[erg/(s cm2 arcsec2)] Computed average Raman scattered flux in the O2 band (around 6484 Angstrom)");
259 "[erg/(s cm2 arcsec2)] Computed average Raman scattered flux in the N2 band (around 6827 Angstrom)");
260 }
else if (!strcmp(aFrametag,
"SKY_IMAGE")) {
261 }
else if (!strcmp(aFrametag,
"SKY_MASK")) {
264 "Low limit in the white light considered as sky, used to create this mask, everything lower are likely artifacts.");
267 "Threshold in the white light considered as sky, used to create this mask, higher values are likely objects in the field.");
268 }
else if (!strcmp(aFrametag,
"SKY_SPECTRUM")) {
269 }
else if (!strcmp(aFrametag,
"SKY_LINES")) {
272 "Name of the strongest line in group l");
275 "[Angstrom] Wavelength (air) of the strongest line of group l");
278 "[erg/(s cm2 arcsec2)] Flux of the strongest line of group l");
279 }
else if (!strcmp(aFrametag,
"SKY_CONTINUUM")) {
282 "[erg/(s cm2 arcsec2)] Total flux of the continuum");
285 "[erg/(s cm2 arcsec2 Angstrom)] Maximum (absolute value) of the derivative of the continuum spectrum");
287 cpl_msg_warning(__func__,
"Frame tag %s is not defined", aFrametag);
288 return CPL_ERROR_ILLEGAL_INPUT;
290 return CPL_ERROR_NONE;
303 static cpl_frame_level
304 muse_scipost_get_frame_level(
const char *aFrametag)
307 return CPL_FRAME_LEVEL_NONE;
309 if (!strcmp(aFrametag,
"DATACUBE_FINAL")) {
310 return CPL_FRAME_LEVEL_FINAL;
312 if (!strcmp(aFrametag,
"IMAGE_FOV")) {
313 return CPL_FRAME_LEVEL_FINAL;
315 if (!strcmp(aFrametag,
"OBJECT_RESAMPLED")) {
316 return CPL_FRAME_LEVEL_FINAL;
318 if (!strcmp(aFrametag,
"PIXTABLE_REDUCED")) {
319 return CPL_FRAME_LEVEL_INTERMEDIATE;
321 if (!strcmp(aFrametag,
"PIXTABLE_POSITIONED")) {
322 return CPL_FRAME_LEVEL_INTERMEDIATE;
324 if (!strcmp(aFrametag,
"PIXTABLE_COMBINED")) {
325 return CPL_FRAME_LEVEL_INTERMEDIATE;
327 if (!strcmp(aFrametag,
"AUTOCAL_MASK")) {
328 return CPL_FRAME_LEVEL_INTERMEDIATE;
330 if (!strcmp(aFrametag,
"AUTOCAL_FACTORS")) {
331 return CPL_FRAME_LEVEL_INTERMEDIATE;
333 if (!strcmp(aFrametag,
"RAMAN_IMAGES")) {
334 return CPL_FRAME_LEVEL_INTERMEDIATE;
336 if (!strcmp(aFrametag,
"SKY_IMAGE")) {
337 return CPL_FRAME_LEVEL_INTERMEDIATE;
339 if (!strcmp(aFrametag,
"SKY_MASK")) {
340 return CPL_FRAME_LEVEL_INTERMEDIATE;
342 if (!strcmp(aFrametag,
"SKY_SPECTRUM")) {
343 return CPL_FRAME_LEVEL_INTERMEDIATE;
345 if (!strcmp(aFrametag,
"SKY_LINES")) {
346 return CPL_FRAME_LEVEL_FINAL;
348 if (!strcmp(aFrametag,
"SKY_CONTINUUM")) {
349 return CPL_FRAME_LEVEL_FINAL;
351 return CPL_FRAME_LEVEL_NONE;
365 muse_scipost_get_frame_mode(
const char *aFrametag)
370 if (!strcmp(aFrametag,
"DATACUBE_FINAL")) {
373 if (!strcmp(aFrametag,
"IMAGE_FOV")) {
376 if (!strcmp(aFrametag,
"OBJECT_RESAMPLED")) {
379 if (!strcmp(aFrametag,
"PIXTABLE_REDUCED")) {
382 if (!strcmp(aFrametag,
"PIXTABLE_POSITIONED")) {
385 if (!strcmp(aFrametag,
"PIXTABLE_COMBINED")) {
388 if (!strcmp(aFrametag,
"AUTOCAL_MASK")) {
391 if (!strcmp(aFrametag,
"AUTOCAL_FACTORS")) {
394 if (!strcmp(aFrametag,
"RAMAN_IMAGES")) {
397 if (!strcmp(aFrametag,
"SKY_IMAGE")) {
400 if (!strcmp(aFrametag,
"SKY_MASK")) {
403 if (!strcmp(aFrametag,
"SKY_SPECTRUM")) {
406 if (!strcmp(aFrametag,
"SKY_LINES")) {
409 if (!strcmp(aFrametag,
"SKY_CONTINUUM")) {
427 muse_scipost_create(cpl_plugin *aPlugin)
431 if (cpl_plugin_get_type(aPlugin) == CPL_PLUGIN_TYPE_RECIPE) {
432 recipe = (cpl_recipe *)aPlugin;
440 muse_scipost_new_recipeconfig(),
441 muse_scipost_prepare_header,
442 muse_scipost_get_frame_level,
443 muse_scipost_get_frame_mode);
448 cpl_msg_set_time_on();
452 recipe->parameters = cpl_parameterlist_new();
466 p = cpl_parameter_new_value(
"muse.muse_scipost.save",
468 "Select output product(s) to save. Can contain one or more of \"cube\", \"autocal\", \"skymodel\", \"individual\", \"positioned\", \"combined\", and \"stacked\". If several options are given, they have to be comma-separated. (\"cube\": output cube and associated images, if this is not given, no final resampling is done at all -- \"autocal\": up to two additional output products related to the slice autocalibration -- \"raman\": up to four additional output products about the Raman light distribution for AO observations -- \"skymodel\": up to four additional output products about the effectively used sky that was subtracted with the \"model\" method -- \"individual\": fully reduced pixel table for each individual exposure -- \"positioned\": fully reduced and positioned pixel table for each individual exposure, the difference to \"individual\" is that here, the output pixel tables have coordinates in RA and DEC; this is only useful, if both the relative exposure weighting and the final resampling are to be done externally -- \"combined\": fully reduced and combined pixel table for the full set of exposures, the difference to \"positioned\" is that all pixel tables are combined into one, with an added weight column; this is useful, if only the final resampling step is to be done separately -- \"stacked\": an additional output file in form of a 2D column-stacked image, i.e. x direction is pseudo-spatial, y direction is wavelength.)",
470 (
const char *)
"cube,skymodel");
471 cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CFG,
"save");
472 cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,
"save");
474 cpl_parameterlist_append(recipe->parameters, p);
477 p = cpl_parameter_new_enum(
"muse.muse_scipost.resample",
479 "The resampling technique to use for the final output cube.",
481 (
const char *)
"drizzle",
483 (
const char *)
"nearest",
484 (
const char *)
"linear",
485 (
const char *)
"quadratic",
486 (
const char *)
"renka",
487 (
const char *)
"drizzle",
488 (
const char *)
"lanczos");
489 cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CFG,
"resample");
490 cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,
"resample");
492 cpl_parameterlist_append(recipe->parameters, p);
495 p = cpl_parameter_new_value(
"muse.muse_scipost.dx",
497 "Horizontal step size for resampling (in arcsec or pixel). The following defaults are taken when this value is set to 0.0: 0.2'' for WFM, 0.025'' for NFM, 1.0 if data is in pixel units.",
500 cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CFG,
"dx");
501 cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,
"dx");
503 cpl_parameterlist_append(recipe->parameters, p);
506 p = cpl_parameter_new_value(
"muse.muse_scipost.dy",
508 "Vertical step size for resampling (in arcsec or pixel). The following defaults are taken when this value is set to 0.0: 0.2'' for WFM, 0.025'' for NFM, 1.0 if data is in pixel units.",
511 cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CFG,
"dy");
512 cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,
"dy");
514 cpl_parameterlist_append(recipe->parameters, p);
517 p = cpl_parameter_new_value(
"muse.muse_scipost.dlambda",
519 "Wavelength step size (in Angstrom). Natural instrument sampling is used, if this is 0.0",
522 cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CFG,
"dlambda");
523 cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,
"dlambda");
525 cpl_parameterlist_append(recipe->parameters, p);
528 p = cpl_parameter_new_enum(
"muse.muse_scipost.crtype",
530 "Type of statistics used for detection of cosmic rays during final resampling. \"iraf\" uses the variance information, \"mean\" uses standard (mean/stdev) statistics, \"median\" uses median and the median median of the absolute median deviation.",
532 (
const char *)
"median",
534 (
const char *)
"iraf",
535 (
const char *)
"mean",
536 (
const char *)
"median");
537 cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CFG,
"crtype");
538 cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,
"crtype");
540 cpl_parameterlist_append(recipe->parameters, p);
543 p = cpl_parameter_new_value(
"muse.muse_scipost.crsigma",
545 "Sigma rejection factor to use for cosmic ray rejection during final resampling. A zero or negative value switches cosmic ray rejection off.",
548 cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CFG,
"crsigma");
549 cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,
"crsigma");
551 cpl_parameterlist_append(recipe->parameters, p);
554 p = cpl_parameter_new_value(
"muse.muse_scipost.rc",
556 "Critical radius for the \"renka\" resampling method.",
559 cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CFG,
"rc");
560 cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,
"rc");
562 cpl_parameterlist_append(recipe->parameters, p);
565 p = cpl_parameter_new_value(
"muse.muse_scipost.pixfrac",
567 "Pixel down-scaling factor for the \"drizzle\" resampling method. Up to three, comma-separated, floating-point values can be given. If only one value is given, it applies to all dimensions, two values are interpreted as spatial and spectral direction, respectively, while three are taken as horizontal, vertical, and spectral.",
569 (
const char *)
"0.8,0.8");
570 cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CFG,
"pixfrac");
571 cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,
"pixfrac");
573 cpl_parameterlist_append(recipe->parameters, p);
576 p = cpl_parameter_new_value(
"muse.muse_scipost.ld",
578 "Number of adjacent pixels to take into account during resampling in all three directions (loop distance); this affects all resampling methods except \"nearest\".",
581 cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CFG,
"ld");
582 cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,
"ld");
584 cpl_parameterlist_append(recipe->parameters, p);
587 p = cpl_parameter_new_enum(
"muse.muse_scipost.format",
589 "Type of output file format, \"Cube\" is a standard FITS cube with NAXIS=3 and multiple extensions (for data and variance). The extended \"x\" formats include the reconstructed image(s) in FITS image extensions within the same file. \"sdpCube\" does some extra calculations to create FITS keywords for the ESO Science Data Products.",
591 (
const char *)
"Cube",
593 (
const char *)
"Cube",
594 (
const char *)
"Euro3D",
595 (
const char *)
"xCube",
596 (
const char *)
"xEuro3D",
597 (
const char *)
"sdpCube");
598 cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CFG,
"format");
599 cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,
"format");
601 cpl_parameterlist_append(recipe->parameters, p);
604 p = cpl_parameter_new_enum(
"muse.muse_scipost.weight",
606 "Type of weighting scheme to use when combining multiple exposures. \"exptime\" just uses the exposure time to weight the exposures, \"fwhm\" uses the best available seeing information from the headers as well, \"none\" preserves an existing weight column in the input pixel tables without changes.",
608 (
const char *)
"exptime",
610 (
const char *)
"exptime",
611 (
const char *)
"fwhm",
612 (
const char *)
"none");
613 cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CFG,
"weight");
614 cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,
"weight");
616 cpl_parameterlist_append(recipe->parameters, p);
619 p = cpl_parameter_new_value(
"muse.muse_scipost.filter",
621 "The filter name(s) to be used for the output field-of-view image. Each name has to correspond to an EXTNAME in an extension of the FILTER_LIST file. If an unsupported filter name is given, creation of the respective image is omitted. If multiple filter names are given, they have to be comma separated.",
623 (
const char *)
"white");
624 cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CFG,
"filter");
625 cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,
"filter");
627 cpl_parameterlist_append(recipe->parameters, p);
630 p = cpl_parameter_new_enum(
"muse.muse_scipost.autocalib",
632 "The type of autocalibration to use. \"none\" switches it off, \"deepfield\" uses the revised MPDAF method that can be used for the reduction of mostly empty \"Deep Fields\".",
634 (
const char *)
"none",
636 (
const char *)
"none",
637 (
const char *)
"deepfield");
638 cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CFG,
"autocalib");
639 cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,
"autocalib");
641 cpl_parameterlist_append(recipe->parameters, p);
644 p = cpl_parameter_new_value(
"muse.muse_scipost.raman_width",
646 "Wavelength range around Raman lines [Angstrom].",
649 cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CFG,
"raman_width");
650 cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,
"raman_width");
651 if (!getenv(
"MUSE_EXPERT_USER")) {
652 cpl_parameter_disable(p, CPL_PARAMETER_MODE_CLI);
655 cpl_parameterlist_append(recipe->parameters, p);
665 p = cpl_parameter_new_enum(
"muse.muse_scipost.skymethod",
667 "The method used to subtract the sky background (spectrum). Option \"model\" should work in all kinds of science fields: it uses a global sky spectrum model with a local LSF. \"model\" uses fluxes indicated in the SKY_LINES file as starting estimates, but re-fits them on the global sky spectrum created from the science exposure. If SKY_CONTINUUM is given, it is directly subtracted, otherwise it is created from the sky region of the science exposure. Option \"subtract-model\" uses the input SKY_LINES and SKY_CONTINUUM, subtracting them directly without re-fitting the fluxes, but still makes use of the local LSF, hence LSF_PROFILE is required. The inputs LSF_PROFILE and SKY_LINES are necessary for these two model-based methods; SKY_CONTINUUM is required for \"subtract-model\" and optional for \"model\"; SKY_MASK is optional for \"model\". Finally, option \"simple\" creates a sky spectrum from the science data, and directly subtracts it, without taking the LSF into account (LSF_PROFILE and input SKY files are ignored). It works on data that was not flux calibrated.",
669 (
const char *)
"model",
671 (
const char *)
"none",
672 (
const char *)
"subtract-model",
673 (
const char *)
"model",
674 (
const char *)
"simple");
675 cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CFG,
"skymethod");
676 cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,
"skymethod");
678 cpl_parameterlist_append(recipe->parameters, p);
681 p = cpl_parameter_new_value(
"muse.muse_scipost.lambdamin",
683 "Cut off the data below this wavelength after loading the pixel table(s).",
686 cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CFG,
"lambdamin");
687 cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,
"lambdamin");
689 cpl_parameterlist_append(recipe->parameters, p);
692 p = cpl_parameter_new_value(
"muse.muse_scipost.lambdamax",
694 "Cut off the data above this wavelength after loading the pixel table(s).",
697 cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CFG,
"lambdamax");
698 cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,
"lambdamax");
700 cpl_parameterlist_append(recipe->parameters, p);
703 p = cpl_parameter_new_value(
"muse.muse_scipost.lambdaref",
705 "Reference wavelength used for correction of differential atmospheric refraction. The R-band (peak wavelength ~7000 Angstrom) that is usually used for guiding, is close to the central wavelength of MUSE, so a value of 7000.0 Angstrom should be used if nothing else is known. A value less than zero switches DAR correction off.",
708 cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CFG,
"lambdaref");
709 cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,
"lambdaref");
711 cpl_parameterlist_append(recipe->parameters, p);
714 p = cpl_parameter_new_enum(
"muse.muse_scipost.darcheck",
716 "Carry out a check of the theoretical DAR correction using source centroiding. If \"correct\" it will also apply an empirical correction.",
718 (
const char *)
"none",
720 (
const char *)
"none",
721 (
const char *)
"check",
722 (
const char *)
"correct");
723 cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CFG,
"darcheck");
724 cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,
"darcheck");
726 cpl_parameterlist_append(recipe->parameters, p);
729 p = cpl_parameter_new_value(
"muse.muse_scipost.skymodel_fraction",
731 "Fraction of the image (without the ignored part) to be considered as sky. If an input sky mask is provided, the fraction is applied to the regions within the mask. If the whole sky mask should be used, set this parameter to 1.",
734 cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CFG,
"skymodel_fraction");
735 cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,
"skymodel_fraction");
737 cpl_parameterlist_append(recipe->parameters, p);
740 p = cpl_parameter_new_value(
"muse.muse_scipost.skymodel_ignore",
742 "Fraction of the image to be ignored. If an input sky mask is provided, the fraction is applied to the regions within the mask. If the whole sky mask should be used, set this parameter to 0.",
745 cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CFG,
"skymodel_ignore");
746 cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,
"skymodel_ignore");
748 cpl_parameterlist_append(recipe->parameters, p);
751 p = cpl_parameter_new_value(
"muse.muse_scipost.skymodel_sampling",
753 "Spectral sampling of the sky spectrum [Angstrom].",
756 cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CFG,
"skymodel_sampling");
757 cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,
"skymodel_sampling");
758 if (!getenv(
"MUSE_EXPERT_USER")) {
759 cpl_parameter_disable(p, CPL_PARAMETER_MODE_CLI);
762 cpl_parameterlist_append(recipe->parameters, p);
765 p = cpl_parameter_new_value(
"muse.muse_scipost.skymodel_csampling",
767 "Spectral sampling of the continuum spectrum [Angstrom].",
770 cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CFG,
"skymodel_csampling");
771 cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,
"skymodel_csampling");
772 if (!getenv(
"MUSE_EXPERT_USER")) {
773 cpl_parameter_disable(p, CPL_PARAMETER_MODE_CLI);
776 cpl_parameterlist_append(recipe->parameters, p);
779 p = cpl_parameter_new_value(
"muse.muse_scipost.sky_crsigma",
781 "Sigma level clipping for cube-based and spectrum-based CR rejection when creating the sky spectrum. This has to be a string of two comma-separated floating-point numbers. The first value gives the sigma-level rejection for cube-based CR rejection (using \"median\"), the second value the sigma-level for spectrum-based CR cleaning. Both can be switched off, by passing zero or a negative value.",
783 (
const char *)
"15.,15.");
784 cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CFG,
"sky_crsigma");
785 cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,
"sky_crsigma");
786 if (!getenv(
"MUSE_EXPERT_USER")) {
787 cpl_parameter_disable(p, CPL_PARAMETER_MODE_CLI);
790 cpl_parameterlist_append(recipe->parameters, p);
793 p = cpl_parameter_new_enum(
"muse.muse_scipost.rvcorr",
795 "Correct the radial velocity of the telescope with reference to either the barycenter of the Solar System (bary), the center of the Sun (helio), or to the center of the Earth (geo).",
797 (
const char *)
"bary",
799 (
const char *)
"bary",
800 (
const char *)
"helio",
802 (
const char *)
"none");
803 cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CFG,
"rvcorr");
804 cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,
"rvcorr");
806 cpl_parameterlist_append(recipe->parameters, p);
809 p = cpl_parameter_new_value(
"muse.muse_scipost.astrometry",
811 "If false, skip any astrometric calibration, even if one was passed in the input set of files. This causes creation of an output cube with a linear WCS and may result in errors. If you want to use a sensible default, leave this true but do not pass an ASTROMETRY_WCS.",
814 cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CFG,
"astrometry");
815 cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,
"astrometry");
817 cpl_parameterlist_append(recipe->parameters, p);
837 cpl_ensure_code(aParams, CPL_ERROR_NULL_INPUT);
838 cpl_ensure_code(aParameters, CPL_ERROR_NULL_INPUT);
841 p = cpl_parameterlist_find(aParameters,
"muse.muse_scipost.save");
842 cpl_ensure_code(p, CPL_ERROR_DATA_NOT_FOUND);
843 aParams->
save = cpl_parameter_get_string(p);
845 p = cpl_parameterlist_find(aParameters,
"muse.muse_scipost.resample");
846 cpl_ensure_code(p, CPL_ERROR_DATA_NOT_FOUND);
847 aParams->
resample_s = cpl_parameter_get_string(p);
849 (!strcasecmp(aParams->
resample_s,
"nearest")) ? MUSE_SCIPOST_PARAM_RESAMPLE_NEAREST :
850 (!strcasecmp(aParams->
resample_s,
"linear")) ? MUSE_SCIPOST_PARAM_RESAMPLE_LINEAR :
851 (!strcasecmp(aParams->
resample_s,
"quadratic")) ? MUSE_SCIPOST_PARAM_RESAMPLE_QUADRATIC :
852 (!strcasecmp(aParams->
resample_s,
"renka")) ? MUSE_SCIPOST_PARAM_RESAMPLE_RENKA :
853 (!strcasecmp(aParams->
resample_s,
"drizzle")) ? MUSE_SCIPOST_PARAM_RESAMPLE_DRIZZLE :
854 (!strcasecmp(aParams->
resample_s,
"lanczos")) ? MUSE_SCIPOST_PARAM_RESAMPLE_LANCZOS :
855 MUSE_SCIPOST_PARAM_RESAMPLE_INVALID_VALUE;
856 cpl_ensure_code(aParams->
resample != MUSE_SCIPOST_PARAM_RESAMPLE_INVALID_VALUE,
857 CPL_ERROR_ILLEGAL_INPUT);
859 p = cpl_parameterlist_find(aParameters,
"muse.muse_scipost.dx");
860 cpl_ensure_code(p, CPL_ERROR_DATA_NOT_FOUND);
861 aParams->
dx = cpl_parameter_get_double(p);
863 p = cpl_parameterlist_find(aParameters,
"muse.muse_scipost.dy");
864 cpl_ensure_code(p, CPL_ERROR_DATA_NOT_FOUND);
865 aParams->
dy = cpl_parameter_get_double(p);
867 p = cpl_parameterlist_find(aParameters,
"muse.muse_scipost.dlambda");
868 cpl_ensure_code(p, CPL_ERROR_DATA_NOT_FOUND);
869 aParams->
dlambda = cpl_parameter_get_double(p);
871 p = cpl_parameterlist_find(aParameters,
"muse.muse_scipost.crtype");
872 cpl_ensure_code(p, CPL_ERROR_DATA_NOT_FOUND);
873 aParams->
crtype_s = cpl_parameter_get_string(p);
875 (!strcasecmp(aParams->
crtype_s,
"iraf")) ? MUSE_SCIPOST_PARAM_CRTYPE_IRAF :
876 (!strcasecmp(aParams->
crtype_s,
"mean")) ? MUSE_SCIPOST_PARAM_CRTYPE_MEAN :
877 (!strcasecmp(aParams->
crtype_s,
"median")) ? MUSE_SCIPOST_PARAM_CRTYPE_MEDIAN :
878 MUSE_SCIPOST_PARAM_CRTYPE_INVALID_VALUE;
879 cpl_ensure_code(aParams->
crtype != MUSE_SCIPOST_PARAM_CRTYPE_INVALID_VALUE,
880 CPL_ERROR_ILLEGAL_INPUT);
882 p = cpl_parameterlist_find(aParameters,
"muse.muse_scipost.crsigma");
883 cpl_ensure_code(p, CPL_ERROR_DATA_NOT_FOUND);
884 aParams->
crsigma = cpl_parameter_get_double(p);
886 p = cpl_parameterlist_find(aParameters,
"muse.muse_scipost.rc");
887 cpl_ensure_code(p, CPL_ERROR_DATA_NOT_FOUND);
888 aParams->
rc = cpl_parameter_get_double(p);
890 p = cpl_parameterlist_find(aParameters,
"muse.muse_scipost.pixfrac");
891 cpl_ensure_code(p, CPL_ERROR_DATA_NOT_FOUND);
892 aParams->
pixfrac = cpl_parameter_get_string(p);
894 p = cpl_parameterlist_find(aParameters,
"muse.muse_scipost.ld");
895 cpl_ensure_code(p, CPL_ERROR_DATA_NOT_FOUND);
896 aParams->
ld = cpl_parameter_get_int(p);
898 p = cpl_parameterlist_find(aParameters,
"muse.muse_scipost.format");
899 cpl_ensure_code(p, CPL_ERROR_DATA_NOT_FOUND);
900 aParams->
format_s = cpl_parameter_get_string(p);
902 (!strcasecmp(aParams->
format_s,
"Cube")) ? MUSE_SCIPOST_PARAM_FORMAT_CUBE :
903 (!strcasecmp(aParams->
format_s,
"Euro3D")) ? MUSE_SCIPOST_PARAM_FORMAT_EURO3D :
904 (!strcasecmp(aParams->
format_s,
"xCube")) ? MUSE_SCIPOST_PARAM_FORMAT_XCUBE :
905 (!strcasecmp(aParams->
format_s,
"xEuro3D")) ? MUSE_SCIPOST_PARAM_FORMAT_XEURO3D :
906 (!strcasecmp(aParams->
format_s,
"sdpCube")) ? MUSE_SCIPOST_PARAM_FORMAT_SDPCUBE :
907 MUSE_SCIPOST_PARAM_FORMAT_INVALID_VALUE;
908 cpl_ensure_code(aParams->
format != MUSE_SCIPOST_PARAM_FORMAT_INVALID_VALUE,
909 CPL_ERROR_ILLEGAL_INPUT);
911 p = cpl_parameterlist_find(aParameters,
"muse.muse_scipost.weight");
912 cpl_ensure_code(p, CPL_ERROR_DATA_NOT_FOUND);
913 aParams->
weight_s = cpl_parameter_get_string(p);
915 (!strcasecmp(aParams->
weight_s,
"exptime")) ? MUSE_SCIPOST_PARAM_WEIGHT_EXPTIME :
916 (!strcasecmp(aParams->
weight_s,
"fwhm")) ? MUSE_SCIPOST_PARAM_WEIGHT_FWHM :
917 (!strcasecmp(aParams->
weight_s,
"none")) ? MUSE_SCIPOST_PARAM_WEIGHT_NONE :
918 MUSE_SCIPOST_PARAM_WEIGHT_INVALID_VALUE;
919 cpl_ensure_code(aParams->
weight != MUSE_SCIPOST_PARAM_WEIGHT_INVALID_VALUE,
920 CPL_ERROR_ILLEGAL_INPUT);
922 p = cpl_parameterlist_find(aParameters,
"muse.muse_scipost.filter");
923 cpl_ensure_code(p, CPL_ERROR_DATA_NOT_FOUND);
924 aParams->
filter = cpl_parameter_get_string(p);
926 p = cpl_parameterlist_find(aParameters,
"muse.muse_scipost.autocalib");
927 cpl_ensure_code(p, CPL_ERROR_DATA_NOT_FOUND);
928 aParams->
autocalib_s = cpl_parameter_get_string(p);
930 (!strcasecmp(aParams->
autocalib_s,
"none")) ? MUSE_SCIPOST_PARAM_AUTOCALIB_NONE :
931 (!strcasecmp(aParams->
autocalib_s,
"deepfield")) ? MUSE_SCIPOST_PARAM_AUTOCALIB_DEEPFIELD :
932 MUSE_SCIPOST_PARAM_AUTOCALIB_INVALID_VALUE;
933 cpl_ensure_code(aParams->
autocalib != MUSE_SCIPOST_PARAM_AUTOCALIB_INVALID_VALUE,
934 CPL_ERROR_ILLEGAL_INPUT);
936 p = cpl_parameterlist_find(aParameters,
"muse.muse_scipost.raman_width");
937 cpl_ensure_code(p, CPL_ERROR_DATA_NOT_FOUND);
938 aParams->
raman_width = cpl_parameter_get_double(p);
940 p = cpl_parameterlist_find(aParameters,
"muse.muse_scipost.skymethod");
941 cpl_ensure_code(p, CPL_ERROR_DATA_NOT_FOUND);
942 aParams->
skymethod_s = cpl_parameter_get_string(p);
944 (!strcasecmp(aParams->
skymethod_s,
"none")) ? MUSE_SCIPOST_PARAM_SKYMETHOD_NONE :
945 (!strcasecmp(aParams->
skymethod_s,
"subtract-model")) ? MUSE_SCIPOST_PARAM_SKYMETHOD_SUBTRACT_MODEL :
946 (!strcasecmp(aParams->
skymethod_s,
"model")) ? MUSE_SCIPOST_PARAM_SKYMETHOD_MODEL :
947 (!strcasecmp(aParams->
skymethod_s,
"simple")) ? MUSE_SCIPOST_PARAM_SKYMETHOD_SIMPLE :
948 MUSE_SCIPOST_PARAM_SKYMETHOD_INVALID_VALUE;
949 cpl_ensure_code(aParams->
skymethod != MUSE_SCIPOST_PARAM_SKYMETHOD_INVALID_VALUE,
950 CPL_ERROR_ILLEGAL_INPUT);
952 p = cpl_parameterlist_find(aParameters,
"muse.muse_scipost.lambdamin");
953 cpl_ensure_code(p, CPL_ERROR_DATA_NOT_FOUND);
954 aParams->
lambdamin = cpl_parameter_get_double(p);
956 p = cpl_parameterlist_find(aParameters,
"muse.muse_scipost.lambdamax");
957 cpl_ensure_code(p, CPL_ERROR_DATA_NOT_FOUND);
958 aParams->
lambdamax = cpl_parameter_get_double(p);
960 p = cpl_parameterlist_find(aParameters,
"muse.muse_scipost.lambdaref");
961 cpl_ensure_code(p, CPL_ERROR_DATA_NOT_FOUND);
962 aParams->
lambdaref = cpl_parameter_get_double(p);
964 p = cpl_parameterlist_find(aParameters,
"muse.muse_scipost.darcheck");
965 cpl_ensure_code(p, CPL_ERROR_DATA_NOT_FOUND);
966 aParams->
darcheck_s = cpl_parameter_get_string(p);
968 (!strcasecmp(aParams->
darcheck_s,
"none")) ? MUSE_SCIPOST_PARAM_DARCHECK_NONE :
969 (!strcasecmp(aParams->
darcheck_s,
"check")) ? MUSE_SCIPOST_PARAM_DARCHECK_CHECK :
970 (!strcasecmp(aParams->
darcheck_s,
"correct")) ? MUSE_SCIPOST_PARAM_DARCHECK_CORRECT :
971 MUSE_SCIPOST_PARAM_DARCHECK_INVALID_VALUE;
972 cpl_ensure_code(aParams->
darcheck != MUSE_SCIPOST_PARAM_DARCHECK_INVALID_VALUE,
973 CPL_ERROR_ILLEGAL_INPUT);
975 p = cpl_parameterlist_find(aParameters,
"muse.muse_scipost.skymodel_fraction");
976 cpl_ensure_code(p, CPL_ERROR_DATA_NOT_FOUND);
979 p = cpl_parameterlist_find(aParameters,
"muse.muse_scipost.skymodel_ignore");
980 cpl_ensure_code(p, CPL_ERROR_DATA_NOT_FOUND);
983 p = cpl_parameterlist_find(aParameters,
"muse.muse_scipost.skymodel_sampling");
984 cpl_ensure_code(p, CPL_ERROR_DATA_NOT_FOUND);
987 p = cpl_parameterlist_find(aParameters,
"muse.muse_scipost.skymodel_csampling");
988 cpl_ensure_code(p, CPL_ERROR_DATA_NOT_FOUND);
991 p = cpl_parameterlist_find(aParameters,
"muse.muse_scipost.sky_crsigma");
992 cpl_ensure_code(p, CPL_ERROR_DATA_NOT_FOUND);
993 aParams->
sky_crsigma = cpl_parameter_get_string(p);
995 p = cpl_parameterlist_find(aParameters,
"muse.muse_scipost.rvcorr");
996 cpl_ensure_code(p, CPL_ERROR_DATA_NOT_FOUND);
997 aParams->
rvcorr_s = cpl_parameter_get_string(p);
999 (!strcasecmp(aParams->
rvcorr_s,
"bary")) ? MUSE_SCIPOST_PARAM_RVCORR_BARY :
1000 (!strcasecmp(aParams->
rvcorr_s,
"helio")) ? MUSE_SCIPOST_PARAM_RVCORR_HELIO :
1001 (!strcasecmp(aParams->
rvcorr_s,
"geo")) ? MUSE_SCIPOST_PARAM_RVCORR_GEO :
1002 (!strcasecmp(aParams->
rvcorr_s,
"none")) ? MUSE_SCIPOST_PARAM_RVCORR_NONE :
1003 MUSE_SCIPOST_PARAM_RVCORR_INVALID_VALUE;
1004 cpl_ensure_code(aParams->
rvcorr != MUSE_SCIPOST_PARAM_RVCORR_INVALID_VALUE,
1005 CPL_ERROR_ILLEGAL_INPUT);
1007 p = cpl_parameterlist_find(aParameters,
"muse.muse_scipost.astrometry");
1008 cpl_ensure_code(p, CPL_ERROR_DATA_NOT_FOUND);
1009 aParams->
astrometry = cpl_parameter_get_bool(p);
1023 muse_scipost_exec(cpl_plugin *aPlugin)
1025 if (cpl_plugin_get_type(aPlugin) != CPL_PLUGIN_TYPE_RECIPE) {
1029 cpl_recipe *recipe = (cpl_recipe *)aPlugin;
1030 cpl_msg_set_threadid_on();
1032 cpl_frameset *usedframes = cpl_frameset_new(),
1033 *outframes = cpl_frameset_new();
1035 muse_scipost_params_fill(¶ms, recipe->parameters);
1037 cpl_errorstate prestate = cpl_errorstate_get();
1041 int rc = muse_scipost_compute(proc, ¶ms);
1042 cpl_frameset_join(usedframes, proc->
usedframes);
1043 cpl_frameset_join(outframes, proc->
outframes);
1046 if (!cpl_errorstate_is_equal(prestate)) {
1050 cpl_msg_set_level(CPL_MSG_INFO);
1061 cpl_frameset_join(recipe->frames, usedframes);
1062 cpl_frameset_join(recipe->frames, outframes);
1063 cpl_frameset_delete(usedframes);
1064 cpl_frameset_delete(outframes);
1077 muse_scipost_destroy(cpl_plugin *aPlugin)
1081 if (cpl_plugin_get_type(aPlugin) == CPL_PLUGIN_TYPE_RECIPE) {
1082 recipe = (cpl_recipe *)aPlugin;
1088 cpl_parameterlist_delete(recipe->parameters);
1105 cpl_plugin_get_info(cpl_pluginlist *aList)
1107 cpl_recipe *recipe = cpl_calloc(1,
sizeof *recipe);
1108 cpl_plugin *plugin = &recipe->interface;
1112 helptext = cpl_sprintf(
"%s%s", muse_scipost_help,
1113 muse_scipost_help_esorex);
1115 helptext = cpl_sprintf(
"%s", muse_scipost_help);
1119 cpl_plugin_init(plugin, CPL_PLUGIN_API, MUSE_BINARY_VERSION,
1120 CPL_PLUGIN_TYPE_RECIPE,
1122 "Prepare reduced and combined science products.",
1127 muse_scipost_create,
1129 muse_scipost_destroy);
1130 cpl_pluginlist_append(aList, plugin);
void muse_processing_delete(muse_processing *aProcessing)
Free the muse_processing structure.
int rvcorr
Correct the radial velocity of the telescope with reference to either the barycenter of the Solar Sys...
double lambdamin
Cut off the data below this wavelength after loading the pixel table(s).
const char * skymethod_s
The method used to subtract the sky background (spectrum). Option "model" should work in all kinds of...
const char * darcheck_s
Carry out a check of the theoretical DAR correction using source centroiding. If "correct" it will al...
double skymodel_ignore
Fraction of the image to be ignored. If an input sky mask is provided, the fraction is applied to the...
muse_cplframework_type muse_cplframework(void)
Return the CPL framework the recipe is run under.
int ld
Number of adjacent pixels to take into account during resampling in all three directions (loop distan...
const char * rvcorr_s
Correct the radial velocity of the telescope with reference to either the barycenter of the Solar Sys...
const char * pixfrac
Pixel down-scaling factor for the "drizzle" resampling method. Up to three, comma-separated, floating-point values can be given. If only one value is given, it applies to all dimensions, two values are interpreted as spatial and spectral direction, respectively, while three are taken as horizontal, vertical, and spectral.
const char * sky_crsigma
Sigma level clipping for cube-based and spectrum-based CR rejection when creating the sky spectrum...
const char * filter
The filter name(s) to be used for the output field-of-view image. Each name has to correspond to an E...
cpl_frameset * usedframes
muse_processing * muse_processing_new(const char *aName, cpl_recipe *aRecipe)
Create a new processing structure.
const char * weight_s
Type of weighting scheme to use when combining multiple exposures. "exptime" just uses the exposure t...
const char * muse_get_license(void)
Get the pipeline copyright and license.
double dy
Vertical step size for resampling (in arcsec or pixel). The following defaults are taken when this va...
double lambdaref
Reference wavelength used for correction of differential atmospheric refraction. The R-band (peak wav...
double rc
Critical radius for the "renka" resampling method.
double skymodel_fraction
Fraction of the image (without the ignored part) to be considered as sky. If an input sky mask is pro...
void muse_cplerrorstate_dump_some(unsigned aCurrent, unsigned aFirst, unsigned aLast)
Dump some CPL errors.
const char * crtype_s
Type of statistics used for detection of cosmic rays during final resampling. "iraf" uses the varianc...
void muse_processinginfo_delete(cpl_recipe *)
Clear all information from the processing info and from the recipe config.
int darcheck
Carry out a check of the theoretical DAR correction using source centroiding. If "correct" it will al...
double skymodel_sampling
Spectral sampling of the sky spectrum [Angstrom].
int astrometry
If false, skip any astrometric calibration, even if one was passed in the input set of files...
double skymodel_csampling
Spectral sampling of the continuum spectrum [Angstrom].
int weight
Type of weighting scheme to use when combining multiple exposures. "exptime" just uses the exposure t...
const char * format_s
Type of output file format, "Cube" is a standard FITS cube with NAXIS=3 and multiple extensions (for ...
const char * autocalib_s
The type of autocalibration to use. "none" switches it off, "deepfield" uses the revised MPDAF method...
double lambdamax
Cut off the data above this wavelength after loading the pixel table(s).
cpl_error_code muse_cplframeset_erase_duplicate(cpl_frameset *aFrames)
Erase all duplicate frames from a frameset.
double dx
Horizontal step size for resampling (in arcsec or pixel). The following defaults are taken when this ...
cpl_error_code muse_cplframeset_erase_all(cpl_frameset *aFrames)
Erase all frames in a frameset.
double raman_width
Wavelength range around Raman lines [Angstrom].
int skymethod
The method used to subtract the sky background (spectrum). Option "model" should work in all kinds of...
Structure to hold the parameters of the muse_scipost recipe.
double crsigma
Sigma rejection factor to use for cosmic ray rejection during final resampling. A zero or negative va...
int resample
The resampling technique to use for the final output cube.
void muse_processinginfo_register(cpl_recipe *, cpl_recipeconfig *, muse_processing_prepare_header_func *, muse_processing_get_frame_level_func *, muse_processing_get_frame_mode_func *)
Register extended functionalities for MUSE recipes.
void muse_processing_recipeinfo(cpl_plugin *)
Output main pipeline configuration, inputs, and parameters.
double dlambda
Wavelength step size (in Angstrom). Natural instrument sampling is used, if this is 0...
int format
Type of output file format, "Cube" is a standard FITS cube with NAXIS=3 and multiple extensions (for ...
const char * resample_s
The resampling technique to use for the final output cube. (as string)
int crtype
Type of statistics used for detection of cosmic rays during final resampling. "iraf" uses the varianc...
int autocalib
The type of autocalibration to use. "none" switches it off, "deepfield" uses the revised MPDAF method...
cpl_error_code muse_processing_prepare_property(cpl_propertylist *, const char *, cpl_type, const char *)
Prepare and check the specified property.
const char * save
Select output product(s) to save. Can contain one or more of "cube", "autocal", "skymodel", "individual", "positioned", "combined", and "stacked". If several options are given, they have to be comma-separated. ("cube": output cube and associated images, if this is not given, no final resampling is done at all – "autocal": up to two additional output products related to the slice autocalibration – "raman": up to four additional output products about the Raman light distribution for AO observations – "skymodel": up to four additional output products about the effectively used sky that was subtracted with the "model" method – "individual": fully reduced pixel table for each individual exposure – "positioned": fully reduced and positioned pixel table for each individual exposure, the difference to "individual" is that here, the output pixel tables have coordinates in RA and DEC; this is only useful, if both the relative exposure weighting and the final resampling are to be done externally – "combined": fully reduced and combined pixel table for the full set of exposures, the difference to "positioned" is that all pixel tables are combined into one, with an added weight column; this is useful, if only the final resampling step is to be done separately – "stacked": an additional output file in form of a 2D column-stacked image, i.e. x direction is pseudo-spatial, y direction is wavelength.)