MUSE Pipeline Reference Manual  2.5.2
muse_scipost_z.c
1 /* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim:set sw=2 sts=2 et cin: */
3 /*
4  * This file is part of the MUSE Instrument Pipeline
5  * Copyright (C) 2005-2015 European Southern Observatory
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20  */
21 
22 /* This file was automatically generated */
23 
24 #ifdef HAVE_CONFIG_H
25 #include <config.h>
26 #endif
27 
28 /*----------------------------------------------------------------------------*
29  * Includes *
30  *----------------------------------------------------------------------------*/
31 #include <string.h> /* strcmp(), strstr() */
32 #include <strings.h> /* strcasecmp() */
33 #include <cpl.h>
34 
35 #include "muse_scipost_z.h" /* in turn includes muse.h */
36 
37 /*----------------------------------------------------------------------------*/
86 /*----------------------------------------------------------------------------*/
89 /*----------------------------------------------------------------------------*
90  * Static variables *
91  *----------------------------------------------------------------------------*/
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.";
94 
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\")";
129 
130 /*----------------------------------------------------------------------------*/
138 /*----------------------------------------------------------------------------*/
139 static cpl_recipeconfig *
140 muse_scipost_new_recipeconfig(void)
141 {
142  cpl_recipeconfig *recipeconfig = cpl_recipeconfig_new();
143 
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");
165 
166  return recipeconfig;
167 } /* muse_scipost_new_recipeconfig() */
168 
169 /*----------------------------------------------------------------------------*/
179 /*----------------------------------------------------------------------------*/
180 static cpl_error_code
181 muse_scipost_prepare_header(const char *aFrametag, cpl_propertylist *aHeader)
182 {
183  cpl_ensure_code(aFrametag, CPL_ERROR_NULL_INPUT);
184  cpl_ensure_code(aHeader, CPL_ERROR_NULL_INPUT);
185  if (!strcmp(aFrametag, "DATACUBE_FINAL")) {
186  muse_processing_prepare_property(aHeader, "ESO QC SCIPOST NDET",
187  CPL_TYPE_INT,
188  "Number of detected sources in output cube.");
189  muse_processing_prepare_property(aHeader, "ESO QC SCIPOST LAMBDA",
190  CPL_TYPE_FLOAT,
191  "[Angstrom] Wavelength of plane in combined cube that was used for object detection.");
192  muse_processing_prepare_property(aHeader, "ESO QC SCIPOST POS[0-9]+ X",
193  CPL_TYPE_FLOAT,
194  "[pix] Position of source k in x-direction in output cube. If the FWHM measurement fails, this value will be -1.");
195  muse_processing_prepare_property(aHeader, "ESO QC SCIPOST POS[0-9]+ Y",
196  CPL_TYPE_FLOAT,
197  "[pix] Position of source k in y-direction in output cube. If the FWHM measurement fails, this value will be -1.");
198  muse_processing_prepare_property(aHeader, "ESO QC SCIPOST FWHM[0-9]+ X",
199  CPL_TYPE_FLOAT,
200  "[arcsec] FWHM of source k in x-direction in output cube. If the FWHM measurement fails, this value will be -1.");
201  muse_processing_prepare_property(aHeader, "ESO QC SCIPOST FWHM[0-9]+ Y",
202  CPL_TYPE_FLOAT,
203  "[arcsec] FWHM of source k in y-direction in output cube. If the FWHM measurement fails, this value will be -1.");
204  muse_processing_prepare_property(aHeader, "ESO QC SCIPOST FWHM NVALID",
205  CPL_TYPE_INT,
206  "Number of detected sources with valid FWHM in output cube.");
207  muse_processing_prepare_property(aHeader, "ESO QC SCIPOST FWHM MEDIAN",
208  CPL_TYPE_FLOAT,
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.");
210  muse_processing_prepare_property(aHeader, "ESO QC SCIPOST FWHM MAD",
211  CPL_TYPE_FLOAT,
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")) {
214  muse_processing_prepare_property(aHeader, "ESO QC SCIPOST POS[0-9]+ X",
215  CPL_TYPE_FLOAT,
216  "[pix] Position of source k in x-direction in combined frame");
217  muse_processing_prepare_property(aHeader, "ESO QC SCIPOST POS[0-9]+ Y",
218  CPL_TYPE_FLOAT,
219  "[pix] Position of source k in y-direction in combined frame");
220  muse_processing_prepare_property(aHeader, "ESO QC SCIPOST FWHM[0-9]+ X",
221  CPL_TYPE_FLOAT,
222  "[arcsec] FWHM of source k in x-direction in combined frame");
223  muse_processing_prepare_property(aHeader, "ESO QC SCIPOST FWHM[0-9]+ Y",
224  CPL_TYPE_FLOAT,
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")) {
231  muse_processing_prepare_property(aHeader, "ESO QC SCIPOST LOWLIMIT",
232  CPL_TYPE_DOUBLE,
233  "Low limit in the white light considered as sky, used to create this mask, everything lower are likely artifacts.");
234  muse_processing_prepare_property(aHeader, "ESO QC SCIPOST THRESHOLD",
235  CPL_TYPE_DOUBLE,
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")) {
239  muse_processing_prepare_property(aHeader, "ESO QC SCIPOST RAMAN SPATIAL XX",
240  CPL_TYPE_DOUBLE,
241  "2D Polynomial x^2 coefficient");
242  muse_processing_prepare_property(aHeader, "ESO QC SCIPOST RAMAN SPATIAL XY",
243  CPL_TYPE_DOUBLE,
244  "2D Polynomial xy coefficient");
245  muse_processing_prepare_property(aHeader, "ESO QC SCIPOST RAMAN SPATIAL YY",
246  CPL_TYPE_DOUBLE,
247  "2D Polynomial y^2 coefficient");
248  muse_processing_prepare_property(aHeader, "ESO QC SCIPOST RAMAN SPATIAL X",
249  CPL_TYPE_DOUBLE,
250  "2D Polynomial x coefficient");
251  muse_processing_prepare_property(aHeader, "ESO QC SCIPOST RAMAN SPATIAL Y",
252  CPL_TYPE_DOUBLE,
253  "2D Polynomial y coefficient");
254  muse_processing_prepare_property(aHeader, "ESO QC SCIPOST RAMAN FLUX O2",
255  CPL_TYPE_FLOAT,
256  "[erg/(s cm2 arcsec2)] Computed average Raman scattered flux in the O2 band (around 6484 Angstrom)");
257  muse_processing_prepare_property(aHeader, "ESO QC SCIPOST RAMAN FLUX N2",
258  CPL_TYPE_FLOAT,
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")) {
262  muse_processing_prepare_property(aHeader, "ESO QC SCIPOST LOWLIMIT",
263  CPL_TYPE_DOUBLE,
264  "Low limit in the white light considered as sky, used to create this mask, everything lower are likely artifacts.");
265  muse_processing_prepare_property(aHeader, "ESO QC SCIPOST THRESHOLD",
266  CPL_TYPE_DOUBLE,
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")) {
270  muse_processing_prepare_property(aHeader, "ESO QC SCIPOST LINE[0-9]+ NAME",
271  CPL_TYPE_STRING,
272  "Name of the strongest line in group l");
273  muse_processing_prepare_property(aHeader, "ESO QC SCIPOST LINE[0-9]+ AWAV",
274  CPL_TYPE_DOUBLE,
275  "[Angstrom] Wavelength (air) of the strongest line of group l");
276  muse_processing_prepare_property(aHeader, "ESO QC SCIPOST LINE[0-9]+ FLUX",
277  CPL_TYPE_DOUBLE,
278  "[erg/(s cm2 arcsec2)] Flux of the strongest line of group l");
279  } else if (!strcmp(aFrametag, "SKY_CONTINUUM")) {
280  muse_processing_prepare_property(aHeader, "ESO QC SCIPOST CONT FLUX",
281  CPL_TYPE_DOUBLE,
282  "[erg/(s cm2 arcsec2)] Total flux of the continuum");
283  muse_processing_prepare_property(aHeader, "ESO QC SCIPOST CONT MAXDEV",
284  CPL_TYPE_DOUBLE,
285  "[erg/(s cm2 arcsec2 Angstrom)] Maximum (absolute value) of the derivative of the continuum spectrum");
286  } else {
287  cpl_msg_warning(__func__, "Frame tag %s is not defined", aFrametag);
288  return CPL_ERROR_ILLEGAL_INPUT;
289  }
290  return CPL_ERROR_NONE;
291 } /* muse_scipost_prepare_header() */
292 
293 /*----------------------------------------------------------------------------*/
302 /*----------------------------------------------------------------------------*/
303 static cpl_frame_level
304 muse_scipost_get_frame_level(const char *aFrametag)
305 {
306  if (!aFrametag) {
307  return CPL_FRAME_LEVEL_NONE;
308  }
309  if (!strcmp(aFrametag, "DATACUBE_FINAL")) {
310  return CPL_FRAME_LEVEL_FINAL;
311  }
312  if (!strcmp(aFrametag, "IMAGE_FOV")) {
313  return CPL_FRAME_LEVEL_FINAL;
314  }
315  if (!strcmp(aFrametag, "OBJECT_RESAMPLED")) {
316  return CPL_FRAME_LEVEL_FINAL;
317  }
318  if (!strcmp(aFrametag, "PIXTABLE_REDUCED")) {
319  return CPL_FRAME_LEVEL_INTERMEDIATE;
320  }
321  if (!strcmp(aFrametag, "PIXTABLE_POSITIONED")) {
322  return CPL_FRAME_LEVEL_INTERMEDIATE;
323  }
324  if (!strcmp(aFrametag, "PIXTABLE_COMBINED")) {
325  return CPL_FRAME_LEVEL_INTERMEDIATE;
326  }
327  if (!strcmp(aFrametag, "AUTOCAL_MASK")) {
328  return CPL_FRAME_LEVEL_INTERMEDIATE;
329  }
330  if (!strcmp(aFrametag, "AUTOCAL_FACTORS")) {
331  return CPL_FRAME_LEVEL_INTERMEDIATE;
332  }
333  if (!strcmp(aFrametag, "RAMAN_IMAGES")) {
334  return CPL_FRAME_LEVEL_INTERMEDIATE;
335  }
336  if (!strcmp(aFrametag, "SKY_IMAGE")) {
337  return CPL_FRAME_LEVEL_INTERMEDIATE;
338  }
339  if (!strcmp(aFrametag, "SKY_MASK")) {
340  return CPL_FRAME_LEVEL_INTERMEDIATE;
341  }
342  if (!strcmp(aFrametag, "SKY_SPECTRUM")) {
343  return CPL_FRAME_LEVEL_INTERMEDIATE;
344  }
345  if (!strcmp(aFrametag, "SKY_LINES")) {
346  return CPL_FRAME_LEVEL_FINAL;
347  }
348  if (!strcmp(aFrametag, "SKY_CONTINUUM")) {
349  return CPL_FRAME_LEVEL_FINAL;
350  }
351  return CPL_FRAME_LEVEL_NONE;
352 } /* muse_scipost_get_frame_level() */
353 
354 /*----------------------------------------------------------------------------*/
363 /*----------------------------------------------------------------------------*/
364 static muse_frame_mode
365 muse_scipost_get_frame_mode(const char *aFrametag)
366 {
367  if (!aFrametag) {
368  return MUSE_FRAME_MODE_ALL;
369  }
370  if (!strcmp(aFrametag, "DATACUBE_FINAL")) {
371  return MUSE_FRAME_MODE_MASTER;
372  }
373  if (!strcmp(aFrametag, "IMAGE_FOV")) {
375  }
376  if (!strcmp(aFrametag, "OBJECT_RESAMPLED")) {
377  return MUSE_FRAME_MODE_MASTER;
378  }
379  if (!strcmp(aFrametag, "PIXTABLE_REDUCED")) {
381  }
382  if (!strcmp(aFrametag, "PIXTABLE_POSITIONED")) {
384  }
385  if (!strcmp(aFrametag, "PIXTABLE_COMBINED")) {
386  return MUSE_FRAME_MODE_MASTER;
387  }
388  if (!strcmp(aFrametag, "AUTOCAL_MASK")) {
390  }
391  if (!strcmp(aFrametag, "AUTOCAL_FACTORS")) {
393  }
394  if (!strcmp(aFrametag, "RAMAN_IMAGES")) {
396  }
397  if (!strcmp(aFrametag, "SKY_IMAGE")) {
399  }
400  if (!strcmp(aFrametag, "SKY_MASK")) {
402  }
403  if (!strcmp(aFrametag, "SKY_SPECTRUM")) {
405  }
406  if (!strcmp(aFrametag, "SKY_LINES")) {
408  }
409  if (!strcmp(aFrametag, "SKY_CONTINUUM")) {
411  }
412  return MUSE_FRAME_MODE_ALL;
413 } /* muse_scipost_get_frame_mode() */
414 
415 /*----------------------------------------------------------------------------*/
425 /*----------------------------------------------------------------------------*/
426 static int
427 muse_scipost_create(cpl_plugin *aPlugin)
428 {
429  /* Check that the plugin is part of a valid recipe */
430  cpl_recipe *recipe;
431  if (cpl_plugin_get_type(aPlugin) == CPL_PLUGIN_TYPE_RECIPE) {
432  recipe = (cpl_recipe *)aPlugin;
433  } else {
434  return -1;
435  }
436 
437  /* register the extended processing information (new FITS header creation, *
438  * getting of the frame level for a certain tag) */
440  muse_scipost_new_recipeconfig(),
441  muse_scipost_prepare_header,
442  muse_scipost_get_frame_level,
443  muse_scipost_get_frame_mode);
444 
445  /* XXX initialize timing in messages *
446  * since at least esorex is too stupid to turn it on, we have to do it */
448  cpl_msg_set_time_on();
449  }
450 
451  /* Create the parameter list in the cpl_recipe object */
452  recipe->parameters = cpl_parameterlist_new();
453  /* Fill the parameters list */
454  cpl_parameter *p;
455 
456  /* --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.
457  ("cube": output cube and associated images, if this is not given, no final resampling is done at all --
458  "autocal": up to two additional output products related to the slice autocalibration --
459  "raman": up to four additional output products about the Raman light distribution for AO observations --
460  "skymodel": up to four additional output products about the effectively used sky that was subtracted with the "model" method --
461  "individual": fully reduced pixel table for each individual exposure --
462  "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 --
463  "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 --
464  "stacked": an additional output file in form of a 2D column-stacked image, i.e. x direction is pseudo-spatial, y direction is wavelength.)
465  */
466  p = cpl_parameter_new_value("muse.muse_scipost.save",
467  CPL_TYPE_STRING,
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.)",
469  "muse.muse_scipost",
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");
473 
474  cpl_parameterlist_append(recipe->parameters, p);
475 
476  /* --resample: The resampling technique to use for the final output cube. */
477  p = cpl_parameter_new_enum("muse.muse_scipost.resample",
478  CPL_TYPE_STRING,
479  "The resampling technique to use for the final output cube.",
480  "muse.muse_scipost",
481  (const char *)"drizzle",
482  6,
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");
491 
492  cpl_parameterlist_append(recipe->parameters, p);
493 
494  /* --dx: 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. */
495  p = cpl_parameter_new_value("muse.muse_scipost.dx",
496  CPL_TYPE_DOUBLE,
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.",
498  "muse.muse_scipost",
499  (double)0.0);
500  cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CFG, "dx");
501  cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, "dx");
502 
503  cpl_parameterlist_append(recipe->parameters, p);
504 
505  /* --dy: 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. */
506  p = cpl_parameter_new_value("muse.muse_scipost.dy",
507  CPL_TYPE_DOUBLE,
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.",
509  "muse.muse_scipost",
510  (double)0.0);
511  cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CFG, "dy");
512  cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, "dy");
513 
514  cpl_parameterlist_append(recipe->parameters, p);
515 
516  /* --dlambda: Wavelength step size (in Angstrom). Natural instrument sampling is used, if this is 0.0 */
517  p = cpl_parameter_new_value("muse.muse_scipost.dlambda",
518  CPL_TYPE_DOUBLE,
519  "Wavelength step size (in Angstrom). Natural instrument sampling is used, if this is 0.0",
520  "muse.muse_scipost",
521  (double)0.0);
522  cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CFG, "dlambda");
523  cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, "dlambda");
524 
525  cpl_parameterlist_append(recipe->parameters, p);
526 
527  /* --crtype: 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. */
528  p = cpl_parameter_new_enum("muse.muse_scipost.crtype",
529  CPL_TYPE_STRING,
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.",
531  "muse.muse_scipost",
532  (const char *)"median",
533  3,
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");
539 
540  cpl_parameterlist_append(recipe->parameters, p);
541 
542  /* --crsigma: Sigma rejection factor to use for cosmic ray rejection during final resampling. A zero or negative value switches cosmic ray rejection off. */
543  p = cpl_parameter_new_value("muse.muse_scipost.crsigma",
544  CPL_TYPE_DOUBLE,
545  "Sigma rejection factor to use for cosmic ray rejection during final resampling. A zero or negative value switches cosmic ray rejection off.",
546  "muse.muse_scipost",
547  (double)15.);
548  cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CFG, "crsigma");
549  cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, "crsigma");
550 
551  cpl_parameterlist_append(recipe->parameters, p);
552 
553  /* --rc: Critical radius for the "renka" resampling method. */
554  p = cpl_parameter_new_value("muse.muse_scipost.rc",
555  CPL_TYPE_DOUBLE,
556  "Critical radius for the \"renka\" resampling method.",
557  "muse.muse_scipost",
558  (double)1.25);
559  cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CFG, "rc");
560  cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, "rc");
561 
562  cpl_parameterlist_append(recipe->parameters, p);
563 
564  /* --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. */
565  p = cpl_parameter_new_value("muse.muse_scipost.pixfrac",
566  CPL_TYPE_STRING,
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.",
568  "muse.muse_scipost",
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");
572 
573  cpl_parameterlist_append(recipe->parameters, p);
574 
575  /* --ld: Number of adjacent pixels to take into account during resampling in all three directions (loop distance); this affects all resampling methods except "nearest". */
576  p = cpl_parameter_new_value("muse.muse_scipost.ld",
577  CPL_TYPE_INT,
578  "Number of adjacent pixels to take into account during resampling in all three directions (loop distance); this affects all resampling methods except \"nearest\".",
579  "muse.muse_scipost",
580  (int)1);
581  cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CFG, "ld");
582  cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, "ld");
583 
584  cpl_parameterlist_append(recipe->parameters, p);
585 
586  /* --format: 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. */
587  p = cpl_parameter_new_enum("muse.muse_scipost.format",
588  CPL_TYPE_STRING,
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.",
590  "muse.muse_scipost",
591  (const char *)"Cube",
592  5,
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");
600 
601  cpl_parameterlist_append(recipe->parameters, p);
602 
603  /* --weight: 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. */
604  p = cpl_parameter_new_enum("muse.muse_scipost.weight",
605  CPL_TYPE_STRING,
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.",
607  "muse.muse_scipost",
608  (const char *)"exptime",
609  3,
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");
615 
616  cpl_parameterlist_append(recipe->parameters, p);
617 
618  /* --filter: 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. */
619  p = cpl_parameter_new_value("muse.muse_scipost.filter",
620  CPL_TYPE_STRING,
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.",
622  "muse.muse_scipost",
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");
626 
627  cpl_parameterlist_append(recipe->parameters, p);
628 
629  /* --autocalib: 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". */
630  p = cpl_parameter_new_enum("muse.muse_scipost.autocalib",
631  CPL_TYPE_STRING,
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\".",
633  "muse.muse_scipost",
634  (const char *)"none",
635  2,
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");
640 
641  cpl_parameterlist_append(recipe->parameters, p);
642 
643  /* --raman_width: Wavelength range around Raman lines [Angstrom]. */
644  p = cpl_parameter_new_value("muse.muse_scipost.raman_width",
645  CPL_TYPE_DOUBLE,
646  "Wavelength range around Raman lines [Angstrom].",
647  "muse.muse_scipost",
648  (double)20.);
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);
653  }
654 
655  cpl_parameterlist_append(recipe->parameters, p);
656 
657  /* --skymethod: The method used to subtract the sky background (spectrum).
658  Option "model" should work in all kinds of science fields: it uses a global sky spectrum model with a local LSF.
659  "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.
660  If SKY_CONTINUUM is given, it is directly subtracted, otherwise it is created from the sky region of the science exposure.
661  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.
662  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".
663  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.
664  */
665  p = cpl_parameter_new_enum("muse.muse_scipost.skymethod",
666  CPL_TYPE_STRING,
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.",
668  "muse.muse_scipost",
669  (const char *)"model",
670  4,
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");
677 
678  cpl_parameterlist_append(recipe->parameters, p);
679 
680  /* --lambdamin: Cut off the data below this wavelength after loading the pixel table(s). */
681  p = cpl_parameter_new_value("muse.muse_scipost.lambdamin",
682  CPL_TYPE_DOUBLE,
683  "Cut off the data below this wavelength after loading the pixel table(s).",
684  "muse.muse_scipost",
685  (double)4000.);
686  cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CFG, "lambdamin");
687  cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, "lambdamin");
688 
689  cpl_parameterlist_append(recipe->parameters, p);
690 
691  /* --lambdamax: Cut off the data above this wavelength after loading the pixel table(s). */
692  p = cpl_parameter_new_value("muse.muse_scipost.lambdamax",
693  CPL_TYPE_DOUBLE,
694  "Cut off the data above this wavelength after loading the pixel table(s).",
695  "muse.muse_scipost",
696  (double)10000.);
697  cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CFG, "lambdamax");
698  cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, "lambdamax");
699 
700  cpl_parameterlist_append(recipe->parameters, p);
701 
702  /* --lambdaref: 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. */
703  p = cpl_parameter_new_value("muse.muse_scipost.lambdaref",
704  CPL_TYPE_DOUBLE,
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.",
706  "muse.muse_scipost",
707  (double)7000.);
708  cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CFG, "lambdaref");
709  cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, "lambdaref");
710 
711  cpl_parameterlist_append(recipe->parameters, p);
712 
713  /* --darcheck: Carry out a check of the theoretical DAR correction using source centroiding. If "correct" it will also apply an empirical correction. */
714  p = cpl_parameter_new_enum("muse.muse_scipost.darcheck",
715  CPL_TYPE_STRING,
716  "Carry out a check of the theoretical DAR correction using source centroiding. If \"correct\" it will also apply an empirical correction.",
717  "muse.muse_scipost",
718  (const char *)"none",
719  3,
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");
725 
726  cpl_parameterlist_append(recipe->parameters, p);
727 
728  /* --skymodel_fraction: 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. */
729  p = cpl_parameter_new_value("muse.muse_scipost.skymodel_fraction",
730  CPL_TYPE_DOUBLE,
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.",
732  "muse.muse_scipost",
733  (double)0.10);
734  cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CFG, "skymodel_fraction");
735  cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, "skymodel_fraction");
736 
737  cpl_parameterlist_append(recipe->parameters, p);
738 
739  /* --skymodel_ignore: 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. */
740  p = cpl_parameter_new_value("muse.muse_scipost.skymodel_ignore",
741  CPL_TYPE_DOUBLE,
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.",
743  "muse.muse_scipost",
744  (double)0.05);
745  cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CFG, "skymodel_ignore");
746  cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, "skymodel_ignore");
747 
748  cpl_parameterlist_append(recipe->parameters, p);
749 
750  /* --skymodel_sampling: Spectral sampling of the sky spectrum [Angstrom]. */
751  p = cpl_parameter_new_value("muse.muse_scipost.skymodel_sampling",
752  CPL_TYPE_DOUBLE,
753  "Spectral sampling of the sky spectrum [Angstrom].",
754  "muse.muse_scipost",
755  (double)0.3125);
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);
760  }
761 
762  cpl_parameterlist_append(recipe->parameters, p);
763 
764  /* --skymodel_csampling: Spectral sampling of the continuum spectrum [Angstrom]. */
765  p = cpl_parameter_new_value("muse.muse_scipost.skymodel_csampling",
766  CPL_TYPE_DOUBLE,
767  "Spectral sampling of the continuum spectrum [Angstrom].",
768  "muse.muse_scipost",
769  (double)0.3125);
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);
774  }
775 
776  cpl_parameterlist_append(recipe->parameters, p);
777 
778  /* --sky_crsigma: 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. */
779  p = cpl_parameter_new_value("muse.muse_scipost.sky_crsigma",
780  CPL_TYPE_STRING,
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.",
782  "muse.muse_scipost",
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);
788  }
789 
790  cpl_parameterlist_append(recipe->parameters, p);
791 
792  /* --rvcorr: 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). */
793  p = cpl_parameter_new_enum("muse.muse_scipost.rvcorr",
794  CPL_TYPE_STRING,
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).",
796  "muse.muse_scipost",
797  (const char *)"bary",
798  4,
799  (const char *)"bary",
800  (const char *)"helio",
801  (const char *)"geo",
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");
805 
806  cpl_parameterlist_append(recipe->parameters, p);
807 
808  /* --astrometry: 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. */
809  p = cpl_parameter_new_value("muse.muse_scipost.astrometry",
810  CPL_TYPE_BOOL,
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.",
812  "muse.muse_scipost",
813  (int)TRUE);
814  cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CFG, "astrometry");
815  cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, "astrometry");
816 
817  cpl_parameterlist_append(recipe->parameters, p);
818 
819  return 0;
820 } /* muse_scipost_create() */
821 
822 /*----------------------------------------------------------------------------*/
833 /*----------------------------------------------------------------------------*/
834 static int
835 muse_scipost_params_fill(muse_scipost_params_t *aParams, cpl_parameterlist *aParameters)
836 {
837  cpl_ensure_code(aParams, CPL_ERROR_NULL_INPUT);
838  cpl_ensure_code(aParameters, CPL_ERROR_NULL_INPUT);
839  cpl_parameter *p;
840 
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);
844 
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);
848  aParams->resample =
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);
858 
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);
862 
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);
866 
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);
870 
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);
874  aParams->crtype =
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);
881 
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);
885 
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);
889 
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);
893 
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);
897 
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);
901  aParams->format =
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);
910 
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);
914  aParams->weight =
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);
921 
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);
925 
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);
929  aParams->autocalib =
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);
935 
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);
939 
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);
943  aParams->skymethod =
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);
951 
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);
955 
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);
959 
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);
963 
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);
967  aParams->darcheck =
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);
974 
975  p = cpl_parameterlist_find(aParameters, "muse.muse_scipost.skymodel_fraction");
976  cpl_ensure_code(p, CPL_ERROR_DATA_NOT_FOUND);
977  aParams->skymodel_fraction = cpl_parameter_get_double(p);
978 
979  p = cpl_parameterlist_find(aParameters, "muse.muse_scipost.skymodel_ignore");
980  cpl_ensure_code(p, CPL_ERROR_DATA_NOT_FOUND);
981  aParams->skymodel_ignore = cpl_parameter_get_double(p);
982 
983  p = cpl_parameterlist_find(aParameters, "muse.muse_scipost.skymodel_sampling");
984  cpl_ensure_code(p, CPL_ERROR_DATA_NOT_FOUND);
985  aParams->skymodel_sampling = cpl_parameter_get_double(p);
986 
987  p = cpl_parameterlist_find(aParameters, "muse.muse_scipost.skymodel_csampling");
988  cpl_ensure_code(p, CPL_ERROR_DATA_NOT_FOUND);
989  aParams->skymodel_csampling = cpl_parameter_get_double(p);
990 
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);
994 
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);
998  aParams->rvcorr =
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);
1006 
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);
1010 
1011  return 0;
1012 } /* muse_scipost_params_fill() */
1013 
1014 /*----------------------------------------------------------------------------*/
1021 /*----------------------------------------------------------------------------*/
1022 static int
1023 muse_scipost_exec(cpl_plugin *aPlugin)
1024 {
1025  if (cpl_plugin_get_type(aPlugin) != CPL_PLUGIN_TYPE_RECIPE) {
1026  return -1;
1027  }
1028  muse_processing_recipeinfo(aPlugin);
1029  cpl_recipe *recipe = (cpl_recipe *)aPlugin;
1030  cpl_msg_set_threadid_on();
1031 
1032  cpl_frameset *usedframes = cpl_frameset_new(),
1033  *outframes = cpl_frameset_new();
1034  muse_scipost_params_t params;
1035  muse_scipost_params_fill(&params, recipe->parameters);
1036 
1037  cpl_errorstate prestate = cpl_errorstate_get();
1038 
1039  muse_processing *proc = muse_processing_new("muse_scipost",
1040  recipe);
1041  int rc = muse_scipost_compute(proc, &params);
1042  cpl_frameset_join(usedframes, proc->usedframes);
1043  cpl_frameset_join(outframes, proc->outframes);
1044  muse_processing_delete(proc);
1045 
1046  if (!cpl_errorstate_is_equal(prestate)) {
1047  /* dump all errors from this recipe in chronological order */
1048  cpl_errorstate_dump(prestate, CPL_FALSE, muse_cplerrorstate_dump_some);
1049  /* reset message level to not get the same errors displayed again by esorex */
1050  cpl_msg_set_level(CPL_MSG_INFO);
1051  }
1052  /* clean up duplicates in framesets of used and output frames */
1055 
1056  /* to get esorex to see our classification (frame groups etc.), *
1057  * replace the original frameset with the list of used frames *
1058  * before appending product output frames */
1059  /* keep the same pointer, so just erase all frames, not delete the frameset */
1060  muse_cplframeset_erase_all(recipe->frames);
1061  cpl_frameset_join(recipe->frames, usedframes);
1062  cpl_frameset_join(recipe->frames, outframes);
1063  cpl_frameset_delete(usedframes);
1064  cpl_frameset_delete(outframes);
1065  return rc;
1066 } /* muse_scipost_exec() */
1067 
1068 /*----------------------------------------------------------------------------*/
1075 /*----------------------------------------------------------------------------*/
1076 static int
1077 muse_scipost_destroy(cpl_plugin *aPlugin)
1078 {
1079  /* Get the recipe from the plugin */
1080  cpl_recipe *recipe;
1081  if (cpl_plugin_get_type(aPlugin) == CPL_PLUGIN_TYPE_RECIPE) {
1082  recipe = (cpl_recipe *)aPlugin;
1083  } else {
1084  return -1;
1085  }
1086 
1087  /* Clean up */
1088  cpl_parameterlist_delete(recipe->parameters);
1090  return 0;
1091 } /* muse_scipost_destroy() */
1092 
1093 /*----------------------------------------------------------------------------*/
1103 /*----------------------------------------------------------------------------*/
1104 int
1105 cpl_plugin_get_info(cpl_pluginlist *aList)
1106 {
1107  cpl_recipe *recipe = cpl_calloc(1, sizeof *recipe);
1108  cpl_plugin *plugin = &recipe->interface;
1109 
1110  char *helptext;
1112  helptext = cpl_sprintf("%s%s", muse_scipost_help,
1113  muse_scipost_help_esorex);
1114  } else {
1115  helptext = cpl_sprintf("%s", muse_scipost_help);
1116  }
1117 
1118  /* Initialize the CPL plugin stuff for this module */
1119  cpl_plugin_init(plugin, CPL_PLUGIN_API, MUSE_BINARY_VERSION,
1120  CPL_PLUGIN_TYPE_RECIPE,
1121  "muse_scipost",
1122  "Prepare reduced and combined science products.",
1123  helptext,
1124  "Peter Weilbacher",
1125  "usd-help@eso.org",
1126  muse_get_license(),
1127  muse_scipost_create,
1128  muse_scipost_exec,
1129  muse_scipost_destroy);
1130  cpl_pluginlist_append(aList, plugin);
1131  cpl_free(helptext);
1132 
1133  return 0;
1134 } /* cpl_plugin_get_info() */
1135 
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.
Definition: muse_utils.c:83
muse_frame_mode
double dy
Vertical step size for resampling (in arcsec or pixel). The following defaults are taken when this va...
cpl_frameset * outframes
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.)