35 #include "muse_flat_z.h"
75 static const char *muse_flat_help =
76 "This recipe combines several separate flat-field images into one master flat-field file and traces the location of the slices on the CCD. The master flat contains the combined pixel values of the raw flat exposures, with respect to the image combination method used, normalized to the mean flux. The trace table contains polynomials defining the location of the slices on the CCD. Processing trims the raw data and records the overscan statistics, subtracts the bias (taking account of the overscan, if --overscan is not &none&), and optionally, the dark from each raw input image, converts them from adu to count, scales them according to their exposure time, and combines the exposures using input parameters. To trace the position of the slices on the CCD, their edges are located using a threshold method. The edge detection is repeated at given intervals thereby tracing the central position (the mean of both edges) and width of each slit vertically across the CCD. Deviant positions of detections on CCD rows can be detected and excluded before fitting a polynomial to all positions measured for one slice. The polynomial parameters for each slice are saved in the output trace table. Finally, the area between the now known slice edges is searched for dark (and bright) pixels, using statistics in each row of the master flat.";
78 static const char *muse_flat_help_esorex =
79 "\n\nInput frames for raw frame tag \"FLAT\":\n"
80 "\n Frame tag Type Req #Fr Description"
81 "\n -------------------- ---- --- --- ------------"
82 "\n FLAT raw Y >=3 Raw flat"
83 "\n MASTER_BIAS calib Y 1 Master bias"
84 "\n MASTER_DARK calib . 1 Master dark"
85 "\n BADPIX_TABLE calib . 1 Bad pixel table"
86 "\n\nProduct frames for raw frame tag \"FLAT\":\n"
87 "\n Frame tag Level Description"
88 "\n -------------------- -------- ------------"
89 "\n MASTER_FLAT final Master flat"
90 "\n TRACE_TABLE final Tracing table for all slices"
91 "\n TRACE_SAMPLES final Table containing all tracing sample points, if --samples=true";
102 static cpl_recipeconfig *
103 muse_flat_new_recipeconfig(
void)
105 cpl_recipeconfig *recipeconfig = cpl_recipeconfig_new();
109 cpl_recipeconfig_set_tag(recipeconfig, tag, 3, -1);
110 cpl_recipeconfig_set_input(recipeconfig, tag,
"MASTER_BIAS", 1, 1);
111 cpl_recipeconfig_set_input(recipeconfig, tag,
"MASTER_DARK", -1, 1);
112 cpl_recipeconfig_set_input(recipeconfig, tag,
"BADPIX_TABLE", -1, 1);
113 cpl_recipeconfig_set_output(recipeconfig, tag,
"MASTER_FLAT");
114 cpl_recipeconfig_set_output(recipeconfig, tag,
"TRACE_TABLE");
115 cpl_recipeconfig_set_output(recipeconfig, tag,
"TRACE_SAMPLES");
131 static cpl_error_code
132 muse_flat_prepare_header(
const char *aFrametag, cpl_propertylist *aHeader)
134 cpl_ensure_code(aFrametag, CPL_ERROR_NULL_INPUT);
135 cpl_ensure_code(aHeader, CPL_ERROR_NULL_INPUT);
136 if (!strcmp(aFrametag,
"MASTER_FLAT")) {
139 "Median value of raw flat i in input list");
142 "Mean value of raw flat i in input list");
145 "Standard deviation of raw flat i in input list");
148 "Minimum value of raw flat i in input list");
151 "Maximum value of raw flat i in input list");
154 "Number of saturated pixels in raw flat i in input list");
157 "Median value of the master flat before normalization");
160 "Mean value of the master flat before normalization");
163 "Standard deviation of the master flat before normalization");
166 "Minimum value of the master flat before normalization");
169 "Maximum value of the master flat before normalization");
172 "Flux value, integrated over the whole master flat field before normalization");
175 "Number of saturated pixels in output data");
178 "Mean value around the vertical center of slice j before normalization");
181 "Standard deviation around the vertical center of slice j before normalization");
182 }
else if (!strcmp(aFrametag,
"TRACE_TABLE")) {
185 "[pix] Location of midpoint of leftmost slice");
188 "[deg] Tilt of leftmost slice, measured as angle from vertical direction");
191 "[pix] Location of midpoint of rightmost slice");
194 "[deg] Tilt of rightmost slice, measured as angle from vertical direction");
197 "The maximum slope of the derived tracing functions of slice j within the CCD.");
200 "[pix] Median width of slices");
203 "[pix] Mean width of slices");
206 "[pix] Standard deviation of widths of slices");
209 "[pix] Minimum width of slices");
212 "[pix] Maximum width of slices");
215 "[pix] Median of gaps between slices");
218 "[pix] Mean of gaps between slices");
221 "[pix] Standard deviation of gaps between slices");
224 "[pix] Minimum of gap between slices");
227 "[pix] Maximum gap between slices");
228 }
else if (!strcmp(aFrametag,
"TRACE_SAMPLES")) {
230 cpl_msg_warning(__func__,
"Frame tag %s is not defined", aFrametag);
231 return CPL_ERROR_ILLEGAL_INPUT;
233 return CPL_ERROR_NONE;
246 static cpl_frame_level
247 muse_flat_get_frame_level(
const char *aFrametag)
250 return CPL_FRAME_LEVEL_NONE;
252 if (!strcmp(aFrametag,
"MASTER_FLAT")) {
253 return CPL_FRAME_LEVEL_FINAL;
255 if (!strcmp(aFrametag,
"TRACE_TABLE")) {
256 return CPL_FRAME_LEVEL_FINAL;
258 if (!strcmp(aFrametag,
"TRACE_SAMPLES")) {
259 return CPL_FRAME_LEVEL_FINAL;
261 return CPL_FRAME_LEVEL_NONE;
275 muse_flat_get_frame_mode(
const char *aFrametag)
280 if (!strcmp(aFrametag,
"MASTER_FLAT")) {
283 if (!strcmp(aFrametag,
"TRACE_TABLE")) {
286 if (!strcmp(aFrametag,
"TRACE_SAMPLES")) {
304 muse_flat_create(cpl_plugin *aPlugin)
308 if (cpl_plugin_get_type(aPlugin) == CPL_PLUGIN_TYPE_RECIPE) {
309 recipe = (cpl_recipe *)aPlugin;
317 muse_flat_new_recipeconfig(),
318 muse_flat_prepare_header,
319 muse_flat_get_frame_level,
320 muse_flat_get_frame_mode);
325 cpl_msg_set_time_on();
329 recipe->parameters = cpl_parameterlist_new();
334 p = cpl_parameter_new_range(
"muse.muse_flat.nifu",
336 "IFU to handle. If set to 0, all IFUs are processed serially. If set to -1, all IFUs are processed in parallel.",
341 cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CFG,
"nifu");
342 cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,
"nifu");
344 cpl_parameterlist_append(recipe->parameters, p);
347 p = cpl_parameter_new_value(
"muse.muse_flat.overscan",
349 "If this is \"none\", stop when detecting discrepant overscan levels (see ovscsigma), for \"offset\" it assumes that the mean overscan level represents the real offset in the bias levels of the exposures involved, and adjusts the data accordingly; for \"vpoly\", a polynomial is fit to the vertical overscan and subtracted from the whole quadrant.",
351 (
const char *)
"vpoly");
352 cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CFG,
"overscan");
353 cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,
"overscan");
355 cpl_parameterlist_append(recipe->parameters, p);
358 p = cpl_parameter_new_value(
"muse.muse_flat.ovscreject",
360 "This influences how values are rejected when computing overscan statistics. Either no rejection at all (\"none\"), rejection using the DCR algorithm (\"dcr\"), or rejection using an iterative constant fit (\"fit\").",
362 (
const char *)
"dcr");
363 cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CFG,
"ovscreject");
364 cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,
"ovscreject");
366 cpl_parameterlist_append(recipe->parameters, p);
369 p = cpl_parameter_new_value(
"muse.muse_flat.ovscsigma",
371 "If the deviation of mean overscan levels between a raw input image and the reference image is higher than |ovscsigma x stdev|, stop the processing. If overscan=\"vpoly\", this is used as sigma rejection level for the iterative polynomial fit. Has no effect for overscan=\"offset\".",
374 cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CFG,
"ovscsigma");
375 cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,
"ovscsigma");
377 cpl_parameterlist_append(recipe->parameters, p);
380 p = cpl_parameter_new_value(
"muse.muse_flat.ovscignore",
382 "The number of pixels of the overscan adjacent to the data region of the CCD that are ignored when computing statistics or fits.",
385 cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CFG,
"ovscignore");
386 cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,
"ovscignore");
388 cpl_parameterlist_append(recipe->parameters, p);
391 p = cpl_parameter_new_enum(
"muse.muse_flat.combine",
393 "Type of combination to use",
395 (
const char *)
"sigclip",
397 (
const char *)
"average",
398 (
const char *)
"median",
399 (
const char *)
"minmax",
400 (
const char *)
"sigclip");
401 cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CFG,
"combine");
402 cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,
"combine");
404 cpl_parameterlist_append(recipe->parameters, p);
407 p = cpl_parameter_new_value(
"muse.muse_flat.nlow",
409 "Number of minimum pixels to reject with minmax",
412 cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CFG,
"nlow");
413 cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,
"nlow");
415 cpl_parameterlist_append(recipe->parameters, p);
418 p = cpl_parameter_new_value(
"muse.muse_flat.nhigh",
420 "Number of maximum pixels to reject with minmax",
423 cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CFG,
"nhigh");
424 cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,
"nhigh");
426 cpl_parameterlist_append(recipe->parameters, p);
429 p = cpl_parameter_new_value(
"muse.muse_flat.nkeep",
431 "Number of pixels to keep with minmax",
434 cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CFG,
"nkeep");
435 cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,
"nkeep");
437 cpl_parameterlist_append(recipe->parameters, p);
440 p = cpl_parameter_new_value(
"muse.muse_flat.lsigma",
442 "Low sigma for pixel rejection with sigclip",
445 cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CFG,
"lsigma");
446 cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,
"lsigma");
448 cpl_parameterlist_append(recipe->parameters, p);
451 p = cpl_parameter_new_value(
"muse.muse_flat.hsigma",
453 "High sigma for pixel rejection with sigclip",
456 cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CFG,
"hsigma");
457 cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,
"hsigma");
459 cpl_parameterlist_append(recipe->parameters, p);
462 p = cpl_parameter_new_value(
"muse.muse_flat.scale",
464 "Scale the individual images to a common exposure time before combining them.",
467 cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CFG,
"scale");
468 cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,
"scale");
470 cpl_parameterlist_append(recipe->parameters, p);
473 p = cpl_parameter_new_value(
"muse.muse_flat.normalize",
475 "Normalize the master flat to the average flux",
478 cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CFG,
"normalize");
479 cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,
"normalize");
481 cpl_parameterlist_append(recipe->parameters, p);
484 p = cpl_parameter_new_value(
"muse.muse_flat.trace",
486 "Trace the position of the slices on the master flat",
489 cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CFG,
"trace");
490 cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,
"trace");
492 cpl_parameterlist_append(recipe->parameters, p);
495 p = cpl_parameter_new_value(
"muse.muse_flat.nsum",
497 "Number of lines over which to average when tracing",
500 cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CFG,
"nsum");
501 cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,
"nsum");
503 cpl_parameterlist_append(recipe->parameters, p);
506 p = cpl_parameter_new_value(
"muse.muse_flat.order",
508 "Order of polynomial fit to the trace",
511 cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CFG,
"order");
512 cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,
"order");
514 cpl_parameterlist_append(recipe->parameters, p);
517 p = cpl_parameter_new_value(
"muse.muse_flat.edgefrac",
519 "Fractional change required to identify edge when tracing",
522 cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CFG,
"edgefrac");
523 cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,
"edgefrac");
525 cpl_parameterlist_append(recipe->parameters, p);
528 p = cpl_parameter_new_value(
"muse.muse_flat.losigmabadpix",
530 "Low sigma to find dark pixels in the master flat",
533 cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CFG,
"losigmabadpix");
534 cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,
"losigmabadpix");
536 cpl_parameterlist_append(recipe->parameters, p);
539 p = cpl_parameter_new_value(
"muse.muse_flat.hisigmabadpix",
541 "High sigma to find bright pixels in the master flat",
544 cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CFG,
"hisigmabadpix");
545 cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,
"hisigmabadpix");
547 cpl_parameterlist_append(recipe->parameters, p);
550 p = cpl_parameter_new_value(
"muse.muse_flat.samples",
552 "Create a table containing all tracing sample points.",
555 cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CFG,
"samples");
556 cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,
"samples");
558 cpl_parameterlist_append(recipe->parameters, p);
578 cpl_ensure_code(aParams, CPL_ERROR_NULL_INPUT);
579 cpl_ensure_code(aParameters, CPL_ERROR_NULL_INPUT);
582 p = cpl_parameterlist_find(aParameters,
"muse.muse_flat.nifu");
583 cpl_ensure_code(p, CPL_ERROR_DATA_NOT_FOUND);
584 aParams->
nifu = cpl_parameter_get_int(p);
586 p = cpl_parameterlist_find(aParameters,
"muse.muse_flat.overscan");
587 cpl_ensure_code(p, CPL_ERROR_DATA_NOT_FOUND);
588 aParams->
overscan = cpl_parameter_get_string(p);
590 p = cpl_parameterlist_find(aParameters,
"muse.muse_flat.ovscreject");
591 cpl_ensure_code(p, CPL_ERROR_DATA_NOT_FOUND);
592 aParams->
ovscreject = cpl_parameter_get_string(p);
594 p = cpl_parameterlist_find(aParameters,
"muse.muse_flat.ovscsigma");
595 cpl_ensure_code(p, CPL_ERROR_DATA_NOT_FOUND);
596 aParams->
ovscsigma = cpl_parameter_get_double(p);
598 p = cpl_parameterlist_find(aParameters,
"muse.muse_flat.ovscignore");
599 cpl_ensure_code(p, CPL_ERROR_DATA_NOT_FOUND);
600 aParams->
ovscignore = cpl_parameter_get_int(p);
602 p = cpl_parameterlist_find(aParameters,
"muse.muse_flat.combine");
603 cpl_ensure_code(p, CPL_ERROR_DATA_NOT_FOUND);
604 aParams->
combine_s = cpl_parameter_get_string(p);
606 (!strcasecmp(aParams->
combine_s,
"average")) ? MUSE_FLAT_PARAM_COMBINE_AVERAGE :
607 (!strcasecmp(aParams->
combine_s,
"median")) ? MUSE_FLAT_PARAM_COMBINE_MEDIAN :
608 (!strcasecmp(aParams->
combine_s,
"minmax")) ? MUSE_FLAT_PARAM_COMBINE_MINMAX :
609 (!strcasecmp(aParams->
combine_s,
"sigclip")) ? MUSE_FLAT_PARAM_COMBINE_SIGCLIP :
610 MUSE_FLAT_PARAM_COMBINE_INVALID_VALUE;
611 cpl_ensure_code(aParams->
combine != MUSE_FLAT_PARAM_COMBINE_INVALID_VALUE,
612 CPL_ERROR_ILLEGAL_INPUT);
614 p = cpl_parameterlist_find(aParameters,
"muse.muse_flat.nlow");
615 cpl_ensure_code(p, CPL_ERROR_DATA_NOT_FOUND);
616 aParams->
nlow = cpl_parameter_get_int(p);
618 p = cpl_parameterlist_find(aParameters,
"muse.muse_flat.nhigh");
619 cpl_ensure_code(p, CPL_ERROR_DATA_NOT_FOUND);
620 aParams->
nhigh = cpl_parameter_get_int(p);
622 p = cpl_parameterlist_find(aParameters,
"muse.muse_flat.nkeep");
623 cpl_ensure_code(p, CPL_ERROR_DATA_NOT_FOUND);
624 aParams->
nkeep = cpl_parameter_get_int(p);
626 p = cpl_parameterlist_find(aParameters,
"muse.muse_flat.lsigma");
627 cpl_ensure_code(p, CPL_ERROR_DATA_NOT_FOUND);
628 aParams->
lsigma = cpl_parameter_get_double(p);
630 p = cpl_parameterlist_find(aParameters,
"muse.muse_flat.hsigma");
631 cpl_ensure_code(p, CPL_ERROR_DATA_NOT_FOUND);
632 aParams->
hsigma = cpl_parameter_get_double(p);
634 p = cpl_parameterlist_find(aParameters,
"muse.muse_flat.scale");
635 cpl_ensure_code(p, CPL_ERROR_DATA_NOT_FOUND);
636 aParams->
scale = cpl_parameter_get_bool(p);
638 p = cpl_parameterlist_find(aParameters,
"muse.muse_flat.normalize");
639 cpl_ensure_code(p, CPL_ERROR_DATA_NOT_FOUND);
640 aParams->
normalize = cpl_parameter_get_bool(p);
642 p = cpl_parameterlist_find(aParameters,
"muse.muse_flat.trace");
643 cpl_ensure_code(p, CPL_ERROR_DATA_NOT_FOUND);
644 aParams->
trace = cpl_parameter_get_bool(p);
646 p = cpl_parameterlist_find(aParameters,
"muse.muse_flat.nsum");
647 cpl_ensure_code(p, CPL_ERROR_DATA_NOT_FOUND);
648 aParams->
nsum = cpl_parameter_get_int(p);
650 p = cpl_parameterlist_find(aParameters,
"muse.muse_flat.order");
651 cpl_ensure_code(p, CPL_ERROR_DATA_NOT_FOUND);
652 aParams->
order = cpl_parameter_get_int(p);
654 p = cpl_parameterlist_find(aParameters,
"muse.muse_flat.edgefrac");
655 cpl_ensure_code(p, CPL_ERROR_DATA_NOT_FOUND);
656 aParams->
edgefrac = cpl_parameter_get_double(p);
658 p = cpl_parameterlist_find(aParameters,
"muse.muse_flat.losigmabadpix");
659 cpl_ensure_code(p, CPL_ERROR_DATA_NOT_FOUND);
662 p = cpl_parameterlist_find(aParameters,
"muse.muse_flat.hisigmabadpix");
663 cpl_ensure_code(p, CPL_ERROR_DATA_NOT_FOUND);
666 p = cpl_parameterlist_find(aParameters,
"muse.muse_flat.samples");
667 cpl_ensure_code(p, CPL_ERROR_DATA_NOT_FOUND);
668 aParams->
samples = cpl_parameter_get_bool(p);
682 muse_flat_exec(cpl_plugin *aPlugin)
684 if (cpl_plugin_get_type(aPlugin) != CPL_PLUGIN_TYPE_RECIPE) {
687 cpl_recipe *recipe = (cpl_recipe *)aPlugin;
688 cpl_msg_set_threadid_on();
690 cpl_frameset *usedframes = cpl_frameset_new(),
691 *outframes = cpl_frameset_new();
693 muse_flat_params_fill(¶ms, recipe->parameters);
695 cpl_errorstate prestate = cpl_errorstate_get();
697 if (params.
nifu < -1 || params.
nifu > kMuseNumIFUs) {
698 cpl_msg_error(__func__,
"Please specify a valid IFU number (between 1 and "
699 "%d), 0 (to process all IFUs consecutively), or -1 (to "
700 "process all IFUs in parallel) using --nifu.", kMuseNumIFUs);
705 if (params.
nifu > 0) {
708 rc = muse_flat_compute(proc, ¶ms);
709 cpl_frameset_join(usedframes, proc->
usedFrames);
712 }
else if (params.
nifu < 0) {
713 int *rcs = cpl_calloc(kMuseNumIFUs,
sizeof(
int));
715 #pragma omp parallel for default(none) \
716 shared(outframes, params, rcs, recipe, usedframes)
717 for (nifu = 1; nifu <= kMuseNumIFUs; nifu++) {
723 int *rci = rcs + (nifu - 1);
724 *rci = muse_flat_compute(proc, pars);
725 if (rci && cpl_error_get_code() == MUSE_ERROR_CHIP_NOT_LIVE) {
729 #pragma omp critical(muse_processing_used_frames)
730 cpl_frameset_join(usedframes, proc->
usedFrames);
731 #pragma omp critical(muse_processing_output_frames)
737 for (nifu = 1; nifu <= kMuseNumIFUs; nifu++) {
738 if (rcs[nifu-1] != 0) {
744 for (params.
nifu = 1; params.
nifu <= kMuseNumIFUs && !rc; params.
nifu++) {
747 rc = muse_flat_compute(proc, ¶ms);
748 if (rc && cpl_error_get_code() == MUSE_ERROR_CHIP_NOT_LIVE) {
751 cpl_frameset_join(usedframes, proc->
usedFrames);
757 if (!cpl_errorstate_is_equal(prestate)) {
761 cpl_msg_set_level(CPL_MSG_INFO);
771 cpl_frameset_join(recipe->frames, usedframes);
772 cpl_frameset_join(recipe->frames, outframes);
773 cpl_frameset_delete(usedframes);
774 cpl_frameset_delete(outframes);
787 muse_flat_destroy(cpl_plugin *aPlugin)
791 if (cpl_plugin_get_type(aPlugin) == CPL_PLUGIN_TYPE_RECIPE) {
792 recipe = (cpl_recipe *)aPlugin;
798 cpl_parameterlist_delete(recipe->parameters);
815 cpl_plugin_get_info(cpl_pluginlist *aList)
817 cpl_recipe *recipe = cpl_calloc(1,
sizeof *recipe);
818 cpl_plugin *plugin = &recipe->interface;
822 helptext = cpl_sprintf(
"%s%s", muse_flat_help,
823 muse_flat_help_esorex);
825 helptext = cpl_sprintf(
"%s", muse_flat_help);
829 cpl_plugin_init(plugin, CPL_PLUGIN_API, MUSE_BINARY_VERSION,
830 CPL_PLUGIN_TYPE_RECIPE,
832 "Combine several separate flat images into one master flat file, trace slice locations, and locate dark pixels.",
834 "Peter Weilbacher (based on Joris Gerssen's draft)",
840 cpl_pluginlist_append(aList, plugin);
int nifu
IFU to handle. If set to 0, all IFUs are processed serially. If set to -1, all IFUs are processed in ...
void muse_processing_delete(muse_processing *aProcessing)
Free the muse_processing structure.
int order
Order of polynomial fit to the trace.
double lsigma
Low sigma for pixel rejection with sigclip.
int scale
Scale the individual images to a common exposure time before combining them.
muse_cplframework_type muse_cplframework(void)
Return the CPL framework the recipe is run under.
double ovscsigma
If the deviation of mean overscan levels between a raw input image and the reference image is higher ...
int normalize
Normalize the master flat to the average flux.
Structure to hold the parameters of the muse_flat recipe.
int combine
Type of combination to use.
const char * muse_get_license(void)
Get the pipeline copyright and license.
muse_processing * muse_processing_new(const char *aRecipeName, cpl_recipe *aRecipe)
Create a new processing structure.
int nsum
Number of lines over which to average when tracing.
const char * ovscreject
This influences how values are rejected when computing overscan statistics. Either no rejection at al...
int samples
Create a table containing all tracing sample points.
int nkeep
Number of pixels to keep with minmax.
cpl_frameset * outputFrames
void muse_cplerrorstate_dump_some(unsigned aCurrent, unsigned aFirst, unsigned aLast)
Dump some CPL errors.
void muse_processinginfo_delete(cpl_recipe *)
Clear all information from the processing info and from the recipe config.
int nlow
Number of minimum pixels to reject with minmax.
int ovscignore
The number of pixels of the overscan adjacent to the data region of the CCD that are ignored when com...
const char * overscan
If this is "none", stop when detecting discrepant overscan levels (see ovscsigma), for "offset" it assumes that the mean overscan level represents the real offset in the bias levels of the exposures involved, and adjusts the data accordingly; for "vpoly", a polynomial is fit to the vertical overscan and subtracted from the whole quadrant.
cpl_error_code muse_cplframeset_erase_duplicate(cpl_frameset *aFrames)
Erase all duplicate frames from a frameset.
double edgefrac
Fractional change required to identify edge when tracing.
cpl_error_code muse_cplframeset_erase_all(cpl_frameset *aFrames)
Erase all frames in a frameset.
double losigmabadpix
Low sigma to find dark pixels in the master flat.
double hsigma
High sigma for pixel rejection with sigclip.
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.
int trace
Trace the position of the slices on the master flat.
const char * combine_s
Type of combination to use (as string)
cpl_frameset * usedFrames
int nhigh
Number of maximum pixels to reject with minmax.
double hisigmabadpix
High sigma to find bright pixels in the master flat.
cpl_error_code muse_processing_prepare_property(cpl_propertylist *, const char *, cpl_type, const char *)
Prepare and check the specified property.