FORS Pipeline Reference Manual  4.12.5
fors_sumflux.c
1 /* $Id: fors_sumflux.c,v 1.11 2013-04-24 14:14:13 cgarcia Exp $
2  *
3  * This file is part of the FORS Data Reduction Pipeline
4  * Copyright (C) 2002-2010 European Southern Observatory
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19  */
20 
21 /*
22  * $Author: cgarcia $
23  * $Date: 2013-04-24 14:14:13 $
24  * $Revision: 1.11 $
25  * $Name: not supported by cvs2svn $
26  */
27 
28 #ifdef HAVE_CONFIG_H
29 #include <config.h>
30 #endif
31 
32 #include <math.h>
33 #include <cpl.h>
34 #include <moses.h>
35 #include <fors_dfs.h>
36 #include <fors_qc.h>
37 
38 static int fors_sumflux_create(cpl_plugin *);
39 static int fors_sumflux_exec(cpl_plugin *);
40 static int fors_sumflux_destroy(cpl_plugin *);
41 static int fors_sumflux(cpl_parameterlist *, cpl_frameset *);
42 
43 static char fors_sumflux_description[] =
44 "This recipe is used to monitor any lamp flux on the CCD. The input raw\n"
45 "image should be either a FLUX_ARC_LSS or a FLUX_FLAT_LSS frame. After the\n"
46 "background subtraction the total signal is integrated and divided by the\n"
47 "exposure time and by the total number of CCD original pixels (keeping\n"
48 "into account a possible rebinned readout). In the case of FORS2 frames\n"
49 "the background is the median level evaluated from the available overscan\n"
50 "regions. In the case of FORS1 data, where overscan regions are missing,\n"
51 "the background is evaluated as the median level of the first 200 CCD columns\n"
52 "for flat field data, while for arc lamp data a background map evaluated\n"
53 "from the regions without spectral lines is computed and subtracted. The\n"
54 "background subtracted frame is written to output in all cases, and the QC\n"
55 "parameters QC LAMP FLUX and QC LAMP FLUXERR are computed.\n\n"
56 "Input files:\n\n"
57 " DO category: Type: Explanation: Required:\n"
58 " FLUX_FLAT_LSS Raw Flat field exposure Y\n"
59 " or FLUX_ARC_LSS Raw Arc lamp exposure Y\n\n"
60 "Output files:\n\n"
61 " DO category: Data type: Explanation:\n"
62 " FLUX_LAMP_LSS FITS image Background subtracted integration region\n\n";
63 
64 #define fors_sumflux_exit(message) \
65 { \
66 if (message) cpl_msg_error(recipe, message); \
67 cpl_free(instrume); \
68 cpl_free(pipefile); \
69 cpl_image_delete(master_bias); \
70 cpl_image_delete(exposure); \
71 cpl_propertylist_delete(header); \
72 cpl_propertylist_delete(qclist); \
73 cpl_table_delete(overscans); \
74 cpl_msg_indent_less(); \
75 return -1; \
76 }
77 
78 #define fors_sumflux_exit_memcheck(message) \
79 { \
80 if (message) cpl_msg_info(recipe, message); \
81 cpl_free(instrume); \
82 cpl_free(pipefile); \
83 cpl_image_delete(master_bias); \
84 cpl_image_delete(exposure); \
85 cpl_propertylist_delete(header); \
86 cpl_propertylist_delete(qclist); \
87 cpl_table_delete(overscans); \
88 cpl_msg_indent_less(); \
89 return 0; \
90 }
91 
92 
104 int cpl_plugin_get_info(cpl_pluginlist *list)
105 {
106  cpl_recipe *recipe = cpl_calloc(1, sizeof *recipe );
107  cpl_plugin *plugin = &recipe->interface;
108 
109  cpl_plugin_init(plugin,
110  CPL_PLUGIN_API,
111  FORS_BINARY_VERSION,
112  CPL_PLUGIN_TYPE_RECIPE,
113  "fors_sumflux",
114  "Integrate flux from all or part of the input frame",
115  fors_sumflux_description,
116  "Carlo Izzo",
117  PACKAGE_BUGREPORT,
118  "This file is currently part of the FORS Instrument Pipeline\n"
119  "Copyright (C) 2002-2010 European Southern Observatory\n\n"
120  "This program is free software; you can redistribute it and/or modify\n"
121  "it under the terms of the GNU General Public License as published by\n"
122  "the Free Software Foundation; either version 2 of the License, or\n"
123  "(at your option) any later version.\n\n"
124  "This program is distributed in the hope that it will be useful,\n"
125  "but WITHOUT ANY WARRANTY; without even the implied warranty of\n"
126  "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n"
127  "GNU General Public License for more details.\n\n"
128  "You should have received a copy of the GNU General Public License\n"
129  "along with this program; if not, write to the Free Software Foundation,\n"
130  "Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA\n",
131  fors_sumflux_create,
132  fors_sumflux_exec,
133  fors_sumflux_destroy);
134 
135  cpl_pluginlist_append(list, plugin);
136 
137  return 0;
138 }
139 
140 
151 static int fors_sumflux_create(cpl_plugin *plugin)
152 {
153  cpl_recipe *recipe;
154  cpl_parameter *p;
155 
156 
157  /*
158  * Check that the plugin is part of a valid recipe
159  */
160 
161  if (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE)
162  recipe = (cpl_recipe *)plugin;
163  else
164  return -1;
165 
166  /*
167  * Create the parameters list in the cpl_recipe object
168  */
169 
170  recipe->parameters = cpl_parameterlist_new();
171 
172 
173  /*
174  * X coordinate of lower left corner
175  */
176 
177  p = cpl_parameter_new_value("fors.fors_sumflux.xlow",
178  CPL_TYPE_INT,
179  "X coordinate of lower left corner "
180  "of integration region (pixel)",
181  "fors.fors_sumflux",
182  0);
183  cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, "xlow");
184  cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
185  cpl_parameterlist_append(recipe->parameters, p);
186 
187  /*
188  * Y coordinate of lower left corner
189  */
190 
191  p = cpl_parameter_new_value("fors.fors_sumflux.ylow",
192  CPL_TYPE_INT,
193  "Y coordinate of lower left corner "
194  "of integration region (pixel)",
195  "fors.fors_sumflux",
196  0);
197  cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, "ylow");
198  cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
199  cpl_parameterlist_append(recipe->parameters, p);
200 
201  /*
202  * X coordinate of upper right corner
203  */
204 
205  p = cpl_parameter_new_value("fors.fors_sumflux.xhigh",
206  CPL_TYPE_INT,
207  "X coordinate of upper right corner "
208  "of integration region (pixel) (0 = CCD size)",
209  "fors.fors_sumflux",
210  0);
211  cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, "xhigh");
212  cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
213  cpl_parameterlist_append(recipe->parameters, p);
214 
215  /*
216  * Y coordinate of upper right corner
217  */
218 
219  p = cpl_parameter_new_value("fors.fors_sumflux.yhigh",
220  CPL_TYPE_INT,
221  "Y coordinate of upper right corner "
222  "of integration region (pixel) (0 = CCD size)",
223  "fors.fors_sumflux",
224  0);
225  cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, "yhigh");
226  cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
227  cpl_parameterlist_append(recipe->parameters, p);
228 
229  return 0;
230 }
231 
232 
241 static int fors_sumflux_exec(cpl_plugin *plugin)
242 {
243  cpl_recipe *recipe;
244 
245  if (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE)
246  recipe = (cpl_recipe *)plugin;
247  else
248  return -1;
249 
250  return fors_sumflux(recipe->parameters, recipe->frames);
251 }
252 
253 
262 static int fors_sumflux_destroy(cpl_plugin *plugin)
263 {
264  cpl_recipe *recipe;
265 
266  if (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE)
267  recipe = (cpl_recipe *)plugin;
268  else
269  return -1;
270 
271  cpl_parameterlist_delete(recipe->parameters);
272 
273  return 0;
274 }
275 
276 
286 static int fors_sumflux(cpl_parameterlist *parlist, cpl_frameset *frameset)
287 {
288 
289  const char *recipe = "fors_sumflux";
290 
291 
292  /*
293  * Input parameters
294  */
295 
296  int xlow;
297  int ylow;
298  int xhig;
299  int yhig;
300 
301  /*
302  * CPL objects
303  */
304 
305  cpl_image *master_bias = NULL;
306  cpl_image *exposure = NULL;
307  cpl_image *background = NULL;
308  cpl_image *dummy = NULL;
309 
310  cpl_table *overscans = NULL;
311 
312  cpl_propertylist *header = NULL;
313  cpl_propertylist *qclist = NULL;
314 
315  /*
316  * Auxiliary variables
317  */
318 
319  const char *arc_tag = "FLUX_ARC_LSS";
320  const char *flat_tag = "FLUX_FLAT_LSS";
321 
322  char version[80];
323  char lamp[20];
324  const char *exposure_tag;
325  const char *flux_tag = "FLUX_LAMP_LSS";
326  double time;
327  double norm_factor;
328  int nframes;
329  int rebin;
330  int nx, ny;
331  double gain;
332  double flux, flux_err;
333  int i;
334 
335  char *instrume = NULL;
336  char *pipefile = NULL;
337 
338 
339  snprintf(version, 80, "%s-%s", PACKAGE, PACKAGE_VERSION);
340 
341  cpl_msg_set_indentation(2);
342 
343  /*
344  * Get configuration parameters
345  */
346 
347  cpl_msg_info(recipe, "Recipe %s configuration parameters:", recipe);
348  cpl_msg_indent_more();
349 
350  xlow = dfs_get_parameter_int(parlist, "fors.fors_sumflux.xlow", NULL);
351  ylow = dfs_get_parameter_int(parlist, "fors.fors_sumflux.ylow", NULL);
352  xhig = dfs_get_parameter_int(parlist, "fors.fors_sumflux.xhigh", NULL);
353  yhig = dfs_get_parameter_int(parlist, "fors.fors_sumflux.yhigh", NULL);
354 
355  if (cpl_error_get_code())
356  fors_sumflux_exit("Failure getting the configuration parameters");
357 
358  if (xlow > xhig || ylow > yhig || xhig < 0 || yhig < 0)
359  fors_sumflux_exit("Invalid integration region");
360 
361 
362  /*
363  * Check input set-of-frames
364  */
365 
366  cpl_msg_indent_less();
367  cpl_msg_info(recipe, "Check input set-of-frames:");
368  cpl_msg_indent_more();
369 
370  if (!dfs_equal_keyword(frameset, "ESO DET CHIP1 ID"))
371  fors_sumflux_exit("Input frames are not from the same chip");
372 
373  nframes = cpl_frameset_count_tags(frameset, arc_tag)
374  + cpl_frameset_count_tags(frameset, flat_tag);
375 
376  if (nframes == 0)
377  fors_sumflux_exit("Missing input LSS calibration exposures");
378 
379  if (nframes > 1) {
380  cpl_msg_error(recipe, "Too many LSS calibration exposures found (%d). "
381  "Just one is required.", nframes);
382  fors_sumflux_exit(NULL);
383  }
384 
385  if (cpl_frameset_count_tags(frameset, arc_tag) > 0)
386  exposure_tag = arc_tag;
387  else
388  exposure_tag = flat_tag;
389 
390 /*** MASTER BIAS
391 
392  if (cpl_frameset_count_tags(frameset, "MASTER_BIAS") == 0)
393  fors_sumflux_exit("Missing required input: MASTER_BIAS");
394 
395  if (cpl_frameset_count_tags(frameset, "MASTER_BIAS") > 1)
396  fors_sumflux_exit("Too many in input: MASTER_BIAS");
397 
398  cpl_msg_info(recipe, "Load master bias frame...");
399  cpl_msg_indent_more();
400 
401  master_bias = dfs_load_image(frameset, "MASTER_BIAS", CPL_TYPE_FLOAT, 0, 1);
402  if (master_bias == NULL)
403  fors_sumflux_exit("Cannot load master bias");
404 
405 MASTER BIAS ***/
406 
407  cpl_msg_indent_less();
408  cpl_msg_info(recipe, "Load %s frame...", exposure_tag);
409  cpl_msg_indent_more();
410 
411  exposure = dfs_load_image(frameset, exposure_tag, CPL_TYPE_FLOAT, 0, 0);
412  if (exposure == NULL)
413  fors_sumflux_exit("Cannot load input frame");
414 
415  /*
416  * Get exposure time, rebin factor, gain, etc.
417  */
418 
419  header = dfs_load_header(frameset, exposure_tag, 0);
420 
421  if (header == NULL)
422  fors_sumflux_exit("Cannot load input frame header");
423 
424  time = cpl_propertylist_get_double(header, "EXPTIME");
425 
426  if (cpl_error_get_code() != CPL_ERROR_NONE)
427  fors_sumflux_exit("Missing keyword EXPTIME in input frame header");
428 
429  instrume = (char *)cpl_propertylist_get_string(header, "INSTRUME");
430  if (instrume == NULL)
431  fors_sumflux_exit("Missing keyword INSTRUME in input frame header");
432  instrume = cpl_strdup(instrume);
433 
434  if (instrume[4] == '1')
435  snprintf(version, 80, "%s/%s", "fors1", VERSION);
436  if (instrume[4] == '2')
437  snprintf(version, 80, "%s/%s", "fors2", VERSION);
438 
439  rebin = cpl_propertylist_get_int(header, "ESO DET WIN1 BINX");
440 
441  if (cpl_error_get_code() != CPL_ERROR_NONE)
442  fors_sumflux_exit("Missing keyword ESO DET WIN1 BINX in input "
443  "frame header");
444 
445  rebin *= cpl_propertylist_get_int(header, "ESO DET WIN1 BINY");
446 
447  if (cpl_error_get_code() != CPL_ERROR_NONE)
448  fors_sumflux_exit("Missing keyword ESO DET WIN1 BINY in input "
449  "frame header");
450 
451  if (rebin > 1) {
452  cpl_msg_info(recipe,
453  "One readout pixel corresponds to %d chip pixels", rebin);
454  }
455 
456  gain = cpl_propertylist_get_double(header, "ESO DET OUT1 CONAD");
457 
458  if (cpl_error_get_code() != CPL_ERROR_NONE)
459  fors_sumflux_exit("Missing keyword ESO DET OUT1 CONAD in arc lamp "
460  "frame header");
461 
462  cpl_msg_info(recipe, "The gain factor is: %.2f e-/ADU", gain);
463 
464  /* Leave the header on for the next step... */
465 
466 
467  /*
468  * Remove the bias if possible (FORS2), otherwise remove the flux from a
469  * presumably darker part of the image (FORS1).
470  */
471 
472  switch (instrume[4]) {
473  case '1':
474 #ifdef OLD_FORS1
475  cpl_msg_info(recipe, "Remove low-flux region level...");
476  if (exposure_tag == flat_tag) {
477  overscans = cpl_table_new(2);
478  cpl_table_new_column(overscans, "xlow", CPL_TYPE_INT);
479  cpl_table_new_column(overscans, "ylow", CPL_TYPE_INT);
480  cpl_table_new_column(overscans, "xhig", CPL_TYPE_INT);
481  cpl_table_new_column(overscans, "yhig", CPL_TYPE_INT);
482 
483  nx = cpl_image_get_size_x(exposure);
484  ny = cpl_image_get_size_y(exposure);
485 
486  /* "Valid" region */
487 
488  cpl_table_set_int(overscans, "xlow", 0, 200);
489  cpl_table_set_int(overscans, "ylow", 0, 0);
490  cpl_table_set_int(overscans, "xhig", 0, nx);
491  cpl_table_set_int(overscans, "yhig", 0, ny);
492 
493  /* "Overscan" (background) region */
494 
495  cpl_table_set_int(overscans, "xlow", 1, 0);
496  cpl_table_set_int(overscans, "ylow", 1, 0);
497  cpl_table_set_int(overscans, "xhig", 1, 200);
498  cpl_table_set_int(overscans, "yhig", 1, ny);
499  }
500  else {
501  background = mos_arc_background(exposure, 15, 15);
502  cpl_image_subtract(exposure, background);
503  cpl_image_delete(background);
504  }
505 #else
506  cpl_msg_info(recipe, "Remove bias, evaluated on overscan regions...");
507  overscans = mos_load_overscans_vimos(header, 1);
508 #endif
509  break;
510  case '2':
511  cpl_msg_info(recipe, "Remove bias, evaluated on overscan regions...");
512  overscans = mos_load_overscans_vimos(header, 1);
513  break;
514  default:
515  cpl_msg_error(recipe, "Invalid instrument name: %s", instrume);
516  fors_sumflux_exit(NULL);
517  }
518 
519  if (overscans) {
520  dummy = mos_remove_bias(exposure, NULL, overscans);
521  cpl_table_delete(overscans); overscans = NULL;
522  cpl_image_delete(exposure); exposure = dummy;
523 
524  if (exposure == NULL)
525  fors_sumflux_exit("Cannot remove bias from input frame");
526  }
527 
528  nx = cpl_image_get_size_x(exposure);
529  ny = cpl_image_get_size_y(exposure);
530 
531  if (xhig == 0)
532  xhig = nx;
533 
534  if (yhig == 0)
535  yhig = ny;
536 
537  if (xlow > nx || ylow > ny || xhig < 0 || yhig < 0)
538  fors_sumflux_exit("The integration region lays outside the CCD");
539 
540  if (xlow == xhig || ylow == yhig)
541  fors_sumflux_exit("The integration area is zero");
542 
543  norm_factor = rebin * time * (xhig - xlow) * (yhig - ylow);
544 
545  flux = cpl_image_get_flux(exposure);
546  if (flux > 0.0) {
547  flux_err = sqrt(flux/gain);
548  }
549  else {
550  flux = 0.0;
551  flux_err = 0.0;
552  }
553 
554  flux /= norm_factor;
555  flux_err /= norm_factor;
556 
557  cpl_msg_info(recipe, "Flux: %.4f +/- %.4f (ADU/s*pixel)", flux, flux_err);
558 
559  cpl_image_divide_scalar(exposure, norm_factor);
560 
561  /* Leave the header on for the next step... */
562 
563 
564  /*
565  * QC1 group header
566  */
567 
568  qclist = cpl_propertylist_new();
569 
570  fors_qc_start_group(qclist, "2.0", instrume);
571 
572  if (fors_qc_write_string("PRO.CATG", flux_tag,
573  "Product category", instrume))
574  fors_sumflux_exit("Cannot write product category to QC log file");
575 
576  if (fors_qc_keyword_to_paf(header, "ESO DPR TYPE", NULL,
577  "DPR type", instrume))
578  fors_sumflux_exit("Missing keyword DPR TYPE in frame header");
579 
580  if (fors_qc_keyword_to_paf(header, "ESO TPL ID", NULL,
581  "Template", instrume))
582  fors_sumflux_exit("Missing keyword TPL ID in frame header");
583 
584  if (fors_qc_keyword_to_paf(header, "ESO INS GRIS1 NAME", NULL,
585  "Grism name", instrume))
586  fors_sumflux_exit("Missing keyword INS GRIS1 NAME in frame header");
587 
588  if (fors_qc_keyword_to_paf(header, "ESO INS GRIS1 ID", NULL,
589  "Grim identifier", instrume))
590  fors_sumflux_exit("Missing keyword INS GRIS1 ID in frame header");
591 
592  if (cpl_propertylist_has(header, "ESO INS FILT1 NAME"))
593  fors_qc_keyword_to_paf(header, "ESO INS FILT1 NAME", NULL,
594  "Filter name", instrume);
595 
596  if (fors_qc_keyword_to_paf(header, "ESO INS COLL NAME", NULL,
597  "Collimator name", instrume))
598  fors_sumflux_exit("Missing keyword INS COLL NAME in frame header");
599 
600  if (fors_qc_keyword_to_paf(header, "ESO DET CHIP1 ID", NULL,
601  "Chip identifier", instrume))
602  fors_sumflux_exit("Missing keyword DET CHIP1 ID in frame header");
603 
604  if (fors_qc_keyword_to_paf(header, "ESO INS SLIT WID",
605  "arcsec", "Slit width", instrume))
606  fors_sumflux_exit("Missing keyword ESO INS SLIT WID in frame header");
607 
608  if (fors_qc_keyword_to_paf(header, "ESO DET OUT1 CONAD", "e-/ADU",
609  "Conversion from ADUs to electrons", instrume))
610  fors_sumflux_exit("Missing keyword ESO DET OUT1 CONAD in frame header");
611 
612  if (fors_qc_keyword_to_paf(header, "ESO DET WIN1 BINX", NULL,
613  "Binning factor along X", instrume))
614  fors_sumflux_exit("Missing keyword ESO DET WIN1 BINX in frame header");
615 
616  if (fors_qc_keyword_to_paf(header, "ESO DET WIN1 BINY", NULL,
617  "Binning factor along Y", instrume))
618  fors_sumflux_exit("Missing keyword ESO DET WIN1 BINY in frame header");
619 
620  for (i = 1; i < 7; i++) {
621  snprintf(lamp, 20, "ESO INS LAMP%d NAME", i);
622  if (cpl_propertylist_has(header, lamp))
623  fors_qc_keyword_to_paf(header, lamp, NULL,
624  "Name of lamp on", instrume);
625  }
626 
627  if (fors_qc_keyword_to_paf(header, "ARCFILE", NULL,
628  "Archive name of input data", instrume))
629  fors_sumflux_exit("Missing keyword ARCFILE in frame header");
630 
631  cpl_propertylist_delete(header); header = NULL;
632 
633  pipefile = dfs_generate_filename(flux_tag);
634  if (fors_qc_write_string("PIPEFILE", pipefile,
635  "Pipeline product name", instrume))
636  fors_sumflux_exit("Cannot write PIPEFILE to QC log file");
637  cpl_free(pipefile); pipefile = NULL;
638 
639 
640  /*
641  * QC1 parameters
642  */
643 
644  if (fors_qc_write_qc_double(qclist, flux, "QC.LAMP.FLUX", "ADU/s*pixel",
645  "Total lamp flux", instrume)) {
646  fors_sumflux_exit("Cannot write total lamp flux to QC log file");
647  }
648 
649  if (fors_qc_write_qc_double(qclist, flux_err, "QC.LAMP.FLUXERR",
650  "ADU/s*pixel",
651  "Error on lamp flux", instrume)) {
652  fors_sumflux_exit("Cannot write error on lamp flux to QC log file");
653  }
654 
656 
657  cpl_free(instrume); instrume = NULL;
658 
659  if (dfs_save_image(frameset, exposure, flux_tag, qclist,
660  parlist, recipe, version))
661  fors_sumflux_exit(NULL);
662 
663  cpl_image_delete(exposure); exposure = NULL;
664  cpl_propertylist_delete(qclist); qclist = NULL;
665 
666  return 0;
667 
668 }
int cpl_plugin_get_info(cpl_pluginlist *list)
Build the list of available plugins, for this module.
Definition: fors_bias.c:62
cpl_image * dfs_load_image(cpl_frameset *frameset, const char *category, cpl_type type, int ext, int calib)
Loading image data of given category.
Definition: fors_dfs.c:845
cpl_propertylist * dfs_load_header(cpl_frameset *frameset, const char *category, int ext)
Loading header associated to data of given category.
Definition: fors_dfs.c:951
cpl_error_code fors_qc_write_qc_double(cpl_propertylist *header, double value, const char *name, const char *unit, const char *comment, const char *instrument)
Write an integer value to the active QC1 PAF object and to a header.
Definition: fors_qc.c:604
cpl_error_code fors_qc_keyword_to_paf(cpl_propertylist *header, const char *name, const char *unit, const char *comment, const char *instrument)
Copy a keyword value to the currently active QC1 PAF object.
Definition: fors_qc.c:425
cpl_error_code fors_qc_start_group(cpl_propertylist *header, const char *qcdic_version, const char *instrument)
Initiate a new QC1 group.
Definition: fors_qc.c:77
cpl_image * mos_remove_bias(cpl_image *image, cpl_image *bias, cpl_table *overscans)
Subtract the bias from a CCD exposure.
Definition: moses.c:3422
cpl_error_code fors_qc_write_string(const char *name, const char *value, const char *comment, const char *instrument)
Add string parameter to current QC1 group.
Definition: fors_qc.c:235
int dfs_equal_keyword(cpl_frameset *frameset, const char *keyword)
Saving table data of given category.
Definition: fors_dfs.c:1685
int dfs_save_image(cpl_frameset *frameset, const cpl_image *image, const char *category, cpl_propertylist *header, const cpl_parameterlist *parlist, const char *recipename, const char *version)
Saving image data of given category.
Definition: fors_dfs.c:1447
int dfs_get_parameter_int(cpl_parameterlist *parlist, const char *name, const cpl_table *defaults)
Reading a recipe integer parameter value.
Definition: fors_dfs.c:392
cpl_error_code fors_qc_end_group(void)
Close current QC1 PAF file.
Definition: fors_qc.c:200
Definition: list.c:74
cpl_image * mos_arc_background(cpl_image *image, int msize, int fsize)
Background determination on emission line spectrum (arc)
Definition: moses.c:3697
cpl_table * mos_load_overscans_vimos(const cpl_propertylist *header, int check_consistency)
Get the overscan positions from FITS header of VIMOS data.
Definition: moses.c:15426