FORS Pipeline Reference Manual  4.12.5
fors_trace_flat.c
1 /* $Id: fors_trace_flat.c,v 1.8 2013-08-20 16:58:25 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-08-20 16:58:25 $
24  * $Revision: 1.8 $
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 
37 static int fors_trace_flat_create(cpl_plugin *);
38 static int fors_trace_flat_exec(cpl_plugin *);
39 static int fors_trace_flat_destroy(cpl_plugin *);
40 static int fors_trace_flat(cpl_parameterlist *, cpl_frameset *);
41 
42 static char fors_trace_flat_description[] =
43 "This recipe is used to trace the edges of MOS/MXU flat field slit spectra\n"
44 "and determine the spectral curvature solution. The input master flat field\n"
45 "image, product of the recipe fors_flat, is expected to be oriented with\n"
46 "horizontal dispersion direction and red wavelengths on the right side.\n"
47 "The input slits location table should be the product of the recipe\n"
48 "fors_detect_spectra.\n"
49 "\n"
50 "The input master flat image is shifted one pixel down and is subtracted\n"
51 "from the original image. The result is a vertical gradient map. Next,\n"
52 "the negative values are forced positive, to obtain an absolute gradient\n"
53 "map. The map is passed with a horizontal median filter, and after that\n"
54 "the gradient peaks are traced starting from the slits positions listed\n"
55 "in the input slits location table. The number of pixels to the left and\n"
56 "to the right of the reference pixel is trivially derived from the specified\n"
57 "spectral range and spectral dispersion.\n"
58 "\n"
59 "The output spectral curvature table contains the coefficients of the\n"
60 "polynomial fitting of the found traces, while the output trace table\n"
61 "contains the traced spectral edges positions in CCD (Y) coordinates for\n"
62 "each spectrum, and their comparison with their modeling. A spatial map\n"
63 "is also created, where to each CCD pixel is assigned the value of the\n"
64 "spatial coordinate along the slit (in pixel). For more details please\n"
65 "refer to the FORS Pipeline User's Manual.\n"
66 "\n"
67 "Note that specifying an input GRISM_TABLE will set some of the recipe\n"
68 "configuration parameters to default values valid for a particular grism.\n"
69 "Again, see the pipeline manual for more details.\n"
70 "\n"
71 "In the table below the MXU acronym can be alternatively read as MOS.\n\n"
72 "Input files:\n\n"
73 " DO category: Type: Explanation: Required:\n"
74 " MASTER_SCREEN_FLAT_MXU Calib Master flat frame Y\n"
75 " SLIT_LOCATION_DETECT_MXU Calib Slits location Y\n"
76 " GRISM_TABLE Calib Grism table .\n\n"
77 "Output files:\n\n"
78 " DO category: Data type: Explanation:\n"
79 " CURV_TRACES_MXU FITS table Flat field tracings\n"
80 " CURV_COEFF_MXU FITS table Spectral curvature table\n"
81 " SPATIAL_MAP_MXU FITS image Map of spatial coordinate\n\n";
82 
83 #define fors_trace_flat_exit(message) \
84 { \
85 if (message) cpl_msg_error(recipe, message); \
86 cpl_image_delete(master_flat); \
87 cpl_image_delete(spatial); \
88 cpl_image_delete(coordinate); \
89 cpl_table_delete(grism_table); \
90 cpl_table_delete(maskslits); \
91 cpl_table_delete(slits); \
92 cpl_table_delete(traces); \
93 cpl_table_delete(polytraces); \
94 cpl_propertylist_delete(header); \
95 cpl_msg_indent_less(); \
96 return -1; \
97 }
98 
99 #define fors_trace_flat_exit_memcheck(message) \
100 { \
101 if (message) cpl_msg_info(recipe, message); \
102 printf("free master_flat (%p)\n", master_flat); \
103 cpl_image_delete(master_flat); \
104 printf("free spatial (%p)\n", spatial); \
105 cpl_image_delete(spatial); \
106 printf("free coordinate (%p)\n", coordinate); \
107 cpl_image_delete(coordinate); \
108 printf("free grism_table (%p)\n", grism_table); \
109 cpl_table_delete(grism_table); \
110 printf("free maskslits (%p)\n", maskslits); \
111 cpl_table_delete(maskslits); \
112 printf("free slits (%p)\n", slits); \
113 cpl_table_delete(slits); \
114 printf("free traces (%p)\n", traces); \
115 cpl_table_delete(traces); \
116 printf("free polytraces (%p)\n", polytraces); \
117 cpl_table_delete(polytraces); \
118 printf("free header (%p)\n", header); \
119 cpl_propertylist_delete(header); \
120 cpl_msg_indent_less(); \
121 return 0; \
122 }
123 
124 
136 int cpl_plugin_get_info(cpl_pluginlist *list)
137 {
138  cpl_recipe *recipe = cpl_calloc(1, sizeof *recipe );
139  cpl_plugin *plugin = &recipe->interface;
140 
141  cpl_plugin_init(plugin,
142  CPL_PLUGIN_API,
143  FORS_BINARY_VERSION,
144  CPL_PLUGIN_TYPE_RECIPE,
145  "fors_trace_flat",
146  "Determine spectral curvature model",
147  fors_trace_flat_description,
148  "Carlo Izzo",
149  PACKAGE_BUGREPORT,
150  "This file is currently part of the FORS Instrument Pipeline\n"
151  "Copyright (C) 2002-2010 European Southern Observatory\n\n"
152  "This program is free software; you can redistribute it and/or modify\n"
153  "it under the terms of the GNU General Public License as published by\n"
154  "the Free Software Foundation; either version 2 of the License, or\n"
155  "(at your option) any later version.\n\n"
156  "This program is distributed in the hope that it will be useful,\n"
157  "but WITHOUT ANY WARRANTY; without even the implied warranty of\n"
158  "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n"
159  "GNU General Public License for more details.\n\n"
160  "You should have received a copy of the GNU General Public License\n"
161  "along with this program; if not, write to the Free Software Foundation,\n"
162  "Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA\n",
163  fors_trace_flat_create,
164  fors_trace_flat_exec,
165  fors_trace_flat_destroy);
166 
167  cpl_pluginlist_append(list, plugin);
168 
169  return 0;
170 }
171 
172 
183 static int fors_trace_flat_create(cpl_plugin *plugin)
184 {
185  cpl_recipe *recipe;
186  cpl_parameter *p;
187 
188  /*
189  * Check that the plugin is part of a valid recipe
190  */
191 
192  if (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE)
193  recipe = (cpl_recipe *)plugin;
194  else
195  return -1;
196 
197  /*
198  * Create the (empty) parameters list in the cpl_recipe object
199  */
200 
201  recipe->parameters = cpl_parameterlist_new();
202 
203  /*
204  * Dispersion
205  */
206 
207  p = cpl_parameter_new_value("fors.fors_trace_flat.dispersion",
208  CPL_TYPE_DOUBLE,
209  "Expected spectral dispersion (Angstrom/pixel)",
210  "fors.fors_trace_flat",
211  0.0);
212  cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, "dispersion");
213  cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
214  cpl_parameterlist_append(recipe->parameters, p);
215 
216  /*
217  * Start wavelength for spectral extraction
218  */
219 
220  p = cpl_parameter_new_value("fors.fors_trace_flat.startwavelength",
221  CPL_TYPE_DOUBLE,
222  "Start wavelength in spectral extraction",
223  "fors.fors_trace_flat",
224  0.0);
225  cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, "startwavelength");
226  cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
227  cpl_parameterlist_append(recipe->parameters, p);
228 
229  /*
230  * End wavelength for spectral extraction
231  */
232 
233  p = cpl_parameter_new_value("fors.fors_trace_flat.endwavelength",
234  CPL_TYPE_DOUBLE,
235  "End wavelength in spectral extraction",
236  "fors.fors_trace_flat",
237  0.0);
238  cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, "endwavelength");
239  cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
240  cpl_parameterlist_append(recipe->parameters, p);
241 
242  /*
243  * Degree of spectral curvature polynomial
244  */
245 
246  p = cpl_parameter_new_value("fors.fors_trace_flat.cdegree",
247  CPL_TYPE_INT,
248  "Degree of spectral curvature polynomial",
249  "fors.fors_trace_flat",
250  0);
251  cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, "cdegree");
252  cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
253  cpl_parameterlist_append(recipe->parameters, p);
254 
255  /*
256  * Curvature solution interpolation (for MOS-like data)
257  */
258 
259  p = cpl_parameter_new_value("fors.fors_trace_flat.cmode",
260  CPL_TYPE_INT,
261  "Interpolation mode of curvature solution "
262  "applicable to MOS-like data (0 = no "
263  "interpolation, 1 = fill gaps, 2 = global "
264  "model)",
265  "fors.fors_trace_flat",
266  1);
267  cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, "cmode");
268  cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
269  cpl_parameterlist_append(recipe->parameters, p);
270 
271  return 0;
272 }
273 
274 
283 static int fors_trace_flat_exec(cpl_plugin *plugin)
284 {
285  cpl_recipe *recipe;
286 
287  if (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE)
288  recipe = (cpl_recipe *)plugin;
289  else
290  return -1;
291 
292  return fors_trace_flat(recipe->parameters, recipe->frames);
293 }
294 
295 
304 static int fors_trace_flat_destroy(cpl_plugin *plugin)
305 {
306  cpl_recipe *recipe;
307 
308  if (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE)
309  recipe = (cpl_recipe *)plugin;
310  else
311  return -1;
312 
313  cpl_parameterlist_delete(recipe->parameters);
314 
315  return 0;
316 }
317 
318 
328 static int fors_trace_flat(cpl_parameterlist *parlist,
329  cpl_frameset *frameset)
330 {
331 
332  const char *recipe = "fors_trace_flat";
333 
334 
335  /*
336  * Input parameters
337  */
338 
339  double dispersion;
340  double startwavelength;
341  double endwavelength;
342  int cdegree;
343  int cmode;
344 
345  /*
346  * CPL objects
347  */
348 
349  cpl_image *master_flat = NULL;
350  cpl_image *coordinate = NULL;
351  cpl_image *spatial = NULL;
352  cpl_table *grism_table = NULL;
353  cpl_table *maskslits = NULL;
354  cpl_table *slits = NULL;
355  cpl_table *traces = NULL;
356  cpl_table *polytraces = NULL;
357  cpl_propertylist *header = NULL;
358 
359  /*
360  * Auxiliary variables
361  */
362 
363  char version[80];
364  const char *master_flat_tag;
365  const char *spatial_map_tag;
366  const char *slit_detect_tag;
367  const char *slit_location_tag;
368  const char *curv_traces_tag;
369  const char *curv_coeff_tag;
370  int flat_mxu;
371  int flat_mos;
372  int flat_lss;
373  int mos;
374  int nflat;
375  int rebin;
376  int nx, ny;
377  int treat_as_lss;
378  double reference;
379  double mxpos;
380  int nslits_out_det = 0;
381 
382  char *instrume = NULL;
383 
384 
385  cpl_msg_set_indentation(2);
386 
387  /*
388  * Get configuration parameters
389  */
390 
391  cpl_msg_info(recipe, "Recipe %s configuration parameters:", recipe);
392  cpl_msg_indent_more();
393 
394  if (cpl_frameset_count_tags(frameset, "GRISM_TABLE") > 1)
395  fors_trace_flat_exit("Too many in input: GRISM_TABLE");
396 
397  grism_table = dfs_load_table(frameset, "GRISM_TABLE", 1);
398 
399  dispersion = dfs_get_parameter_double(parlist,
400  "fors.fors_trace_flat.dispersion", grism_table);
401 
402  if (dispersion <= 0.0)
403  fors_trace_flat_exit("Invalid spectral dispersion value");
404 
405  startwavelength = dfs_get_parameter_double(parlist,
406  "fors.fors_trace_flat.startwavelength", grism_table);
407  if (startwavelength > 1.0)
408  if (startwavelength < 3000.0 || startwavelength > 13000.0)
409  fors_trace_flat_exit("Invalid wavelength");
410 
411  endwavelength = dfs_get_parameter_double(parlist,
412  "fors.fors_trace_flat.endwavelength", grism_table);
413  if (endwavelength > 1.0) {
414  if (endwavelength < 3000.0 || endwavelength > 13000.0)
415  fors_trace_flat_exit("Invalid wavelength");
416  if (startwavelength < 1.0)
417  fors_trace_flat_exit("Invalid wavelength interval");
418  }
419 
420  if (startwavelength > 1.0)
421  if (endwavelength - startwavelength <= 0.0)
422  fors_trace_flat_exit("Invalid wavelength interval");
423 
424  cdegree = dfs_get_parameter_int(parlist,
425  "fors.fors_trace_flat.cdegree", grism_table);
426 
427  if (cdegree < 1)
428  fors_trace_flat_exit("Invalid polynomial degree");
429 
430  if (cdegree > 5)
431  fors_trace_flat_exit("Max allowed polynomial degree is 5");
432 
433  cmode = dfs_get_parameter_int(parlist, "fors.fors_trace_flat.cmode", NULL);
434 
435  if (cmode < 0 || cmode > 2)
436  fors_trace_flat_exit("Invalid curvature solution interpolation mode");
437 
438  cpl_table_delete(grism_table); grism_table = NULL;
439 
440  if (cpl_error_get_code())
441  fors_trace_flat_exit("Failure reading the configuration parameters");
442 
443 
444  cpl_msg_indent_less();
445  cpl_msg_info(recipe, "Check input set-of-frames:");
446  cpl_msg_indent_more();
447 
448  nflat = flat_mxu = cpl_frameset_count_tags(frameset,
449  "MASTER_SCREEN_FLAT_MXU");
450  nflat += flat_mos = cpl_frameset_count_tags(frameset,
451  "MASTER_SCREEN_FLAT_MOS");
452  nflat += flat_lss = cpl_frameset_count_tags(frameset,
453  "MASTER_SCREEN_FLAT_LSS");
454 
455  if (nflat == 0) {
456  fors_trace_flat_exit("Missing input master flat field frame");
457  }
458  if (nflat > 1) {
459  cpl_msg_error(recipe, "Too many input flat frames (%d > 1)", nflat);
460  fors_trace_flat_exit(NULL);
461  }
462 
463  mos = 0;
464 
465  if (flat_mxu) {
466  master_flat_tag = "MASTER_SCREEN_FLAT_MXU";
467  slit_detect_tag = "SLIT_LOCATION_DETECT_MXU";
468  slit_location_tag = "SLIT_LOCATION_MXU";
469  curv_traces_tag = "CURV_TRACES_MXU";
470  curv_coeff_tag = "CURV_COEFF_MXU";
471  spatial_map_tag = "SPATIAL_MAP_MXU";
472  }
473  else if (flat_mos) {
474  mos = 1;
475  master_flat_tag = "MASTER_SCREEN_FLAT_MOS";
476  slit_detect_tag = "SLIT_LOCATION_DETECT_MOS";
477  slit_location_tag = "SLIT_LOCATION_MOS";
478  curv_traces_tag = "CURV_TRACES_MOS";
479  curv_coeff_tag = "CURV_COEFF_MOS";
480  spatial_map_tag = "SPATIAL_MAP_MOS";
481  }
482  else if (flat_lss) {
483  fors_trace_flat_exit("LSS spectra are not traceable: use this recipe "
484  "just for MOS/MXU data.");
485  }
486 
487  if (cpl_frameset_count_tags(frameset, slit_detect_tag) == 0) {
488  cpl_msg_error(recipe, "Missing required input: %s", slit_detect_tag);
489  fors_trace_flat_exit(NULL);
490  }
491 
492  if (cpl_frameset_count_tags(frameset, slit_detect_tag) > 1) {
493  cpl_msg_error(recipe, "Too many in input: %s", slit_detect_tag);
494  fors_trace_flat_exit(NULL);
495  }
496 
497  if (!dfs_equal_keyword(frameset, "ESO INS GRIS1 ID"))
498  fors_trace_flat_exit("Input frames are not from the same grism");
499 
500  if (!dfs_equal_keyword(frameset, "ESO INS FILT1 ID"))
501  fors_trace_flat_exit("Input frames are not from the same filter");
502 
503  if (!dfs_equal_keyword(frameset, "ESO DET CHIP1 ID"))
504  fors_trace_flat_exit("Input frames are not from the same chip");
505 
506 
507  /*
508  * Get the reference wavelength and the rebin factor along the
509  * dispersion direction from the master flat frame
510  */
511 
512  header = dfs_load_header(frameset, master_flat_tag, 0);
513 
514  if (header == NULL)
515  fors_trace_flat_exit("Cannot load master flat frame header");
516 
517  instrume = (char *)cpl_propertylist_get_string(header, "INSTRUME");
518  if (instrume == NULL)
519  fors_trace_flat_exit("Missing keyword INSTRUME in master flat header");
520 
521  if (instrume[4] == '1')
522  snprintf(version, 80, "%s/%s", "fors1", VERSION);
523  if (instrume[4] == '2')
524  snprintf(version, 80, "%s/%s", "fors2", VERSION);
525 
526  reference = cpl_propertylist_get_double(header, "ESO INS GRIS1 WLEN");
527 
528  if (cpl_error_get_code() != CPL_ERROR_NONE)
529  fors_trace_flat_exit("Missing keyword ESO INS GRIS1 WLEN "
530  "in master flat frame header");
531 
532  if (reference < 3000.0) /* Perhaps in nanometers... */
533  reference *= 10;
534 
535  if (reference < 3000.0 || reference > 13000.0) {
536  cpl_msg_error(recipe, "Invalid central wavelength %.2f read from "
537  "keyword ESO INS GRIS1 WLEN in master flat header",
538  reference);
539  fors_trace_flat_exit(NULL);
540  }
541 
542  cpl_msg_info(recipe, "The central wavelength is: %.2f", reference);
543 
544  rebin = cpl_propertylist_get_int(header, "ESO DET WIN1 BINX");
545 
546  if (cpl_error_get_code() != CPL_ERROR_NONE)
547  fors_trace_flat_exit("Missing keyword ESO DET WIN1 BINX "
548  "in master flat header");
549 
550  if (rebin != 1) {
551  dispersion *= rebin;
552  cpl_msg_warning(recipe, "The rebin factor is %d, and therefore the "
553  "working dispersion used is %f A/pixel", rebin,
554  dispersion);
555  }
556 
557 
558  /*
559  * Check if all slits have the same X offset: in such case, abort!
560  */
561 
562  if (mos)
563  maskslits = mos_load_slits_fors_mos(header, &nslits_out_det);
564  else
565  maskslits = mos_load_slits_fors_mxu(header);
566 
567  treat_as_lss = fors_mos_is_lss_like(maskslits, nslits_out_det);
568 
569  if (treat_as_lss) {
570  cpl_msg_error(recipe, "All slits have the same offset: %.2f mm\n"
571  "Spectra are not traceable: the LSS data reduction\n"
572  "strategy must be applied.", mxpos);
573  fors_trace_flat_exit(NULL);
574  }
575 
576  cpl_table_delete(maskslits); maskslits = NULL;
577 
578 
579  cpl_msg_indent_less();
580  cpl_msg_info(recipe, "Load input frames...");
581  cpl_msg_indent_more();
582 
583  master_flat = dfs_load_image(frameset, master_flat_tag,
584  CPL_TYPE_FLOAT, 0, 0);
585  if (master_flat == NULL)
586  fors_trace_flat_exit("Cannot load master flat field frame");
587 
588  slits = dfs_load_table(frameset, slit_detect_tag, 1);
589  if (slits == NULL)
590  fors_trace_flat_exit("Cannot load slits location table");
591 
592 
593  cpl_msg_indent_less();
594  cpl_msg_info(recipe, "Determining spectral curvature...");
595  cpl_msg_indent_more();
596 
597  cpl_msg_info(recipe, "Tracing master flat field spectra edges...");
598  traces = mos_trace_flat(master_flat, slits, reference,
599  startwavelength, endwavelength, dispersion);
600 
601  if (!traces)
602  fors_trace_flat_exit("Tracing failure");
603 
604  cpl_msg_info(recipe, "Fitting flat field spectra edges...");
605  polytraces = mos_poly_trace(slits, traces, cdegree);
606 
607  if (!polytraces)
608  fors_trace_flat_exit("Trace fitting failure");
609 
610  if (cmode) {
611  cpl_msg_info(recipe, "Computing global spectral curvature model...");
612  mos_global_trace(slits, polytraces, cmode);
613  }
614 
615  if (dfs_save_table(frameset, traces, curv_traces_tag, NULL, parlist,
616  recipe, version))
617  fors_trace_flat_exit(NULL);
618 
619  cpl_table_delete(traces); traces = NULL;
620 
621  nx = cpl_image_get_size_x(master_flat);
622  ny = cpl_image_get_size_y(master_flat);
623  coordinate = cpl_image_new(nx, ny, CPL_TYPE_FLOAT);
624 
625  spatial = mos_spatial_calibration(master_flat, slits, polytraces,
626  reference,
627  startwavelength, endwavelength,
628  dispersion, 0, coordinate);
629 
630  cpl_image_delete(master_flat); master_flat = NULL;
631  cpl_image_delete(spatial); spatial = NULL;
632 
633  if (dfs_save_image(frameset, coordinate, spatial_map_tag, header,
634  parlist, recipe, version))
635  fors_trace_flat_exit(NULL);
636 
637  cpl_image_delete(coordinate); coordinate = NULL;
638  cpl_propertylist_delete(header); header = NULL;
639 
640  if (dfs_save_table(frameset, slits, slit_location_tag, NULL,
641  parlist, recipe, version))
642  fors_trace_flat_exit(NULL);
643 
644  cpl_table_delete(slits); slits = NULL;
645 
646  if (dfs_save_table(frameset, polytraces, curv_coeff_tag, NULL,
647  parlist, recipe, version))
648  fors_trace_flat_exit(NULL);
649 
650  cpl_table_delete(polytraces); polytraces = NULL;
651 
652  return 0;
653 }
cpl_image * mos_spatial_calibration(cpl_image *spectra, cpl_table *slits, cpl_table *polytraces, double reference, double blue, double red, double dispersion, int flux, cpl_image *calibration)
Spatial remapping of CCD spectra eliminating the spectral curvature.
Definition: moses.c:8264
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_table * mos_load_slits_fors_mxu(cpl_propertylist *header)
Create slit location table from FITS header of FORS2-MXU data.
Definition: moses.c:14561
cpl_table * mos_load_slits_fors_mos(cpl_propertylist *header, int *nslits_out_det)
Create slit location table from FITS header of FORS1/2 MOS data.
Definition: moses.c:14801
cpl_table * mos_poly_trace(cpl_table *slits, cpl_table *traces, int order)
Fit spectral traces.
Definition: moses.c:7922
int dfs_equal_keyword(cpl_frameset *frameset, const char *keyword)
Saving table data of given category.
Definition: fors_dfs.c:1685
cpl_error_code mos_global_trace(cpl_table *slits, cpl_table *polytraces, int mode)
Recompute tracing coefficients globally.
Definition: moses.c:8083
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
cpl_table * dfs_load_table(cpl_frameset *frameset, const char *category, int ext)
Loading table data of given category.
Definition: fors_dfs.c:901
cpl_table * mos_trace_flat(cpl_image *flat, cpl_table *slits, double reference, double blue, double red, double dispersion)
Trace flat field spectra.
Definition: moses.c:7488
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
int dfs_save_table(cpl_frameset *frameset, const cpl_table *table, const char *category, cpl_propertylist *header, const cpl_parameterlist *parlist, const char *recipename, const char *version)
Saving table data of given category.
Definition: fors_dfs.c:1574
Definition: list.c:74
double dfs_get_parameter_double(cpl_parameterlist *parlist, const char *name, const cpl_table *defaults)
Reading a recipe double parameter value.
Definition: fors_dfs.c:489