GRAVI Pipeline Reference Manual 1.9.4
Loading...
Searching...
No Matches
gravity_wavelamp.c
Go to the documentation of this file.
1/* $Id: gravity_wavelamp.c,v 1.29 2015/01/10 09:16:12 nazouaoui Exp $
2 *
3 * This file is part of the GRAVI Pipeline
4 * Copyright (C) 2002,2003 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20
21/*
22 * $Author: nazouaoui $
23 * $Date: 2015/01/10 09:16:12 $
24 * $Revision: 1.29 $
25 * $Name: $
26 *
27 * History :
28 * ekw 07/12/2018 Add wave_param frameset
29 */
30
31#ifdef HAVE_CONFIG_H
32#include <config.h>
33#endif
34
35/*-----------------------------------------------------------------------------
36 Includes
37 -----------------------------------------------------------------------------*/
38
39#include <cpl.h>
40#include <stdio.h>
41#include <string.h>
42#include <time.h>
43
44#include "gravi_data.h"
45#include "gravi_pfits.h"
46#include "gravi_dfs.h"
47
48#include "gravi_utils.h"
49
50#include "gravi_calib.h"
51#include "gravi_wave.h"
52#include "gravi_preproc.h"
53#include "gravi_disp.h"
54
55/*-----------------------------------------------------------------------------
56 Private function prototypes
57 -----------------------------------------------------------------------------*/
58
59static int gravity_wavelamp_create(cpl_plugin *);
60static int gravity_wavelamp_exec(cpl_plugin *);
61static int gravity_wavelamp_destroy(cpl_plugin *);
62static int gravity_wavelamp(cpl_frameset *, const cpl_parameterlist *);
63
64/*-----------------------------------------------------------------------------
65 Static variables
66 -----------------------------------------------------------------------------*/
67
68static char gravity_wavelamp_short[] = "Measure the position of the Argon lines in the spectra.";
70"This recipe is associated to the template gravity_wavelamp.\n"
71"It reduces the raw file obtained with the Argon lamp (WAVELAMP) and process it so that it can be used to calibrate the fiber dispersion (recipe gravity_disp).\n"
73 "* Extract the spectra of the Argon exposure\n"
74 "* Interpolate the spectra into a common wavelength table\n"
75 "* Measure the wavelength position of known Argon lines\n"
76 "* Write the product\n"
78 GRAVI_FLAT_MAP" : flat calibration (PRO.CATG="GRAVI_FLAT_MAP")\n"
79 GRAVI_BAD_MAP" : badpixel calibration (PRO.CATG="GRAVI_BAD_MAP") \n"
80 GRAVI_WAVE_MAP" : wave calibration (PRO.CATG="GRAVI_WAVE_MAP")\n"
81 GRAVI_P2VM_MAP" : p2vm calibration (PRO.CATG="GRAVI_P2VM_MAP")\n"
82 GRAVI_WAVELAMP_RAW" : long exposure of Argon lamp\n"
83 GRAVI_DARK_RAW" : dark of Argon exposure\n"
85 GRAVI_WAVELAMP_MAP" : spectrum of Argon, with position of lines\n"
86 "";
87
88/*-----------------------------------------------------------------------------
89 Function code
90 -----------------------------------------------------------------------------*/
91
92/*----------------------------------------------------------------------------*/
102/*----------------------------------------------------------------------------*/
103int cpl_plugin_get_info(cpl_pluginlist * list)
104{
105 cpl_recipe * recipe = cpl_calloc(1, sizeof *recipe );
106 cpl_plugin * plugin = &recipe->interface;
107
108 if (cpl_plugin_init(plugin,
109 CPL_PLUGIN_API,
110 GRAVI_BINARY_VERSION,
111 CPL_PLUGIN_TYPE_RECIPE,
112 "gravity_wavelamp",
115 "Nabih Azouaoui, Vincent Lapeyrere, JB. Le Bouquin",
116 PACKAGE_BUGREPORT,
121 cpl_msg_error(cpl_func, "Plugin initialization failed");
122 (void)cpl_error_set_where(cpl_func);
123 return 1;
124 }
125
126 if (cpl_pluginlist_append(list, plugin)) {
127 cpl_msg_error(cpl_func, "Error adding plugin to list");
128 (void)cpl_error_set_where(cpl_func);
129 return 1;
130 }
131
132 return 0;
133}
134
135/*----------------------------------------------------------------------------*/
143/*----------------------------------------------------------------------------*/
144static int gravity_wavelamp_create(cpl_plugin * plugin)
145{
146 cpl_recipe * recipe;
147
148 /* Do not create the recipe if an error code is already set */
149 if (cpl_error_get_code() != CPL_ERROR_NONE) {
150 cpl_msg_error(cpl_func, "%s():%d: An error is already set: %s",
151 cpl_func, __LINE__, cpl_error_get_where());
152 return (int)cpl_error_get_code();
153 }
154
155 if (plugin == NULL) {
156 cpl_msg_error(cpl_func, "Null plugin");
157 cpl_ensure_code(0, (int)CPL_ERROR_NULL_INPUT);
158 }
159
160 /* Verify plugin type */
161 if (cpl_plugin_get_type(plugin) != CPL_PLUGIN_TYPE_RECIPE) {
162 cpl_msg_error(cpl_func, "Plugin is not a recipe");
163 cpl_ensure_code(0, (int)CPL_ERROR_TYPE_MISMATCH);
164 }
165
166 /* Get the recipe */
167 recipe = (cpl_recipe *)plugin;
168
169 /* Create the parameters list in the cpl_recipe object */
170 recipe->parameters = cpl_parameterlist_new();
171 if (recipe->parameters == NULL) {
172 cpl_msg_error(cpl_func, "Parameter list allocation failed");
173 cpl_ensure_code(0, (int)CPL_ERROR_ILLEGAL_OUTPUT);
174 }
175
176 /* Fill the parameters list */
177 gravi_parameter_add_static_name (recipe->parameters);
178
179 return 0;
180}
181
182/*----------------------------------------------------------------------------*/
188/*----------------------------------------------------------------------------*/
189static int gravity_wavelamp_exec(cpl_plugin * plugin)
190{
191
192 cpl_recipe * recipe;
193 int recipe_status;
194 cpl_errorstate initial_errorstate = cpl_errorstate_get();
195
196 /* Return immediately if an error code is already set */
197 if (cpl_error_get_code() != CPL_ERROR_NONE) {
198 cpl_msg_error(cpl_func, "%s():%d: An error is already set: %s",
199 cpl_func, __LINE__, cpl_error_get_where());
200 return (int)cpl_error_get_code();
201 }
202
203 if (plugin == NULL) {
204 cpl_msg_error(cpl_func, "Null plugin");
205 cpl_ensure_code(0, (int)CPL_ERROR_NULL_INPUT);
206 }
207
208 /* Verify plugin type */
209 if (cpl_plugin_get_type(plugin) != CPL_PLUGIN_TYPE_RECIPE) {
210 cpl_msg_error(cpl_func, "Plugin is not a recipe");
211 cpl_ensure_code(0, (int)CPL_ERROR_TYPE_MISMATCH);
212 }
213
214 /* Get the recipe */
215 recipe = (cpl_recipe *)plugin;
216
217 /* Verify parameter and frame lists */
218 if (recipe->parameters == NULL) {
219 cpl_msg_error(cpl_func, "Recipe invoked with NULL parameter list");
220 cpl_ensure_code(0, (int)CPL_ERROR_NULL_INPUT);
221 }
222 if (recipe->frames == NULL) {
223 cpl_msg_error(cpl_func, "Recipe invoked with NULL frame set");
224 cpl_ensure_code(0, (int)CPL_ERROR_NULL_INPUT);
225 }
226
227 /* Invoke the recipe */
228 recipe_status = gravity_wavelamp(recipe->frames, recipe->parameters);
229
230 /* Ensure DFS-compliance of the products */
231
232 if (cpl_dfs_update_product_header(recipe->frames)) {
233 if (!recipe_status){
234 recipe_status = (int)cpl_error_get_code();
235 }
236 }
237
238 if (!cpl_errorstate_is_equal(initial_errorstate)) {
239 /* Dump the error history since recipe execution start.
240 At this point the recipe cannot recover from the error */
241 cpl_errorstate_dump(initial_errorstate, CPL_FALSE, NULL);
242 }
243
244 return recipe_status;
245}
246
247/*----------------------------------------------------------------------------*/
253/*----------------------------------------------------------------------------*/
254static int gravity_wavelamp_destroy(cpl_plugin * plugin)
255{
256 cpl_recipe * recipe;
257
258 if (plugin == NULL) {
259 cpl_msg_error(cpl_func, "Null plugin");
260 cpl_ensure_code(0, (int)CPL_ERROR_NULL_INPUT);
261 }
262
263 /* Verify plugin type */
264 if (cpl_plugin_get_type(plugin) != CPL_PLUGIN_TYPE_RECIPE) {
265 cpl_msg_error(cpl_func, "Plugin is not a recipe");
266 cpl_ensure_code(0, (int)CPL_ERROR_TYPE_MISMATCH);
267 }
268
269 /* Get the recipe */
270 recipe = (cpl_recipe *)plugin;
271
272 cpl_parameterlist_delete(recipe->parameters);
273
274 return 0;
275}
276
277
278/*----------------------------------------------------------------------------*/
286/*----------------------------------------------------------------------------*/
287static int gravity_wavelamp(cpl_frameset * frameset,
288 const cpl_parameterlist * parlist)
289{
290 cpl_frameset * wavecalib_frameset = NULL,
291 * badcalib_frameset = NULL, * flatcalib_frameset = NULL,
292 * p2vmcalib_frameset = NULL, * dark_frameset = NULL,
293 * wavelamp_frameset = NULL, * used_frameset = NULL,
294 * darkcalib_frameset = NULL, *wave_param_frameset= NULL;
295
296 cpl_frame * frame;
297
298 gravi_data * data = NULL, * dark_map = NULL, * wave_map = NULL,
299 * profile_map = NULL, * badpix_map = NULL, * preproc_data = NULL, * p2vm_map = NULL,
300 * wave_param = NULL;
301
302 /* Message */
305
306 cpl_ensure_code(gravi_dfs_set_groups(frameset) == CPL_ERROR_NONE,
307 cpl_error_get_code()) ;
308
309 /* Identify the input framesets */
310 wavelamp_frameset = gravi_frameset_extract_wavelamp_data (frameset);
311 dark_frameset = gravi_frameset_extract_dark_data (frameset);
312 darkcalib_frameset = gravi_frameset_extract_dark_map (frameset);
313 p2vmcalib_frameset = gravi_frameset_extract_p2vm_map (frameset);
314 wavecalib_frameset = gravi_frameset_extract_wave_map (frameset);
315 flatcalib_frameset = gravi_frameset_extract_flat_map (frameset);
316 badcalib_frameset = gravi_frameset_extract_bad_map (frameset);
317 /* EKW 07/12/2018 Extract new calibration file wave_param frameset */
318 wave_param_frameset = gravi_frameset_extract_wave_param (frameset);
319
320 /* Check input framesets */
321 if ( (cpl_frameset_is_empty (dark_frameset) &&
322 cpl_frameset_is_empty (darkcalib_frameset)) ||
323 cpl_frameset_is_empty (wavelamp_frameset) ||
324 cpl_frameset_is_empty (p2vmcalib_frameset) ||
325 cpl_frameset_is_empty (wavecalib_frameset) ||
326 cpl_frameset_is_empty (flatcalib_frameset) ||
327 cpl_frameset_is_empty (badcalib_frameset) ) {
328
329 cpl_error_set_message (cpl_func, CPL_ERROR_ILLEGAL_INPUT,
330 "Mising DARK, WAVELAMP, P2VM, WAVE, FLAT or BAD") ;
331 goto cleanup;
332 }
333
334 /* Insert calibration frame into the used frameset */
335 used_frameset = cpl_frameset_new();
336
337 /*
338 * Identify the DARK in the input frameset
339 */
340
341 if (!cpl_frameset_is_empty (dark_frameset)) {
342
343 frame = cpl_frameset_get_position (dark_frameset, 0);
344 data = gravi_data_load_rawframe (frame, used_frameset);
345 gravi_data_detector_cleanup (data, parlist);
346
347 /* Compute dark */
348 dark_map = gravi_compute_dark (data);
349 FREE (gravi_data_delete, data);
350
351 CPLCHECK_CLEAN ("Could not compute the DARK map");
352
353 /* Save the dark map */
354 gravi_data_save_new (dark_map, frameset, NULL, NULL, parlist,
355 NULL, frame, "gravity_wavelamp",
356 NULL, GRAVI_DARK_MAP);
357
358 CPLCHECK_CLEAN ("Could not save the DARK map");
359 }
360 else if (!cpl_frameset_is_empty (darkcalib_frameset)) {
361
362 frame = cpl_frameset_get_position (darkcalib_frameset, 0);
363 dark_map = gravi_data_load_frame (frame, used_frameset);
364
365 CPLCHECK_CLEAN ("Could not load the DARK map");
366 }
367 else
368 cpl_msg_info (cpl_func, "There is no DARK in the frame set");
369
370
371 /* Identify the BAD in the input frameset */
372 frame = cpl_frameset_get_position (badcalib_frameset, 0);
373 badpix_map = gravi_data_load_frame (frame, used_frameset);
374
375 /* Identify the FLAT in the input frameset */
376 frame = cpl_frameset_get_position (flatcalib_frameset, 0);
377 profile_map = gravi_data_load_frame (frame, used_frameset);
378
379 /* Identify the WAVE in the input frameset */
380 frame = cpl_frameset_get_position (wavecalib_frameset, 0);
381 wave_map = gravi_data_load_frame (frame, used_frameset);
382
383 /* Identify the P2VM in the input frameset */
384 frame = cpl_frameset_get_position (p2vmcalib_frameset, 0);
385 p2vm_map = gravi_data_load_frame (frame, used_frameset);
386
387 CPLCHECK_CLEAN ("Error while loading the calibration map");
388
389
390 /*
391 * Load input WAVELAMP_RAW
392 */
393 frame = cpl_frameset_get_position (wavelamp_frameset, 0);
394 data = gravi_data_load_rawframe (frame, used_frameset);
395 gravi_data_detector_cleanup (data, parlist);
396
397 /* Create output data (FIXME: probably not necessary) */
398 gravi_data * argon_data = gravi_data_new (0);
399 cpl_propertylist * argon_header = gravi_data_get_header (argon_data);
400 cpl_propertylist_append (argon_header, gravi_data_get_header (data));
401
402 /* Copy the IMAGING_DATA and IMAGING_DETECTOR extensions */
405
406 FREE (gravi_data_delete, data);
407
408 /* Collapse ARGON */
409 cpl_imagelist * imglist = gravi_data_get_cube (argon_data, GRAVI_IMAGING_DATA_SC_EXT);
410 cpl_image * img_median = cpl_imagelist_collapse_median_create (imglist);
411
412 /* Replace data in-place */
413 cpl_imagelist_empty (imglist);
414 cpl_imagelist_set (imglist, img_median, 0);
415
416 /* Extract spectrum */
417 preproc_data = gravi_extract_spectrum (argon_data, profile_map, dark_map,
418 badpix_map, NULL, parlist,
420 FREE (gravi_data_delete, argon_data);
421 CPLCHECK_CLEAN ("Cannot extract spectrum");
422
423 /* Compute the ARGON WAVE */
424 //cpl_table * spectrum_table, * argonwave_table;
425 //spectrum_table = gravi_data_get_spectrum_data (preproc_data, GRAVI_SC);
426 //argonwave_table = gravi_compute_argon_wave (spectrum_table);
427 //gravi_data_add_table (preproc_data, NULL, "WAVE_ARGON_RAW", argonwave_table);
428
429 /* Rescale to common wavelength */
430 gravi_align_spectrum (preproc_data, wave_map, p2vm_map, GRAVI_DET_ALL);
431 CPLCHECK_CLEAN ("Cannot re-interpolate spectrum");
432
433 /* Compute the ARGON WAVE */
434 //spectrum_table = gravi_data_get_spectrum_data (preproc_data, GRAVI_SC);
435 //argonwave_table = gravi_compute_argon_wave (spectrum_table);
436 //gravi_data_add_table (preproc_data, NULL, "WAVE_ARGON_RESAMP", argonwave_table);
437
438 /* START EKW 07/12/2018 read wave parameter from calibration file - Load the WAVE_PARAM Parameter */
439 cpl_frame *frame2;
440 if (!cpl_frameset_is_empty (wave_param_frameset)) {
441 frame2 = cpl_frameset_get_position (wave_param_frameset, 0);
442 wave_param = gravi_data_load_frame (frame2, used_frameset);
443 }
444 else
445 {
446 cpl_error_set_message (cpl_func, CPL_ERROR_ILLEGAL_INPUT,
447 "Missing is no WAVE_PARAM in the frameset") ;
448 goto cleanup;
449 }
450
451 /* END EKW 07/12/2018 read wave parameter from calibration file - Load the WAVE_PARAM Parameter */
452
453 /* Compute position */
454 gravi_compute_argon_pos (preproc_data, wave_param);
455
456 CPLCHECK_CLEAN ("Cannot compute the positions");
457
458 /* Compute QC params */
459 cpl_table * pos_argon = gravi_data_get_table (preproc_data, "POS_ARGON");
460 cpl_propertylist * product_header = gravi_data_get_header (preproc_data);
461 cpl_vector * wave_diff_all = cpl_vector_new(cpl_table_get_nrow(pos_argon));
462 for(unsigned short row = 0 ; row < (unsigned short)cpl_table_get_nrow(pos_argon) ; ++row)
463 {
464 char keyname[40];
465 int null;
466
467 snprintf(keyname, 39, "ESO QC WAVE%hu", row+1);
468 cpl_propertylist_update_double (product_header, keyname,
469 1e6 * cpl_table_get_double(pos_argon, "WAVE", row, &null));
470
471 snprintf(keyname, 39, "ESO QC WAVE TH%hu", row+1);
472 cpl_propertylist_update_double (product_header, keyname,
473 1e6 * cpl_table_get_double(pos_argon, "WAVE_TH", row, &null));
474
475 snprintf(keyname, 39, "ESO QC WAVE DIFF%hu", row+1);
476 double wave_diff = 1e6 * cpl_table_get_double(pos_argon, "DIFF", row, &null);
477 cpl_vector_set(wave_diff_all, row, wave_diff);
478 cpl_propertylist_update_double (product_header, keyname, wave_diff);
479 }
480 cpl_propertylist_update_double (product_header,
481 "ESO QC WAVE DIFF RMS", cpl_vector_get_stdev(wave_diff_all));
482
483 /* Save the output data file */
484 gravi_data_save_new (preproc_data, frameset, NULL, NULL, parlist,
485 used_frameset, frame, "gravity_wavelamp",
486 NULL, GRAVI_WAVELAMP_MAP);
487
488 CPLCHECK_CLEAN("Could not save the WAVELAMP");
489
490 /* Deallocation of all variables */
491 goto cleanup;
492
493cleanup :
494 cpl_msg_info(cpl_func,"Memory cleanup");
495 FREE (cpl_frameset_delete, wavelamp_frameset);
496 FREE (cpl_frameset_delete, wavecalib_frameset);
497 FREE (cpl_frameset_delete, badcalib_frameset);
498 FREE (cpl_frameset_delete, flatcalib_frameset);
499 FREE (cpl_frameset_delete, p2vmcalib_frameset);
500 FREE (cpl_frameset_delete, used_frameset);
501 FREE (cpl_frameset_delete, dark_frameset);
502 FREE (cpl_frameset_delete, darkcalib_frameset);
503 FREE (cpl_frameset_delete, wave_param_frameset);
504
505 FREE (gravi_data_delete, dark_map);
506 FREE (gravi_data_delete, wave_map);
507 FREE (gravi_data_delete, profile_map);
508 FREE (gravi_data_delete, badpix_map);
509 FREE (gravi_data_delete, p2vm_map);
510 FREE (gravi_data_delete, preproc_data);
511 FREE (gravi_data_delete, wave_param);
512
514 return (int)cpl_error_get_code();
515}
516
517
typedefCPL_BEGIN_DECLS struct _gravi_data_ gravi_data
Definition: gravi_data.h:39
#define gravi_data_get_header(data)
Definition: gravi_data.h:75
#define GRAVI_RECIPE_OUTPUT
Definition: gravi_dfs.h:39
#define GRAVI_DARK_RAW
Definition: gravi_dfs.h:46
#define GRAVI_P2VM_MAP
Definition: gravi_dfs.h:76
#define GRAVI_RECIPE_FLOW
Definition: gravi_dfs.h:37
#define GRAVI_BAD_MAP
Definition: gravi_dfs.h:73
#define GRAVI_WAVE_MAP
Definition: gravi_dfs.h:75
#define GRAVI_FLAT_MAP
Definition: gravi_dfs.h:74
#define GRAVI_WAVELAMP_MAP
Definition: gravi_dfs.h:85
#define GRAVI_DARK_MAP
Definition: gravi_dfs.h:77
#define GRAVI_RECIPE_INPUT
Definition: gravi_dfs.h:38
#define GRAVI_WAVELAMP_RAW
Definition: gravi_dfs.h:49
cpl_msg_info(cpl_func, "Compute WAVE_SCAN for %s", GRAVI_TYPE(type_data))
cpl_propertylist_update_double(header, "ESO QC MINWAVE SC", cpl_propertylist_get_double(plist, "ESO QC MINWAVE SC"))
@ GRAVI_DET_ALL
Definition: gravi_pfits.h:173
#define GRAVI_IMAGING_DATA_SC_EXT
Definition: gravi_pfits.h:44
#define GRAVI_IMAGING_DETECTOR_SC_EXT
Definition: gravi_pfits.h:81
#define CPLCHECK_CLEAN(msg)
Definition: gravi_utils.h:54
#define gravi_msg_function_exit(flag)
Definition: gravi_utils.h:85
#define FREE(function, variable)
Definition: gravi_utils.h:69
#define gravi_msg_function_start(flag)
Definition: gravi_utils.h:84
static char gravity_wavelamp_description[]
static int gravity_wavelamp_exec(cpl_plugin *)
Execute the plugin instance given by the interface.
int cpl_plugin_get_info(cpl_pluginlist *list)
Build the list of available plugins, for this module.
static int gravity_wavelamp_create(cpl_plugin *)
Setup the recipe options
static int gravity_wavelamp_destroy(cpl_plugin *)
Destroy what has been created by the 'create' function.
static int gravity_wavelamp(cpl_frameset *, const cpl_parameterlist *)
The perpese of the recipe is to reduce the raw calibration file for dispersion calibration.
static char gravity_wavelamp_short[]
gravi_data * gravi_compute_dark(gravi_data *raw_data)
Compute the DARK calibration map.
Definition: gravi_calib.c:125
gravi_data * gravi_data_new(int nb_ext)
Create an empty gravi_data.
Definition: gravi_data.c:110
gravi_data * gravi_data_load_frame(cpl_frame *frame, cpl_frameset *used_frameset)
Load a FITS file and create a gravi_data.
Definition: gravi_data.c:599
cpl_error_code gravi_data_detector_cleanup(gravi_data *data, const cpl_parameterlist *parlist)
Perform self-bias correction to the SC raw data.
Definition: gravi_data.c:1232
cpl_imagelist * gravi_data_get_cube(gravi_data *self, const char *extname)
Return a pointer on an IMAGE extension by its EXTNAME.
Definition: gravi_data.c:2131
cpl_table * gravi_data_get_table(gravi_data *self, const char *extname)
Return a pointer on a table extension by its EXTNAME.
Definition: gravi_data.c:2096
gravi_data * gravi_data_load_rawframe(cpl_frame *frame, cpl_frameset *used_frameset)
Load a RAW FITS file and create a gravi_data.
Definition: gravi_data.c:716
cpl_error_code gravi_data_save_new(gravi_data *self, cpl_frameset *allframes, const char *filename, const char *suffix, const cpl_parameterlist *parlist, cpl_frameset *usedframes, cpl_frame *frame, const char *recipe, cpl_propertylist *applist, const char *proCatg)
Save a gravi data in a CPL-complian FITS file.
Definition: gravi_data.c:925
cpl_error_code gravi_data_copy_ext(gravi_data *output, gravi_data *input, const char *name)
Copy extensions from one data to another.
Definition: gravi_data.c:1690
void gravi_data_delete(gravi_data *self)
Delete a gravi data.
Definition: gravi_data.c:146
cpl_parameter * gravi_parameter_add_static_name(cpl_parameterlist *self)
Definition: gravi_dfs.c:464
cpl_frameset * gravi_frameset_extract_wave_map(cpl_frameset *frameset)
Definition: gravi_dfs.c:1410
cpl_frameset * gravi_frameset_extract_bad_map(cpl_frameset *frameset)
Definition: gravi_dfs.c:1414
cpl_frameset * gravi_frameset_extract_dark_map(cpl_frameset *frameset)
Definition: gravi_dfs.c:1406
cpl_error_code gravi_dfs_set_groups(cpl_frameset *set)
Set the group as RAW or CALIB in a frameset.
Definition: gravi_dfs.c:78
cpl_frameset * gravi_frameset_extract_p2vm_map(cpl_frameset *frameset)
Definition: gravi_dfs.c:1398
cpl_frameset * gravi_frameset_extract_wave_param(cpl_frameset *frameset)
Definition: gravi_dfs.c:1434
cpl_frameset * gravi_frameset_extract_wavelamp_data(cpl_frameset *frameset)
Definition: gravi_dfs.c:1364
cpl_frameset * gravi_frameset_extract_flat_map(cpl_frameset *frameset)
Definition: gravi_dfs.c:1402
void gravity_print_banner(void)
Definition: gravi_dfs.c:61
cpl_frameset * gravi_frameset_extract_dark_data(cpl_frameset *frameset)
Extract DARK_RAW frame from the input frameset.
Definition: gravi_dfs.c:1311
cpl_error_code gravi_compute_argon_pos(gravi_data *preproc_data, gravi_data *wave_param)
Compute position of argon lines in SC spectrum.
Definition: gravi_disp.c:918
cpl_error_code gravi_align_spectrum(gravi_data *spectrum_data, gravi_data *wave_map, gravi_data *p2vm_map, enum gravi_detector_type det_type)
Regrid the regions into a common wavelength (in-place)
gravi_data * gravi_extract_spectrum(gravi_data *raw_data, gravi_data *profile_map, gravi_data *dark_map, gravi_data *bad_map, gravi_data *sky_map, const cpl_parameterlist *parlist, enum gravi_detector_type det_type)
Create the SPECTRUM gravi_data with extracted spectrum per region.
const char * gravi_get_license(void)
Get the pipeline copyright and license.
Definition: gravi_utils.c:104