VISIR Pipeline Reference Manual  4.1.0
visir_spc_obs_ech.c
1 /* $Id: visir_spc_obs_ech.c,v 1.98 2012-09-27 15:45:07 jtaylor Exp $
2  *
3  * This file is part of the VISIR Pipeline
4  * Copyright (C) 2002,2003,2012 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 02111-1307 USA
19  */
20 
21 /*
22  * $Author: jtaylor $
23  * $Date: 2012-09-27 15:45:07 $
24  * $Revision: 1.98 $
25  * $Name: not supported by cvs2svn $
26  */
27 
28 #ifdef HAVE_CONFIG_H
29 #include <config.h>
30 #endif
31 
32 /*-----------------------------------------------------------------------------
33  Includes
34  -----------------------------------------------------------------------------*/
35 
36 #include "visir_recipe.h"
37 #include "visir_spectro.h"
38 #include "visir_spc_distortion.h"
39 #include "visir_spc_photom.h"
40 
41 
42 /*-----------------------------------------------------------------------------
43  Defines
44  -----------------------------------------------------------------------------*/
45 
46 #define RECIPE_STRING "visir_old_spc_obs_ech"
47 
48 /* FITS keys to be loaded for all raw files */
49 #define RECIPE_KEYS_REGEXP_ALL \
50  VISIR_PFITS_REGEXP_IMG_RECOMBINE \
51  "|" VISIR_PFITS_REGEXP_SPC_GET_RES_WL
52 
53 /* FITS keys to be loaded for first raw file */
54 #define RECIPE_KEYS_REGEXP \
55  RECIPE_KEYS_REGEXP_ALL \
56  "|" VISIR_PFITS_REGEXP_CAPA \
57  "|" VISIR_PFITS_REGEXP_SPC_WCAL_PAF
58 
59 /* FITS keys to be loaded for first raw file, in case WCS is used */
60 #define RECIPE_KEYS_REGEXP_WCS \
61  RECIPE_KEYS_REGEXP \
62  "|" IRPLIB_PFITS_WCS_REGEXP
63 
64 #define RAW_INPUT 0
65 #define PREPROCESSED_INPUT 1
66 
67 /*-----------------------------------------------------------------------------
68  Private Functions prototypes
69  -----------------------------------------------------------------------------*/
70 static cpl_error_code visir_spc_ech_save(cpl_frameset *,
71  const cpl_parameterlist *,
72  const cpl_propertylist *,
73  const cpl_propertylist *,
74  const cpl_image *,
75  const cpl_image *,
76  const cpl_table *,
77  const char *,
78  const char *,
79  const char *);
80 
81 VISIR_RECIPE_DEFINE(visir_old_spc_obs_ech,
82  VISIR_PARAM_ZERODIST | VISIR_PARAM_ORDEROFF |
83  VISIR_PARAM_EMIS_TOL |
84  VISIR_PARAM_REFINE | VISIR_PARAM_XCORR |
85  VISIR_PARAM_OFFSETS | VISIR_PARAM_OBJECTS |
86  VISIR_PARAM_NODPOS | VISIR_PARAM_AUTOBPM |
87  VISIR_PARAM_GLITCH | VISIR_PARAM_PURGE |
88  VISIR_PARAM_UNION | VISIR_PARAM_REJECT |
89  VISIR_PARAM_STRIPITE | VISIR_PARAM_STRIPMOR |
90  VISIR_PARAM_PLOT | VISIR_PARAM_SLITSKEW |
91  VISIR_PARAM_SPECSKEW | VISIR_PARAM_VERTARC |
92  VISIR_PARAM_REJLEFT | VISIR_PARAM_REJRIGHT |
93  VISIR_PARAM_HORIARC | VISIR_PARAM_FIXCOMBI |
94  VISIR_PARAM_BKG_CORRECT,
95  "Old DRS detector: Spectroscopic Observation recipe in Echelle mode",
96  "This recipe estimates the dispersion relation using the "
97  "atmospheric spectrum\n"
98  "in a grism spectroscopy half-cycle frame.\n"
99  "It also extracts the spectrum of an observed object using "
100  "a combined frame.\n"
101  "The files listed in the Set Of Frames (sof-file) "
102  "must be tagged:\n"
103  "VISIR-Echelle-Spectroscopy-file.fits "
104  VISIR_SPC_OBS_ECH_RAW "\n"
105  "VISIR-Quantum-Efficiency-Calibration-file.fits "
106  VISIR_CALIB_QEFF_SPC "\n"
107  "VISIR-Atmospheric-Emission-Lines-Calibration-file.fits "
108  VISIR_CALIB_LINES_SPC
109  "\n"
110  MAN_VISIR_CALIB_BPM_SPC);
111 
112 /*-----------------------------------------------------------------------------
113  Static variables
114  -----------------------------------------------------------------------------*/
115 
116 /*----------------------------------------------------------------------------*/
120 /*----------------------------------------------------------------------------*/
121 
122 /*-----------------------------------------------------------------------------
123  Functions code
124  -----------------------------------------------------------------------------*/
125 
126 /*----------------------------------------------------------------------------*/
133 /*----------------------------------------------------------------------------*/
134 static int visir_old_spc_obs_ech(cpl_frameset * framelist,
135  const cpl_parameterlist * parlist)
136 {
137  irplib_framelist * allframes = NULL;
138  irplib_framelist * rawframes = NULL;
139  irplib_framelist * skyframes = NULL;
140  cpl_propertylist * qclist = cpl_propertylist_new();
141  cpl_propertylist * paflist = cpl_propertylist_new();
142  const char * badpix;
143  const char * star_cat;
144  const char * spc_cal_qeff;
145  const char * spc_cal_lines;
146  const char * flat;
147  cpl_image * combined = NULL;
148  cpl_image * flipped = NULL;
149  cpl_image * comnarrow = NULL;
150  cpl_imagelist * hcycle = NULL;
151  cpl_table * spc_table = NULL;
152  cpl_image * weight2d = NULL;
153  cpl_image * imhcycle = NULL;
154  cpl_image * imhcyclenarrow = NULL;
155  cpl_image ** combinedpair;
156  double wlen, slitw, temp, fwhm;
157  visir_spc_resol resol;
158  cpl_boolean drop_wcs;
159  int input_mode;
160  cpl_boolean bkgcorrect;
161  cpl_errorstate cleanstate = cpl_errorstate_get();
162  visir_spc_config spc_config;
163  const char * dit_key = VISIR_PFITS_DOUBLE_DIT;
164  cpl_boolean has_phot = CPL_FALSE;
165 
166  spc_config.recipename = RECIPE_STRING;
167  spc_config.parlist = parlist;
168  spc_config.orderoffset = 0;
169  spc_config.phot_emis_tol = 1.0;
170 
171  /* Retrieve input parameters */
172  spc_config.plot =
173  visir_parameterlist_get_int(parlist, RECIPE_STRING, VISIR_PARAM_PLOT);
174 
175  spc_config.phi =
176  visir_parameterlist_get_double(parlist,RECIPE_STRING,VISIR_PARAM_SLITSKEW);
177  spc_config.ksi =
178  visir_parameterlist_get_double(parlist,RECIPE_STRING,VISIR_PARAM_SPECSKEW);
179  spc_config.eps =
180  visir_parameterlist_get_double(parlist, RECIPE_STRING,VISIR_PARAM_VERTARC);
181  spc_config.delta =
182  visir_parameterlist_get_double(parlist, RECIPE_STRING,VISIR_PARAM_HORIARC);
183 
184  spc_config.orderoffset =
185  visir_parameterlist_get_int(parlist, RECIPE_STRING, VISIR_PARAM_ORDEROFF);
186 
187  spc_config.do_fixcombi = visir_parameterlist_get_bool(parlist, RECIPE_STRING,
188  VISIR_PARAM_FIXCOMBI);
189  spc_config.phot_emis_tol =
190  visir_parameterlist_get_double(parlist, RECIPE_STRING, VISIR_PARAM_EMIS_TOL);
191 
192  bkgcorrect = visir_parameterlist_get_bool(parlist, RECIPE_STRING,
193  VISIR_PARAM_BKG_CORRECT);
194  skip_if (0);
195 
196  /* Identify the RAW and CALIB frames in the input frameset */
197  skip_if (visir_dfs_set_groups(framelist));
198 
199  /* Objects observation */
200  allframes = irplib_framelist_cast(framelist);
201  skip_if(allframes == NULL);
202  rawframes = irplib_framelist_extract(allframes, VISIR_SPC_OBS_ECH_RAW);
203  if (rawframes == NULL) {
204  cpl_errorstate_set(cleanstate);
205  rawframes = irplib_framelist_extract(allframes, VISIR_SPC_OBS_ECH_PP);
206  skip_if (rawframes == NULL);
207  skyframes = irplib_framelist_extract(allframes, VISIR_SPC_OBS_SKYFRAME);
208  skip_if (skyframes == NULL);
209  input_mode = PREPROCESSED_INPUT;
210  cpl_msg_info(cpl_func, "Input: preprocessed data");
211  } else {
212  cpl_msg_info(cpl_func, "Input: raw data");
213  input_mode = RAW_INPUT;
214  }
215  skip_if (rawframes == NULL);
216 
217  irplib_framelist_empty(allframes);
218 
219  skip_if(irplib_framelist_load_propertylist_all(rawframes, 0, "^("
220  VISIR_PFITS_REGEXP_SPC_SENSIT
221  "|" RECIPE_KEYS_REGEXP_ALL
222  "|" RECIPE_KEYS_REGEXP_WCS
223  "|" VISIR_PFITS_REGEXP_DIT
224  "|" "ESO DRS .*"
225  "|" "ESO QC EXPTIME"
226  "|" "ESO QC BACKGD MEAN"
227  ")$", CPL_FALSE));
228 
229  skip_if(visir_dfs_check_framelist_tag(rawframes));
230 
231  if (cpl_propertylist_has(irplib_framelist_get_propertylist(rawframes, 0),
232  VISIR_PFITS_DOUBLE_SEQ1_DIT))
233  dit_key = VISIR_PFITS_DOUBLE_SEQ1_DIT;
234  skip_if(0);
235 
236  visir_data_type data_type;
237  cpl_propertylist * plist = irplib_framelist_get_propertylist(rawframes, 0);
238  const cpl_frame * frm = irplib_framelist_get_const(rawframes, 0);
239  skip_if(visir_get_data_type(frm, plist, &data_type, NULL));
240 
241  /* Standard star catalog */
242  star_cat = irplib_frameset_find_file(framelist, VISIR_CALIB_STDSTAR_SPC);
243 
244  /* Quantum efficiency file */
245  spc_cal_qeff = irplib_frameset_find_file(framelist, VISIR_CALIB_QEFF_SPC);
246 
247  /* Spectral lines calibration file */
248  spc_cal_lines = irplib_frameset_find_file(framelist, VISIR_CALIB_LINES_SPC);
249 
250  /* Bad pixels calibration file */
251  badpix = irplib_frameset_find_file(framelist, VISIR_CALIB_BPM);
252 
253  /* Flatfield calibration file */
254  flat = irplib_frameset_find_file(framelist, VISIR_CALIB_FLAT);
255 
256  /* Get Resolution and Central Wavelength */
257  resol = visir_spc_get_res_wl(rawframes, &wlen, &slitw, &temp, &fwhm,
258  visir_data_is_aqu(data_type));
259 
260  skip_if (0);
261 
262  if (resol != VISIR_SPC_R_GHR) {
263  if (spc_config.orderoffset == 0) {
264  cpl_msg_warning(cpl_func,"Reducing non-HR Grism data as main order");
265  } else {
266  cpl_msg_error(cpl_func, "This recipe cannot reduce non-HR Grism "
267  "data with an order-offset of %d",
268  spc_config.orderoffset);
269  visir_error_set(CPL_ERROR_TYPE_MISMATCH);
270  skip_if(1);
271  }
272  }
273 
274  if (input_mode == PREPROCESSED_INPUT) {
275  cpl_imagelist * imagelist = cpl_imagelist_new();
276  cpl_size nframes = irplib_framelist_get_size(rawframes);
277  const cpl_propertylist ** plists =
278  cpl_malloc(nframes * sizeof(cpl_propertylist *));
279  double bg_sum = 0;
280 
281  for (cpl_size i = 0; i < nframes; i++) {
282  cpl_frame * frame = irplib_framelist_get(rawframes, i);
283  const char * fname = cpl_frame_get_filename(frame);
284  const cpl_size next = cpl_fits_count_extensions(fname);
285  cpl_imagelist * tmplist = cpl_imagelist_new();
286  cpl_errorstate prestate = cpl_errorstate_get();
287  cpl_image * tmp;
288 
289  plists[i] = irplib_framelist_get_propertylist_const(rawframes, i);
290  if (cpl_propertylist_has(plists[i], "ESO QC BACKGD MEAN"))
291  bg_sum += cpl_propertylist_get_double(plists[i],
292  "ESO QC BACKGD MEAN");
293  skip_if(0);
294 
295  for (cpl_size j = 0; j < 1 + next; j++) {
296  cpl_image * img =
297  cpl_image_load(fname, CPL_TYPE_UNSPECIFIED, 0, j);
298  if (img == NULL) {
299  cpl_errorstate_set(prestate);
300  cpl_msg_info(cpl_func, "No image in extension %d", (int)j);
301  continue;
302  }
303  cpl_imagelist_set(tmplist, img, cpl_imagelist_get_size(tmplist));
304  skip_if(0);
305  }
306  tmp = cpl_imagelist_collapse_create(tmplist);
307 
308  skip_if (visir_spc_det_fix(&tmp, 1, CPL_TRUE,
309  wlen, resol,
310  spc_config.phi,
311  spc_config.ksi,
312  spc_config.eps,
313  spc_config.delta,
314  spc_config.plot));
315  cpl_imagelist_set(imagelist, tmp,
316  cpl_imagelist_get_size(imagelist));
317  cpl_imagelist_delete(tmplist);
318  }
319  combinedpair =
320  visir_img_recombine_list(RECIPE_STRING, parlist, imagelist,
321  plists, CPL_GEOM_FIRST, &drop_wcs);
322 
323 
324  cpl_propertylist_append_double(qclist, "ESO QC BACKGD MEAN",
325  bg_sum / nframes);
326  cpl_imagelist_delete(imagelist);
327  cpl_free(plists);
328  bug_if(0);
329 
330  /* FIXME: make use of multiple skyframes */
331  {
332  cpl_frame * frame = irplib_framelist_get(skyframes, 0);
333  const char * fname = cpl_frame_get_filename(frame);
334  imhcycle = cpl_image_load(fname, CPL_TYPE_UNSPECIFIED, 0, 0);//1);
335  skip_if(imhcycle == NULL);
336  }
337 
338  skip_if (visir_spc_det_fix(&imhcycle, 1, CPL_TRUE,
339  wlen, resol,
340  spc_config.phi,
341  spc_config.ksi,
342  spc_config.eps,
343  spc_config.delta,
344  spc_config.plot));
345 
346  } else if (input_mode == RAW_INPUT) {
347  combinedpair = visir_img_recombine(RECIPE_STRING, parlist, rawframes, badpix,
348  flat, CPL_GEOM_FIRST, &drop_wcs,
349  !spc_config.do_fixcombi, wlen, resol);
350 
351  /* Get the hcycle image from the reference file */
352  hcycle = visir_load_hcycle(rawframes, 0);
353  skip_if (0);
354 
355  imhcycle = cpl_imagelist_unset(hcycle, 0);
356 
357  skip_if (visir_spc_det_fix(&imhcycle, 1, CPL_FALSE,
358  wlen, resol,
359  spc_config.phi,
360  spc_config.ksi,
361  spc_config.eps,
362  spc_config.delta,
363  spc_config.plot));
364 
365  skip_if(visir_qc_append_background(qclist, rawframes, 0, 0));
366  }
367  else
368  bug_if(1);
369 
370  if (combinedpair == NULL) {
371  cpl_msg_error(cpl_func, "Could not combine the input frames");
372  skip_if (1);
373  }
374 
375  cpl_image_delete(combinedpair[1]);
376  combined = cpl_image_cast(combinedpair[0], CPL_TYPE_DOUBLE);
377  cpl_image_delete(combinedpair[0]);
378  cpl_free(combinedpair);
379 
380  /* Convert the combined image
381  * recipe only supported with drs data */
382  flipped = visir_spc_flip(combined, wlen, resol, VISIR_DATA_CUBE2);
383  skip_if (0);
384  cpl_image_delete(combined);
385  combined = flipped;
386  flipped = NULL;
387 
388  /* Convert the half cycle image
389  * recipe only supported with drs data */
390  flipped = visir_spc_flip(imhcycle, wlen, resol, VISIR_DATA_CUBE2);
391  skip_if (0);
392  cpl_image_delete(imhcycle);
393  imhcycle = flipped;
394  flipped = NULL;
395 
396  skip_if (0);
397 
398  skip_if (spc_config.do_fixcombi && input_mode == RAW_INPUT &&
399  visir_spc_det_fix(&combined, 1, CPL_TRUE,
400  wlen, resol,
401  spc_config.phi,
402  spc_config.ksi,
403  spc_config.eps,
404  spc_config.delta,
405  spc_config.plot));
406 
407  skip_if(visir_spc_extract_order(&imhcyclenarrow, &comnarrow,
408  combined, imhcycle, wlen,
409  &spc_config, CPL_TRUE,
410  visir_data_is_aqu(data_type)));
411 
412  skip_if (visir_spc_extract_wcal(comnarrow, imhcyclenarrow,
413  wlen, slitw, temp, fwhm,
414  resol, spc_config.orderoffset,
415  spc_cal_lines, spc_cal_qeff,
416  &spc_table, &weight2d, qclist,
417  spc_config.plot, bkgcorrect,
418  visir_data_is_aqu(data_type)));
419 
420 
421  bug_if (visir_spectro_qc(qclist, paflist, drop_wcs, rawframes, NULL,
422  "^(" VISIR_PFITS_REGEXP_SPC_WCAL_PAF ")$"));
423 
424  if (star_cat) {
425  cpl_errorstate prestate = cpl_errorstate_get();
426  const cpl_propertylist * plist =
428  skip_if(0);
429  if (visir_spc_phot_sensit(rawframes, &spc_config, plist, star_cat,
430  &weight2d, qclist, spc_table, dit_key)) {
431  irplib_error_recover(prestate, "Could not perform photometric "
432  "calibration");
433  } else {
434  has_phot = CPL_TRUE;
435  }
436  } else {
437  /* This column is not part of the product */
438  skip_if (cpl_table_erase_column(spc_table, "SPC_EMISSIVITY"));
439  }
440 
441  irplib_framelist_empty(rawframes);
442 
443  /* Save the spectrum */
444  cpl_msg_info(cpl_func, "Saving the produced spectrum");
445 
446  /* PRO.CATG */
447  bug_if (cpl_propertylist_append_string(paflist, CPL_DFS_PRO_CATG,
448  VISIR_SPC_OBS_ECH_COMBINED_PROCATG));
449 
450  if (has_phot)
451  skip_if (visir_spc_ech_save(framelist, parlist, qclist, paflist,
452  combined, weight2d, spc_table,
453  VISIR_SPC_PHOT_ECH_TAB_PROCATG,
454  VISIR_SPC_PHOT_ECH_COMBINED_PROCATG,
455  VISIR_SPC_PHOT_ECH_WEIGHT_PROCATG));
456  else
457  skip_if (visir_spc_ech_save(framelist, parlist, qclist, paflist,
458  combined, weight2d, spc_table,
459  VISIR_SPC_OBS_ECH_TAB_PROCATG,
460  VISIR_SPC_OBS_ECH_COMBINED_PROCATG,
461  VISIR_SPC_OBS_ECH_WEIGHT_PROCATG));
462 
463  end_skip;
464 
465  cpl_propertylist_delete(qclist);
466  cpl_propertylist_delete(paflist);
467  irplib_framelist_delete(allframes);
468  irplib_framelist_delete(rawframes);
469  irplib_framelist_delete(skyframes);
470  cpl_image_delete(flipped);
471  cpl_image_delete(combined);
472  cpl_image_delete(comnarrow);
473  cpl_image_delete(imhcyclenarrow);
474  cpl_table_delete(spc_table);
475  cpl_image_delete(weight2d);
476  cpl_image_delete(imhcycle);
477  cpl_imagelist_delete(hcycle);
478 
479  return cpl_error_get_code();
480 }
481 
482 
483 /*----------------------------------------------------------------------------*/
498 /*----------------------------------------------------------------------------*/
499 static cpl_error_code visir_spc_ech_save(cpl_frameset * set,
500  const cpl_parameterlist * parlist,
501  const cpl_propertylist * qclist,
502  const cpl_propertylist * paflist,
503  const cpl_image * combined,
504  const cpl_image * weight2d,
505  const cpl_table * table,
506  const char * tab_procatg,
507  const char * com_procatg,
508  const char * wgt_procatg)
509 {
510 
511  bug_if (0);
512 
513  /* THE TABLE */
514  skip_if (irplib_dfs_save_table(set, parlist, set, table, NULL, RECIPE_STRING,
515  tab_procatg,
516  qclist, NULL, visir_pipe_id,
517  RECIPE_STRING "_tab" CPL_DFS_FITS));
518 
519  /* THE COMBINED IMAGE */
520  skip_if (irplib_dfs_save_image(set, parlist, set, combined, CPL_BPP_IEEE_FLOAT,
521  RECIPE_STRING, com_procatg,
522  qclist, NULL, visir_pipe_id,
523  RECIPE_STRING CPL_DFS_FITS));
524 
525  /* THE WEIGHT IMAGE */
526  skip_if (irplib_dfs_save_image(set, parlist, set, weight2d, CPL_BPP_IEEE_FLOAT,
527  RECIPE_STRING, wgt_procatg,
528  qclist, NULL, visir_pipe_id,
529  RECIPE_STRING "_weight" CPL_DFS_FITS));
530 
531 #ifdef VISIR_SAVE_PAF
532  /* THE PAF FILE FOR QC PARAMETERS */
533 
534  skip_if (cpl_dfs_save_paf("VISIR", RECIPE_STRING, paflist,
535  RECIPE_STRING CPL_DFS_PAF));
536 #else
537  bug_if(paflist == NULL);
538 #endif
539 
540  end_skip;
541 
542  return cpl_error_get_code();
543 
544 }
double visir_parameterlist_get_double(const cpl_parameterlist *self, const char *recipe, visir_parameter bitmask)
Retrieve the value of a VISIR parameter of type double.
cpl_error_code visir_dfs_check_framelist_tag(const irplib_framelist *self)
Check the tags in a frameset (group raw only)
Definition: visir_dfs.c:173
cpl_error_code irplib_dfs_save_table(cpl_frameset *allframes, const cpl_parameterlist *parlist, const cpl_frameset *usedframes, const cpl_table *table, const cpl_propertylist *tablelist, const char *recipe, const char *procat, const cpl_propertylist *applist, const char *remregexp, const char *pipe_id, const char *filename)
Save a table as a DFS-compliant pipeline product.
Definition: irplib_utils.c:335
cpl_error_code visir_spc_phot_sensit(const irplib_framelist *rawframes, const visir_spc_config *pconfig, const cpl_propertylist *plist, const char *star_cat, cpl_image **pweight2d, cpl_propertylist *qclist, cpl_table *spc_table, const char *dit_key)
Compute the sensitivity from an extracted spectrum.
int visir_parameterlist_get_int(const cpl_parameterlist *self, const char *recipe, visir_parameter bitmask)
Retrieve the value of a VISIR integer parameter.
cpl_image ** visir_img_recombine_list(const char *recipename, const cpl_parameterlist *parlist, cpl_imagelist *nodded, const cpl_propertylist **plists, cpl_geom_combine combine_mode, cpl_boolean *pdid_resize)
The VISIR imaging combination using cross correlation.
cpl_boolean visir_parameterlist_get_bool(const cpl_parameterlist *self, const char *recipe, visir_parameter bitmask)
Retrieve the value of a VISIR boolean parameter.
const cpl_propertylist * irplib_framelist_get_propertylist_const(const irplib_framelist *self, int pos)
Get the propertylist of the specified frame in the framelist.
void irplib_framelist_empty(irplib_framelist *self)
Erase all frames from a framelist.
cpl_error_code irplib_dfs_save_image(cpl_frameset *allframes, const cpl_parameterlist *parlist, const cpl_frameset *usedframes, const cpl_image *image, cpl_type_bpp bpp, const char *recipe, const char *procat, const cpl_propertylist *applist, const char *remregexp, const char *pipe_id, const char *filename)
Save an image as a DFS-compliant pipeline product.
Definition: irplib_utils.c:192
cpl_error_code irplib_framelist_load_propertylist_all(irplib_framelist *self, int ind, const char *regexp, cpl_boolean invert)
Load the propertylists of all frames in the framelist.
cpl_frame * irplib_framelist_get(irplib_framelist *self, int pos)
Get the specified frame from the framelist.
irplib_framelist * irplib_framelist_extract(const irplib_framelist *self, const char *tag)
Extract the frames with the given tag from a framelist.
int visir_dfs_set_groups(cpl_frameset *set)
Set the group as RAW or CALIB in a frameset.
Definition: visir_dfs.c:72
const cpl_frame * irplib_framelist_get_const(const irplib_framelist *self, int pos)
Get the specified frame from the framelist.
void irplib_framelist_delete(irplib_framelist *self)
Deallocate an irplib_framelist with its frames and properties.
const char * irplib_frameset_find_file(const cpl_frameset *self, const char *tag)
Find the filename with the given tag in a frame set.
cpl_propertylist * irplib_framelist_get_propertylist(irplib_framelist *self, int pos)
Get the propertylist of the specified frame in the framelist.
cpl_imagelist * visir_load_hcycle(const irplib_framelist *rawframes, int pos)
Load the HCYCLE images from a VISIR file.
irplib_framelist * irplib_framelist_cast(const cpl_frameset *frameset)
Create an irplib_framelist from a cpl_framelist.
int irplib_framelist_get_size(const irplib_framelist *self)
Get the size of a framelist.
cpl_image ** visir_img_recombine(const char *recipename, const cpl_parameterlist *parlist, const irplib_framelist *rawframes, const char *badpix, const char *flat, cpl_geom_combine combine_mode, cpl_boolean *pdid_resize, cpl_boolean do_spc_fix, double wlen, visir_spc_resol resol)
The VISIR imaging combination using cross correlation.