CR2RE Pipeline Reference Manual 1.6.7
irplib_utils.h
1/* $Id: irplib_utils.h,v 1.60 2013-08-21 14:55:14 cgarcia Exp $
2 *
3 * This file is part of the irplib package
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., 51 Franklin St, Fifth Floor, Boston, MA 02111-1307 USA
19 */
20
21/*
22 * $Author: cgarcia $
23 * $Date: 2013-08-21 14:55:14 $
24 * $Revision: 1.60 $
25 * $Name: not supported by cvs2svn $
26 * $Log: not supported by cvs2svn $
27 * Revision 1.59 2013/03/15 09:06:06 jtaylor
28 * add irplib_aligned_{[mc]alloc,free}
29 *
30 * allow portable allocation of aligned memory for vectorization
31 *
32 * Revision 1.58 2013/03/15 09:05:28 jtaylor
33 * move isnan and isinf to header so it is inlineable and use gcc builtin for better performance
34 *
35 * Revision 1.57 2013/02/27 16:02:02 jtaylor
36 * add diagnostic pragma macros
37 *
38 * Revision 1.56 2012/08/06 06:14:18 llundin
39 * irplib_errorstate_warning(): Replaced by cpl_errorstate_dump_one_warning() from CPL 6.X
40 *
41 * Revision 1.55 2011/06/01 06:47:56 llundin
42 * skip_if_lt(): Fix previous edits switch of A and B in error message
43 *
44 * Revision 1.54 2011/05/26 08:08:56 llundin
45 * skip_if_lt(): Support printf-style error message, name-space protect temporary variables
46 *
47 * Revision 1.53 2011/05/09 07:51:18 llundin
48 * irplib_dfs_save_image_(): Modified from cpl_dfs_save_image(). irplib_dfs_save_image(): Use irplib_dfs_save_image_()
49 *
50 * Revision 1.52 2010/03/23 07:57:59 kmirny
51 * DFS08552, Documentation for irplib_frameset_sort
52 *
53 * Revision 1.51 2009/12/16 14:59:30 cgarcia
54 * Avoid name clash with index function
55 *
56 * Revision 1.50 2009/08/17 15:10:16 kmirny
57 *
58 * DFS07454 DFS07437
59 *
60 */
61
62#ifndef IRPLIB_UTILS_H
63#define IRPLIB_UTILS_H
64
65/*-----------------------------------------------------------------------------
66 Includes
67 -----------------------------------------------------------------------------*/
68
69#include <cpl.h>
70#include <math.h>
71#include <stdarg.h>
72
73/*-----------------------------------------------------------------------------
74 Defines
75 -----------------------------------------------------------------------------*/
76
77/* Concatenate two macro arguments */
78#define IRPLIB_CONCAT(a,b) a ## _ ## b
79#define IRPLIB_CONCAT2X(a,b) IRPLIB_CONCAT(a,b)
80
81/*----------------------------------------------------------------------------*/
82/*
83 @brief Swap two double values
84 @param A The 1st double to swap
85 @param B The 2nd double to swap
86 @note A and B are evaluated twice, so side-effects should be avoided
87*/
88/*----------------------------------------------------------------------------*/
89#define IRPLIB_SWAP_DOUBLE(A, B) do { \
90 const double irplib_swap_double=(A); \
91 (A)=(B); \
92 (B)=irplib_swap_double; \
93 } while (0)
94
95#define IRPLIB_XSTRINGIFY CPL_XSTRINGIFY
96#define IRPLIB_STRINGIFY CPL_STRINGIFY
97
98#if !defined __GNUC__ && !defined __inline__
99#if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L
100#define __inline__ inline
101#else
102#define __inline__
103#endif
104#endif
105
106#define IRPLIB_DIAG_PRAGMA_PUSH_IGN CPL_DIAG_PRAGMA_PUSH_IGN
107#define IRPLIB_DIAG_PRAGMA_PUSH_ERR CPL_DIAG_PRAGMA_PUSH_ERR
108#define IRPLIB_DIAG_PRAGMA_POP CPL_DIAG_PRAGMA_POP
109
110/* FIXME: Remove when no longer used by any irplib-based pipelines */
111/* Useful for debugging */
112#define irplib_trace() do if (cpl_error_get_code()) { \
113 cpl_msg_debug(cpl_func, __FILE__ " at line " \
114 CPL_STRINGIFY(__LINE__) ": ERROR '%s' at %s", \
115 cpl_error_get_message(), cpl_error_get_where()); \
116 } else { \
117 cpl_msg_debug(cpl_func, __FILE__ " at line " \
118 CPL_STRINGIFY(__LINE__) ": OK"); \
119 } while (0)
120
121#define irplib_error_recover(ESTATE, ...) \
122 do if (!cpl_errorstate_is_equal(ESTATE)) { \
123 cpl_msg_warning(cpl_func, __VA_ARGS__); \
124 cpl_msg_indent_more(); \
125 cpl_errorstate_dump(ESTATE, CPL_FALSE, \
126 cpl_errorstate_dump_one_warning); \
127 cpl_msg_indent_less(); \
128 cpl_errorstate_set(ESTATE); \
129 } while (0)
130
131
132
133/*----------------------------------------------------------------------------*/
134/*
135 @brief Declare a function suitable for use with irplib_dfs_table_convert()
136 @param table_set_row The name of the function to declare
137 @see irplib_dfs_table_convert(), irplib_table_read_from_frameset()
138
139*/
140/*----------------------------------------------------------------------------*/
141#define IRPLIB_UTIL_SET_ROW(table_set_row) \
142 cpl_boolean table_set_row(cpl_table *, \
143 const char *, \
144 int, \
145 const cpl_frame *, \
146 const cpl_parameterlist *)
147
148
149/*----------------------------------------------------------------------------*/
150/*
151 @brief Declare a function suitable for use with irplib_dfs_table_convert()
152 @param table_check The name of the function to declare
153 @see irplib_dfs_table_convert()
154
155*/
156/*----------------------------------------------------------------------------*/
157#define IRPLIB_UTIL_CHECK(table_check) \
158 cpl_error_code table_check(cpl_table *, \
159 const cpl_frameset *, \
160 const cpl_parameterlist *)
161
162
163/*----------------------------------------------------------------------------*/
164/*
165 @brief Conditional skip to the (unqiue) return point of the function
166 @param CONDITION The condition to check
167 @see cpl_error_ensure()
168
169 skip_if() takes one argument, which is a logical expression.
170 If the logical expression is false skip_if() takes no action and
171 program execution continues.
172 If the logical expression is true this indicates an error. In this case
173 skip_if() will set the location of the error to the point where it
174 was invoked in the recipe code (unless the error location is already in the
175 recipe code). If no error code had been set, then skip_if() will set one.
176 Finally, skip_if() causes program execution to skip to the macro 'end_skip'.
177 The macro end_skip is located towards the end of the function, after
178 which all resource deallocation and the function return is located.
179
180 The use of skip_if() assumes the following coding practice:
181 1) Pointers used for dynamically allocated memory that they "own" shall always
182 point to either NULL or to allocated memory (including CPL-objects).
183 2) Such pointers may not be reused to point to memory whose deallocation
184 requires calls to different functions.
185 3) Pointers of type FILE should be set NULL when not pointing to an open
186 stream and their closing calls (fclose(), freopen(), etc.) following the
187 'end_skip' should be guarded against such NULL pointers.
188
189 Error checking with skip_if() is encouraged due to the following advantages:
190 1) It ensures that a CPL-error code is set.
191 2) It ensures that the location of the error in the _recipe_ code is noted.
192 3) The error checking may be confined to a single concise line.
193 4) It is not necessary to replicate memory deallocation for every error
194 condition.
195 5) If more extensive error reporting/handling is required it is not precluded
196 by the use of skip_if().
197 6) It allows for a single point of function return.
198 7) It allows for optional, uniformly formatted debugging/tracing information
199 at each macro invocation.
200
201 The implementation of skip_if() uses a goto/label construction.
202 According to Kerningham & Ritchie, The C Programming Language, 2nd edition,
203 Section 3.8:
204 "This organization is handy if the error-handling code is non-trivial,
205 and if errors can occur in several places."
206
207 The use of goto for any other purpose should be avoided.
208
209*/
210/*----------------------------------------------------------------------------*/
211#define skip_if(CONDITION) \
212 do { \
213 cpl_error_ensure(!cpl_error_get_code(), cpl_error_get_code(), \
214 goto cleanup, "Propagating a pre-existing error"); \
215 cpl_error_ensure(!(CONDITION), cpl_error_get_code(), \
216 goto cleanup, "Propagating error");\
217 } while (0)
218
219/*----------------------------------------------------------------------------*/
220/*
221 @brief Skip if A != B
222 @param A The 1st double to compare
223 @param B The 2nd double to compare
224 @param MSG A printf-style error message, 1st arg should be a string literal
225 @see skip_if()
226 @note A and B are evaluated exactly once
227
228 If no CPL error is set, sets CPL_ERROR_DATA_NOT_FOUND on failure
229*/
230/*----------------------------------------------------------------------------*/
231#define skip_if_ne(A, B, ...) \
232 do { \
233 /* Name-space protected one-time only evaluation */ \
234 const double irplib_utils_a = (double)(A); \
235 const double irplib_utils_b = (double)(B); \
236 \
237 cpl_error_ensure(!cpl_error_get_code(), cpl_error_get_code(), \
238 goto cleanup, "Propagating a pre-existing error"); \
239 if (irplib_utils_a != irplib_utils_b) { \
240 char * irplib_utils_msg = cpl_sprintf(__VA_ARGS__); \
241 (void)cpl_error_set_message(cpl_func, CPL_ERROR_DATA_NOT_FOUND, \
242 "Need %g (not %g) %s", \
243 irplib_utils_b, irplib_utils_a, \
244 irplib_utils_msg); \
245 cpl_free(irplib_utils_msg); \
246 goto cleanup; \
247 } \
248 } while (0)
249
250/*----------------------------------------------------------------------------*/
251/*
252 @brief Skip if A < B
253 @param A The 1st double to compare
254 @param B The 2nd double to compare
255 @param MSG A printf-style error message, 1st arg should be a string literal
256 @see skip_if()
257 @note A and B are evaluated exactly once
258
259 If no CPL error is set, sets CPL_ERROR_DATA_NOT_FOUND on failure
260*/
261/*----------------------------------------------------------------------------*/
262#define skip_if_lt(A, B, ...) \
263 do { \
264 /* Name-space protected one-time only evaluation */ \
265 const double irplib_utils_a = (double)(A); \
266 const double irplib_utils_b = (double)(B); \
267 \
268 cpl_error_ensure(!cpl_error_get_code(), cpl_error_get_code(), \
269 goto cleanup, "Propagating a pre-existing error"); \
270 if (irplib_utils_a < irplib_utils_b) { \
271 char * irplib_utils_msg = cpl_sprintf(__VA_ARGS__); \
272 (void)cpl_error_set_message(cpl_func, CPL_ERROR_DATA_NOT_FOUND, \
273 "Need at least %g (not %g) %s", \
274 irplib_utils_b, irplib_utils_a, \
275 irplib_utils_msg); \
276 cpl_free(irplib_utils_msg); \
277 goto cleanup; \
278 } \
279 } while (0)
280
281/*----------------------------------------------------------------------------*/
282/*
283 @brief Conditional skip on coding bug
284 @param CONDITION The condition to check
285 @see skip_if()
286 @note unlike assert() this check cannot be disabled
287 */
288/*----------------------------------------------------------------------------*/
289#define bug_if(CONDITION) \
290 do { \
291 cpl_error_ensure(!cpl_error_get_code(), cpl_error_get_code(), \
292 goto cleanup, "Propagating an unexpected error, " \
293 "please report to " PACKAGE_BUGREPORT); \
294 cpl_error_ensure(!(CONDITION), CPL_ERROR_UNSPECIFIED, \
295 goto cleanup, "Internal error, please report to " \
296 PACKAGE_BUGREPORT); \
297 } while (0)
298
299/*----------------------------------------------------------------------------*/
300/*
301 @brief Conditional skip with error creation
302 @param CONDITION The condition to check
303 @param ERROR The error code to set
304 @param MSG A printf-style error message. As a matter of
305 user-friendliness the message should mention any
306 value that caused the @em CONDITION to fail.
307 @see skip_if()
308 @note unlike assert() this check cannot be disabled
309 */
310/*----------------------------------------------------------------------------*/
311#define error_if(CONDITION, ERROR, ...) \
312 cpl_error_ensure(cpl_error_get_code() == CPL_ERROR_NONE && \
313 !(CONDITION), ERROR, goto cleanup, __VA_ARGS__)
314
315/*----------------------------------------------------------------------------*/
316/*
317 @brief Propagate a preexisting error, if any
318 @param MSG A printf-style error message.
319 @see skip_if()
320 */
321/*----------------------------------------------------------------------------*/
322#define any_if(...) \
323 cpl_error_ensure(!cpl_error_get_code(), cpl_error_get_code(), \
324 goto cleanup, __VA_ARGS__)
325
326/*----------------------------------------------------------------------------*/
327/*
328 @brief Define the single point of resource deallocation and return
329 @see skip_if()
330 @note end_skip should be used exactly once in functions that use skip_if() etc
331*/
332/*----------------------------------------------------------------------------*/
333#define end_skip \
334 do { \
335 cleanup: \
336 if (cpl_error_get_code()) \
337 cpl_msg_debug(cpl_func, "Cleanup in " __FILE__ " line " \
338 CPL_STRINGIFY(__LINE__) " with error '%s' at %s", \
339 cpl_error_get_message(), cpl_error_get_where()); \
340 else \
341 cpl_msg_debug(cpl_func, "Cleanup in " __FILE__ " line " \
342 CPL_STRINGIFY(__LINE__)); \
343 } while (0)
344
345
346/*----------------------------------------------------------------------------*/
358/*----------------------------------------------------------------------------*/
359#define irplib_ensure(CONDITION, ec, ...) \
360 cpl_error_ensure(CONDITION, ec, goto cleanup, __VA_ARGS__)
361
362/*----------------------------------------------------------------------------*/
392/*----------------------------------------------------------------------------*/
393
394#define irplib_check(COMMAND, ...) \
395 do { \
396 cpl_errorstate irplib_check_prestate = cpl_errorstate_get(); \
397 skip_if(0); \
398 COMMAND; \
399 irplib_trace(); \
400 irplib_ensure(cpl_errorstate_is_equal(irplib_check_prestate), \
401 cpl_error_get_code(), __VA_ARGS__); \
402 irplib_trace(); \
403 } while (0)
404
405/*-----------------------------------------------------------------------------
406 Function prototypes
407 -----------------------------------------------------------------------------*/
408
409cpl_error_code irplib_dfs_save_image(cpl_frameset *,
410 const cpl_parameterlist *,
411 const cpl_frameset *,
412 const cpl_image *,
413 cpl_type_bpp ,
414 const char *,
415 const char *,
416 const cpl_propertylist *,
417 const char *,
418 const char *,
419 const char *);
420
421
422cpl_error_code irplib_dfs_save_propertylist(cpl_frameset *,
423 const cpl_parameterlist *,
424 const cpl_frameset *,
425 const char *,
426 const char *,
427 const cpl_propertylist *,
428 const char *,
429 const char *,
430 const char *);
431
432cpl_error_code irplib_dfs_save_imagelist(cpl_frameset *,
433 const cpl_parameterlist *,
434 const cpl_frameset *,
435 const cpl_imagelist *,
436 cpl_type_bpp ,
437 const char *,
438 const char *,
439 const cpl_propertylist *,
440 const char *,
441 const char *,
442 const char *);
443
444cpl_error_code irplib_dfs_save_table(cpl_frameset *,
445 const cpl_parameterlist *,
446 const cpl_frameset *,
447 const cpl_table *,
448 const cpl_propertylist *,
449 const char *,
450 const char *,
451 const cpl_propertylist *,
452 const char *,
453 const char *,
454 const char *);
455
456cpl_error_code irplib_dfs_save_image_(cpl_frameset *,
457 cpl_propertylist *,
458 const cpl_parameterlist *,
459 const cpl_frameset *,
460 const cpl_frame *,
461 const cpl_image *,
462 cpl_type ,
463 const char *,
464 const cpl_propertylist *,
465 const char *,
466 const char *,
467 const char *);
468
469void irplib_reset(void);
470int irplib_compare_tags(cpl_frame *, cpl_frame *);
471const char * irplib_frameset_find_file(const cpl_frameset *, const char *);
472const cpl_frame * irplib_frameset_get_first_from_group(const cpl_frameset *,
473 cpl_frame_group);
474
475cpl_error_code irplib_apertures_find_max_flux(const cpl_apertures *, int *,
476 int);
477
478#if defined HAVE_ISNAN && HAVE_ISNAN != 0
479#if !defined isnan && defined HAVE_DECL_ISNAN && HAVE_DECL_ISNAN == 0
480/* HP-UX and Solaris may have isnan() available at link-time
481 without the prototype */
482int isnan(double);
483#endif
484#endif
485
486cpl_error_code
487irplib_dfs_table_convert(cpl_table *, cpl_frameset *, const cpl_frameset *,
488 int, char, const char *, const char *,
489 const cpl_parameterlist *, const char *,
490 const cpl_propertylist *, const cpl_propertylist *,
491 const char *, const char *, const char *,
492 cpl_boolean (*)(cpl_table *, const char *, int,
493 const cpl_frame *,
494 const cpl_parameterlist *),
495 cpl_error_code (*)(cpl_table *,
496 const cpl_frameset *,
497 const cpl_parameterlist *));
498
499cpl_error_code irplib_table_read_from_frameset(cpl_table *,
500 const cpl_frameset *,
501 int,
502 char,
503 const cpl_parameterlist *,
504 cpl_boolean (*)
505 (cpl_table *, const char *,
506 int, const cpl_frame *,
507 const cpl_parameterlist *));
508
509cpl_error_code irplib_image_split(const cpl_image *,
510 cpl_image *, cpl_image *, cpl_image *,
511 double, cpl_boolean,
512 double, cpl_boolean,
513 double, double,
514 cpl_boolean, cpl_boolean, cpl_boolean);
515
516void irplib_errorstate_dump_warning(unsigned, unsigned, unsigned);
517void irplib_errorstate_dump_info(unsigned, unsigned, unsigned);
518void irplib_errorstate_dump_debug(unsigned, unsigned, unsigned);
519/* wrapper for replace deprecated function cpl_polynomial_fit_1d_create*/
520cpl_polynomial * irplib_polynomial_fit_1d_create(
521 const cpl_vector * x_pos,
522 const cpl_vector * values,
523 int degree,
524 double * mse
525 );
526cpl_polynomial * irplib_polynomial_fit_1d_create_chiq(
527 const cpl_vector * x_pos,
528 const cpl_vector * values,
529 int degree,
530 double * rechiq
531 );
532/*----------------------------------------------------------------------------*/
540cpl_error_code irplib_frameset_sort(
541 const cpl_frameset * self,
542 int* iindex,
543 double* exptime);
544
545
546/* FIXME: add alloc_size(2) */
547void * irplib_aligned_malloc(size_t alignment, size_t size) CPL_ATTR_ALLOC;
548void * irplib_aligned_calloc(size_t alignment,
549 size_t nelem, size_t nbytes) CPL_ATTR_ALLOC;
550void irplib_aligned_free (void * aligned_ptr);
551
552const cpl_frame *
553irplib_frameset_get_first_const(cpl_frameset_iterator **iterator,
554 const cpl_frameset *frameset);
555
556const cpl_frame *
557irplib_frameset_get_next_const(cpl_frameset_iterator *iterator);
558
559
560void irplib_vector_get_kth(cpl_vector *, cpl_size);
561
562/*-----------------------------------------------------------------------------
563 Function inlines
564 -----------------------------------------------------------------------------*/
565
566
567/*----------------------------------------------------------------------------*/
571/*----------------------------------------------------------------------------*/
572static __inline__ int irplib_isinf(double value)
573{
574/* documented only on 4.4, but available in at least 4.2 */
575#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 2)
576 return __builtin_isinf(value);
577#elif defined HAVE_ISINF && HAVE_ISINF
578 return isinf(value);
579#else
580 return value != 0 && value == 2 * value;
581#endif
582}
583
584
585/*----------------------------------------------------------------------------*/
589/*----------------------------------------------------------------------------*/
590static __inline__ int irplib_isnan(double value)
591{
592/* documented only on 4.4, but available in at least 4.2 */
593#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 2)
594 return __builtin_isnan(value);
595#elif defined HAVE_ISNAN && HAVE_ISNAN
596 return isnan(value);
597#else
598 return value != value;
599#endif
600}
601
602#endif
cpl_error_code irplib_dfs_save_image_(cpl_frameset *, cpl_propertylist *, const cpl_parameterlist *, const cpl_frameset *, const cpl_frame *, const cpl_image *, cpl_type, const char *, const cpl_propertylist *, const char *, const char *, const char *)
Save an image as a DFS-compliant pipeline product.
Definition: irplib_utils.c:392
void irplib_errorstate_dump_debug(unsigned, unsigned, unsigned)
Dump a single CPL error at the CPL debug level.
Definition: irplib_utils.c:158
cpl_error_code irplib_dfs_save_image(cpl_frameset *, const cpl_parameterlist *, const cpl_frameset *, const cpl_image *, cpl_type_bpp, const char *, const char *, const cpl_propertylist *, const char *, const char *, const char *)
Save an image as a DFS-compliant pipeline product.
Definition: irplib_utils.c:189
cpl_error_code irplib_dfs_table_convert(cpl_table *, cpl_frameset *, const cpl_frameset *, int, char, const char *, const char *, const cpl_parameterlist *, const char *, const cpl_propertylist *, const cpl_propertylist *, const char *, const char *, const char *, cpl_boolean(*)(cpl_table *, const char *, int, const cpl_frame *, const cpl_parameterlist *), cpl_error_code(*)(cpl_table *, const cpl_frameset *, const cpl_parameterlist *))
Create a DFS product with one table from one or more (ASCII) file(s)
Definition: irplib_utils.c:841
cpl_error_code irplib_dfs_save_propertylist(cpl_frameset *, const cpl_parameterlist *, const cpl_frameset *, const char *, const char *, const cpl_propertylist *, const char *, const char *, const char *)
Save a propertylist as a DFS-compliant pipeline product.
Definition: irplib_utils.c:237
cpl_error_code irplib_table_read_from_frameset(cpl_table *, const cpl_frameset *, int, char, const cpl_parameterlist *, cpl_boolean(*)(cpl_table *, const char *, int, const cpl_frame *, const cpl_parameterlist *))
Set the rows of a table with data from one or more (ASCII) files.
Definition: irplib_utils.c:970
cpl_error_code irplib_dfs_save_table(cpl_frameset *, const cpl_parameterlist *, const cpl_frameset *, const cpl_table *, const cpl_propertylist *, const char *, const char *, const cpl_propertylist *, const char *, const char *, const char *)
Save a table as a DFS-compliant pipeline product.
Definition: irplib_utils.c:332
cpl_error_code irplib_dfs_save_imagelist(cpl_frameset *, const cpl_parameterlist *, const cpl_frameset *, const cpl_imagelist *, cpl_type_bpp, const char *, const char *, const cpl_propertylist *, const char *, const char *, const char *)
Save an imagelist as a DFS-compliant pipeline product.
Definition: irplib_utils.c:284
void irplib_errorstate_dump_warning(unsigned, unsigned, unsigned)
Dump a single CPL error at the CPL warning level.
Definition: irplib_utils.c:111
cpl_error_code irplib_image_split(const cpl_image *, cpl_image *, cpl_image *, cpl_image *, double, cpl_boolean, double, cpl_boolean, double, double, cpl_boolean, cpl_boolean, cpl_boolean)
Split the values in an image in three according to two thresholds.
Definition: irplib_utils.c:646
void irplib_errorstate_dump_info(unsigned, unsigned, unsigned)
Dump a single CPL error at the CPL info level.
Definition: irplib_utils.c:138
const cpl_frame * irplib_frameset_get_first_from_group(const cpl_frameset *, cpl_frame_group)
Find the first frame belonging to the given group.
const char * irplib_frameset_find_file(const cpl_frameset *, const char *)
Find the filename with the given tag in a frame set.
cpl_error_code irplib_apertures_find_max_flux(const cpl_apertures *, int *, int)
Find the aperture(s) with the greatest flux.
int irplib_compare_tags(cpl_frame *, cpl_frame *)
Comparison function to identify different input frames.
void irplib_reset(void)
Reset IRPLIB state.