VISIR Pipeline Reference Manual  4.1.7
visir_util_convert_weight.c
1 /* $Id: visir_util_convert_weight.c,v 1.16 2012-05-09 11:34:11 jtaylor Exp $
2  *
3  * This file is part of the VISIR Pipeline
4  * Copyright (C) 2011 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-05-09 11:34:11 $
24  * $Revision: 1.16 $
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 
38 /* Verify self-consistency of header files by including system files last */
39 #include <string.h>
40 
41 /*-----------------------------------------------------------------------------
42  Defines
43  -----------------------------------------------------------------------------*/
44 
45 #define RECIPE_STRING "visir_util_convert_weight"
46 
47 #define VISIR_FRAME_WEIGHT 0
48 #define VISIR_FRAME_ERROR 1
49 #define VISIR_FRAME_VARIANCE 2
50 
51 
52 /*-----------------------------------------------------------------------------
53  Private Functions prototypes
54  -----------------------------------------------------------------------------*/
55 
56 static cpl_error_code visir_util_convert_weight_one(cpl_frameset *,
57  irplib_framelist *,
58  const cpl_frame *, int,
59  const cpl_parameterlist *);
60 
61 cpl_recipe_define(visir_util_convert_weight, VISIR_BINARY_VERSION,
62  "Lars Lundin", PACKAGE_BUGREPORT, "2011",
63  "Conversion between different weight maps",
64  "The files listed in the Set Of Frames (sof-file) "
65  "must be tagged:\n"
66  "VISIR-weight-map.fits " VISIR_UTIL_WEIGHT_MAP " or\n"
67  "VISIR-error-map.fits " VISIR_UTIL_ERROR_MAP " or\n"
68  "VISIR-variance-map.fits " VISIR_UTIL_VARIANCE_MAP "\n"
69  "VISIR-bpm-file.fits " VISIR_CALIB_BPM " (optional)\n"
70  "\nThe relation between an error e, a weight w and a "
71  "variance v is:\n"
72  "e = sqrt(v) = 1/sqrt(w).\n"
73  "\n"
74  "Depending on the setting of the boolean recipe parameters "
75  "each input file will cause the following product(s) to be "
76  "created (each with a FITS card 'HIERARCH " CPL_DFS_PRO_CATG
77  "' with the specified value)\n"
78  VISIR_UTIL_ERROR_MAP_PROCATG
79  ": An error map, requires input v >= 0, w > 0\n"
80  VISIR_UTIL_WEIGHT_MAP_PROCATG
81  ": A weight map, requires input e > 0, v > 0\n"
82  VISIR_UTIL_VARIANCE_MAP_PROCATG
83  ": A variance map, requires input e >= 0, w > 0\n"
84  "If for a given input the identical output is specified, "
85  "the data unit(s) may still change according to the provided "
86  "bad pixel map\n"
87  "In a weight map product any bad pixel is set to 0.\n"
88  "In a variance or error map product any bad pixel is set to "
89  "the value specified by the relevant recipe option.");
90 
91 /*----------------------------------------------------------------------------*/
95 /*----------------------------------------------------------------------------*/
96 
97 /*-----------------------------------------------------------------------------
98  Functions code
99  -----------------------------------------------------------------------------*/
100 
101 
102 /*----------------------------------------------------------------------------*/
110 /*----------------------------------------------------------------------------*/
111 static cpl_error_code
112 visir_util_convert_weight_fill_parameterlist(cpl_parameterlist * self)
113 {
114  const char * context = PACKAGE "." RECIPE_STRING;
115  cpl_error_code err;
116 
117  cpl_ensure_code(self, CPL_ERROR_NULL_INPUT);
118 
119  /* Fill the parameters list */
120 
121  /* --error */
122  err = irplib_parameterlist_set_bool(self, PACKAGE, RECIPE_STRING, "error",
123  CPL_TRUE, NULL, context, "Convert to "
124  "error");
125  cpl_ensure_code(!err, err);
126 
127 
128  /* --weight */
129  err = irplib_parameterlist_set_bool(self, PACKAGE, RECIPE_STRING, "weight",
130  CPL_FALSE, NULL, context, "Convert to "
131  "weight. Bad pixels are seto to 0");
132  cpl_ensure_code(!err, err);
133 
134 
135  /* --variance */
136  err = irplib_parameterlist_set_bool(self, PACKAGE, RECIPE_STRING, "variance",
137  CPL_FALSE, NULL, context, "Convert to "
138  "variance. Bad pixels are seto to 0");
139  cpl_ensure_code(!err, err);
140 
141 
142  /* --bad_value */
143  err = irplib_parameterlist_set_double(self, PACKAGE, RECIPE_STRING,
144  "bad_value", FLT_MAX, NULL, context,
145  "The value to use for any bad pixel "
146  "in an error or variance map");
147  cpl_ensure_code(!err, err);
148 
149  /* --bad_flag */
150  err = irplib_parameterlist_set_bool(self, PACKAGE, RECIPE_STRING,
151  "bad_flag", CPL_TRUE, NULL, context,
152  "The value used to flag a bad pixel "
153  "in an input bad pixel map. True: 1. "
154  "False: 0.");
155  cpl_ensure_code(!err, err);
156 
157  return CPL_ERROR_NONE;
158 }
159 
160 
161 
162 /*----------------------------------------------------------------------------*/
169 /*----------------------------------------------------------------------------*/
170 static int visir_util_convert_weight(cpl_frameset * framelist,
171  const cpl_parameterlist * parlist)
172 {
173  cpl_error_code didfail = CPL_ERROR_NONE;
174  irplib_framelist * allframes = NULL;
175  irplib_framelist * rawframes = NULL;
176  const cpl_frame * bpmframe = NULL;
177  int i, n;
178 
179 
180  /* Identify the RAW and CALIB frames in the input frameset */
181  skip_if (visir_dfs_set_groups(framelist));
182  cpl_fits_set_mode(CPL_FITS_START_CACHING);
183 
184  /* Objects observation */
185  allframes = irplib_framelist_cast(framelist);
186  skip_if(allframes == NULL);
187  rawframes = irplib_framelist_extract_regexp(allframes, "^("
188  VISIR_UTIL_WEIGHT_MAP "|"
189  VISIR_UTIL_VARIANCE_MAP "|"
190  VISIR_UTIL_ERROR_MAP ")$",
191  CPL_FALSE);
192  skip_if (rawframes == NULL);
193  bpmframe = cpl_frameset_find_const(framelist, VISIR_CALIB_BPM);
194 
195  any_if("Propagating error");
196 
197  n = irplib_framelist_get_size(rawframes);
198  for (i = 0; i < n; i++) {
199 
200  skip_if (visir_util_convert_weight_one(framelist, rawframes, bpmframe,
201  i, parlist));
202  cpl_fits_set_mode(CPL_FITS_RESTART_CACHING);
203  }
204 
205  error_if(didfail, didfail, "Failed to convert data in %d frame(s)", n);
206 
207  end_skip;
208 
209  irplib_framelist_delete(allframes);
210  irplib_framelist_delete(rawframes);
211 
212  return cpl_error_get_code();
213 }
214 
215 
216 /*----------------------------------------------------------------------------*/
226 /*----------------------------------------------------------------------------*/
227 static
228 cpl_error_code visir_util_convert_weight_one(cpl_frameset * framelist,
229  irplib_framelist * rawframes,
230  const cpl_frame * bpmframe, int i,
231  const cpl_parameterlist * parlist)
232 {
233 
234  const int n = irplib_framelist_get_size(rawframes);
235  const cpl_boolean do_w = irplib_parameterlist_get_bool(parlist, PACKAGE,
236  RECIPE_STRING,
237  "weight");
238  const cpl_boolean do_e = irplib_parameterlist_get_bool(parlist, PACKAGE,
239  RECIPE_STRING,
240  "error");
241  const cpl_boolean do_v = irplib_parameterlist_get_bool(parlist, PACKAGE,
242  RECIPE_STRING,
243  "variance");
244  const double bad_val = irplib_parameterlist_get_double(parlist, PACKAGE,
245  RECIPE_STRING,
246  "bad_value");
247 
248  const cpl_boolean bad_flag = irplib_parameterlist_get_bool(parlist, PACKAGE,
249  RECIPE_STRING,
250  "bad_flag");
251 
252  cpl_errorstate prestate = cpl_errorstate_get();
253  cpl_frameset * products = cpl_frameset_new();
254  cpl_frameset * usedframes = cpl_frameset_new();
255  const cpl_frame * frame = irplib_framelist_get_const(rawframes, i);
256  const char * tag = cpl_frame_get_tag(frame);
257  const int frametype =
258  tag != NULL && !strcmp(tag, VISIR_UTIL_WEIGHT_MAP)
259  ? VISIR_FRAME_WEIGHT : (tag != NULL && !strcmp(tag, VISIR_UTIL_ERROR_MAP)
260  ? VISIR_FRAME_ERROR : VISIR_FRAME_VARIANCE);
261  const char * filename = cpl_frame_get_filename(frame);
262  const int next = cpl_fits_count_extensions(filename);
263  cpl_imagelist * map = NULL;
264  cpl_imagelist * emap = NULL;
265  cpl_imagelist * wmap = NULL;
266  cpl_imagelist * vmap = NULL;
267  const char * bpmname = bpmframe ? cpl_frame_get_filename(bpmframe)
268  : NULL;
269  const int mext = bpmname ? cpl_fits_count_extensions(bpmname)
270  : -1;
271  cpl_image * ibpm = NULL;
272  cpl_image * isqr = NULL;
273  cpl_image * ione = NULL;
274  cpl_image * idiv = NULL;
275  cpl_mask * bpm = NULL;
276  cpl_mask * bpmi = NULL;
277  cpl_propertylist * plist = NULL;
278 
279  char * eproname = do_e == CPL_FALSE ? NULL
280  : cpl_sprintf(RECIPE_STRING "_%03d_error" CPL_DFS_FITS, 1+i);
281  char * wproname = do_w == CPL_FALSE ? NULL
282  : cpl_sprintf(RECIPE_STRING "_%03d_weight" CPL_DFS_FITS, 1+i);
283  char * vproname = do_v == CPL_FALSE ? NULL
284  : cpl_sprintf(RECIPE_STRING "_%03d_variance" CPL_DFS_FITS, 1+i);
285  int iext;
286 
287  cpl_msg_info(cpl_func, "Converting %d Data unit(s) in frame %d/%d",
288  1+next, 1+i, n);
289 
290  any_if("Propagating error");
291 
292  if (bpmname != NULL) {
293  error_if(mext != 1 && mext != next, CPL_ERROR_INCOMPATIBLE_INPUT,
294  "Raw file %s has %d extension(s) <=> %d extension(s) of bpm-"
295  "file %s", filename, next, mext, bpmname);
296  }
297 
298  for (iext = 0; iext <= next; iext++) {
299 
300  /* Do not load the PRO.CATG */
301  cpl_propertylist_delete(plist);
302  plist = cpl_propertylist_load_regexp(filename, iext, CPL_DFS_PRO_CATG,
303  CPL_TRUE);
304 
305  skip_if(plist == NULL);
306 
307  if (emap != map) cpl_imagelist_delete(emap);
308  emap = NULL;
309  if (wmap != map) cpl_imagelist_delete(wmap);
310  wmap = NULL;
311  if (vmap != map) cpl_imagelist_delete(vmap);
312  vmap = NULL;
313 
314  cpl_imagelist_delete(map);
315  map = cpl_imagelist_load(filename, CPL_TYPE_FLOAT, iext);
316  if (!cpl_errorstate_is_equal(prestate)) {
317  cpl_errorstate_set(prestate);
318  } else {
319  /* FIXME: Use cpl_imagelist_power(map, -0.5);
320  once DFS10528 is fixed */
321  int j;
322  const int m = cpl_imagelist_get_size(map);
323 
324  if (iext <= mext) {
325  /* Get new bad pixel map, if any */
326  cpl_image_delete(ibpm);
327  ibpm = cpl_image_load(bpmname, CPL_TYPE_UNSPECIFIED, 0, iext);
328  cpl_mask_delete(bpm);
329  bpm = cpl_mask_threshold_image_create(ibpm, 0.5, DBL_MAX);
330  if (!bad_flag) cpl_mask_not(bpm);
331  skip_if(bpm == NULL);
332  }
333 
334  for (j = 0; j < m; j++) {
335  cpl_image * imap = cpl_imagelist_get(map, j);
336 
337  /* Reject anything non-positive */
338  cpl_mask_delete(bpmi);
339  bpmi = cpl_mask_threshold_image_create(imap, 0.0, DBL_MAX);
340  bug_if(cpl_mask_not(bpmi));
341 
342  /* Reject also any a-priori bad pixels */
343  if (bpm)
344  skip_if(cpl_mask_or(bpmi, bpm));
345 
346  bug_if(cpl_image_reject_from_mask(imap, bpmi));
347 
348  /* FIXME: Protect division/power from any bad input pixels */
349  bug_if(cpl_image_fill_rejected(imap, 1.0));
350 
351  if (frametype == VISIR_FRAME_WEIGHT) {
352 
353  if (do_w) {
354  if (wmap == NULL) wmap = map;
355  }
356 
357  if (do_v || do_e) {
358  /* Create variance map from weight map */
359 
360  if (ione == NULL) {
361  ione = cpl_image_new(cpl_image_get_size_x(imap),
362  cpl_image_get_size_y(imap),
363  CPL_TYPE_FLOAT);
364  cpl_image_add_scalar(ione, 1.0);
365 
366  }
367 
368  idiv = cpl_image_divide_create(ione, imap);
369 
370  /* Division should not create bad pixels,
371  but just be sure */
372  if (cpl_image_get_bpm_const(idiv))
373  bug_if(cpl_mask_or(bpmi,
374  cpl_image_get_bpm_const(idiv)));
375 
376  bug_if(cpl_image_reject_from_mask(idiv, bpmi));
377  }
378 
379  if (do_v) {
380  if (vmap == NULL)
381  vmap = do_w ? cpl_imagelist_new() : map;
382 
383  /* Set/replace image in list */
384  bug_if(cpl_imagelist_set(vmap, idiv, j));
385  idiv = NULL;
386  }
387 
388  if (do_e) {
389  if (emap == NULL)
390  emap = do_w || do_v ? cpl_imagelist_new() : map;
391 
392  if (do_v) {
393  idiv = cpl_image_power_create(cpl_imagelist_get_const
394  (vmap, j), 0.5);
395  } else {
396  bug_if(cpl_image_power(idiv, 0.5));
397  }
398 
399  /* Set/replace image in list */
400  bug_if(cpl_imagelist_set(emap, idiv, j));
401  idiv = NULL;
402  }
403  } else if (frametype == VISIR_FRAME_ERROR) {
404 
405  if (do_e) {
406  if (emap == NULL) emap = map;
407  }
408 
409  if (do_v) {
410  if (vmap == NULL)
411  vmap = do_e ? cpl_imagelist_new() : map;
412 
413  if (do_e) {
414  isqr = cpl_image_power_create(imap, 2.0);
415 
416  /* Set image in list */
417  bug_if(cpl_imagelist_set(vmap, isqr, j));
418  isqr = NULL;
419  } else {
420  bug_if(cpl_image_power(imap, 2.0));
421  }
422  }
423 
424  if (do_w) {
425  if (wmap == NULL)
426  wmap = do_e || do_v ? cpl_imagelist_new() : map;
427 
428  if (ione == NULL) {
429  ione = cpl_image_new(cpl_image_get_size_x(imap),
430  cpl_image_get_size_y(imap),
431  CPL_TYPE_FLOAT);
432  cpl_image_add_scalar(ione, 1.0);
433 
434  }
435 
436  if (do_v) {
437  idiv = cpl_image_divide_create
438  (ione, cpl_imagelist_get(vmap, j));
439  } else if (do_e) {
440  isqr = cpl_image_power_create(imap, 2.0);
441  idiv = cpl_image_divide_create(ione, isqr);
442  } else {
443  bug_if(cpl_image_power(imap, 2.0));
444  idiv = cpl_image_divide_create(ione, imap);
445  }
446  cpl_image_delete(isqr);
447  isqr = NULL;
448 
449  /* Set image in list */
450  bug_if(cpl_imagelist_set(wmap, idiv, j));
451  idiv = NULL;
452  }
453 
454  } else if (frametype == VISIR_FRAME_VARIANCE) {
455  if (do_v) {
456  if (vmap == NULL) vmap = map;
457  }
458 
459  if (do_w) {
460  if (wmap == NULL)
461  wmap = do_v ? cpl_imagelist_new() : map;
462 
463  if (ione == NULL) {
464  ione = cpl_image_new(cpl_image_get_size_x(imap),
465  cpl_image_get_size_y(imap),
466  CPL_TYPE_FLOAT);
467  cpl_image_add_scalar(ione, 1.0);
468 
469  }
470 
471  idiv = cpl_image_divide_create(ione, imap);
472 
473  /* Division should not create bad pixels,
474  but just be sure */
475  if (cpl_image_get_bpm_const(idiv))
476  bug_if(cpl_mask_or(bpmi,
477  cpl_image_get_bpm_const(idiv)));
478 
479  bug_if(cpl_image_reject_from_mask(idiv, bpmi));
480 
481  /* Set image in list */
482  bug_if(cpl_imagelist_set(wmap, idiv, j));
483  idiv = NULL;
484  }
485 
486  if (do_e) {
487  if (emap == NULL)
488  emap = do_v || do_w ? cpl_imagelist_new() : map;
489 
490  if (do_v || do_w) {
491  isqr = cpl_image_power_create(imap, 0.5);
492  /* Set/replace image in list */
493  bug_if(cpl_imagelist_set(emap, isqr, j));
494  isqr = NULL;
495 
496  } else {
497  bug_if(cpl_image_power(imap, 0.5));
498  }
499  }
500  } else {
501  bug_if(1);
502  }
503 
504  /* Set/Zero bad pixels */
505  if (do_w) {
506  bug_if(cpl_image_fill_rejected(cpl_imagelist_get
507  (wmap, j), 0.0));
508  }
509  if (do_e) {
510  bug_if(cpl_image_fill_rejected(cpl_imagelist_get
511  (emap, j), bad_val));
512  }
513  if (do_v) {
514  /* Set bad pixels */
515  bug_if(cpl_image_fill_rejected(cpl_imagelist_get
516  (vmap, j), bad_val));
517  }
518  }
519 
520  }
521 
522  if (iext == 0) {
523 
524  bug_if(cpl_frameset_insert(usedframes, cpl_frame_duplicate
525  (frame)));
526  if (bpmframe != NULL)
527  bug_if(cpl_frameset_insert(usedframes, cpl_frame_duplicate
528  (bpmframe)));
529 
530  if (do_w) {
531  if (wmap == NULL) {
532  skip_if(irplib_dfs_save_propertylist(products, parlist,
533  usedframes,
534  RECIPE_STRING,
535  VISIR_UTIL_WEIGHT_MAP_PROCATG,
536  plist, NULL,
537  visir_pipe_id,
538  wproname));
539  } else {
540  skip_if(irplib_dfs_save_imagelist(products, parlist,
541  usedframes, wmap,
542  CPL_BPP_IEEE_FLOAT,
543  RECIPE_STRING,
544  VISIR_UTIL_WEIGHT_MAP_PROCATG,
545  plist, NULL,
546  visir_pipe_id, wproname));
547  }
548  }
549  if (do_e) {
550  if (emap == NULL) {
551  skip_if(irplib_dfs_save_propertylist(products, parlist,
552  usedframes,
553  RECIPE_STRING,
554  VISIR_UTIL_ERROR_MAP_PROCATG,
555  plist, NULL,
556  visir_pipe_id,
557  eproname));
558  } else {
559  skip_if(irplib_dfs_save_imagelist(products, parlist,
560  usedframes, emap,
561  CPL_BPP_IEEE_FLOAT,
562  RECIPE_STRING,
563  VISIR_UTIL_ERROR_MAP_PROCATG,
564  plist, NULL,
565  visir_pipe_id, eproname));
566  }
567  }
568  if (do_v) {
569  if (vmap == NULL) {
570  skip_if(irplib_dfs_save_propertylist(products, parlist,
571  usedframes,
572  RECIPE_STRING,
573  VISIR_UTIL_VARIANCE_MAP_PROCATG,
574  plist, NULL,
575  visir_pipe_id,
576  vproname));
577  } else {
578  skip_if(irplib_dfs_save_imagelist(products, parlist,
579  usedframes, vmap,
580  CPL_BPP_IEEE_FLOAT,
581  RECIPE_STRING,
582  VISIR_UTIL_VARIANCE_MAP_PROCATG,
583  plist, NULL,
584  visir_pipe_id, vproname));
585  }
586  }
587  } else {
588  if (do_w) {
589  if (wmap == NULL) {
590  skip_if(cpl_propertylist_save(plist, wproname,
591  CPL_IO_EXTEND));
592  } else {
593  skip_if(cpl_imagelist_save(wmap, wproname,
594  CPL_BPP_IEEE_FLOAT, plist,
595  CPL_IO_EXTEND));
596  }
597  }
598  if (do_e) {
599  if (emap == NULL) {
600  skip_if(cpl_propertylist_save(plist, eproname,
601  CPL_IO_EXTEND));
602  } else {
603  skip_if(cpl_imagelist_save(emap, eproname,
604  CPL_BPP_IEEE_FLOAT, plist,
605  CPL_IO_EXTEND));
606  }
607  }
608  if (do_v) {
609  if (vmap == NULL) {
610  skip_if(cpl_propertylist_save(plist, vproname,
611  CPL_IO_EXTEND));
612  } else {
613  skip_if(cpl_imagelist_save(vmap, vproname,
614  CPL_BPP_IEEE_FLOAT, plist,
615  CPL_IO_EXTEND));
616  }
617  }
618  }
619  }
620 
621  FOR_EACH_FRAMESET_C(frame, products) {
622  cpl_frame * copy = cpl_frame_duplicate(frame);
623  cpl_error_code error = cpl_frameset_insert(framelist, copy);
624 
625  if (error) break;
626  }
627  bug_if(frame != NULL);
628 
629  end_skip;
630 
631  if (emap != map) cpl_imagelist_delete(emap);
632  if (wmap != map) cpl_imagelist_delete(wmap);
633  if (vmap != map) cpl_imagelist_delete(vmap);
634  cpl_imagelist_delete(map);
635  cpl_free(eproname);
636  cpl_free(wproname);
637  cpl_free(vproname);
638  cpl_image_delete(ione);
639  cpl_image_delete(idiv);
640  cpl_image_delete(isqr);
641  cpl_image_delete(ibpm);
642  cpl_mask_delete(bpm);
643  cpl_mask_delete(bpmi);
644  cpl_propertylist_delete(plist);
645  cpl_frameset_delete(usedframes);
646  cpl_frameset_delete(products);
647 
648  return cpl_error_get_code();
649 
650 }
651 
652 
cpl_error_code irplib_dfs_save_propertylist(cpl_frameset *allframes, const cpl_parameterlist *parlist, const cpl_frameset *usedframes, const char *recipe, const char *procat, const cpl_propertylist *applist, const char *remregexp, const char *pipe_id, const char *filename)
Save a propertylist as a DFS-compliant pipeline product.
Definition: irplib_utils.c:240
irplib_framelist * irplib_framelist_extract_regexp(const irplib_framelist *self, const char *regexp, cpl_boolean invert)
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.
irplib_framelist * irplib_framelist_cast(const cpl_frameset *frameset)
Create an irplib_framelist from a cpl_framelist.
cpl_error_code irplib_dfs_save_imagelist(cpl_frameset *allframes, const cpl_parameterlist *parlist, const cpl_frameset *usedframes, const cpl_imagelist *imagelist, 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 imagelist as a DFS-compliant pipeline product.
Definition: irplib_utils.c:287
int irplib_framelist_get_size(const irplib_framelist *self)
Get the size of a framelist.