Functions | |
irplib_framelist * | irplib_framelist_new (void) |
Create an empty 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_frameset * | irplib_frameset_cast (const irplib_framelist *self) |
Create a CPL frameset from an irplib_framelist. | |
irplib_framelist * | irplib_framelist_extract (const irplib_framelist *self, const char *tag) |
Extract the frames with the given tag from a framelist. | |
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 | irplib_framelist_get_size (const irplib_framelist *self) |
Get the size of a framelist. | |
cpl_frame * | irplib_framelist_get (irplib_framelist *self, int pos) |
Get the specified frame from the framelist. | |
const cpl_frame * | irplib_framelist_get_const (const irplib_framelist *self, int pos) |
Get the specified frame from the framelist. | |
cpl_error_code | irplib_framelist_set_propertylist (irplib_framelist *self, int pos, const cpl_propertylist *list) |
Duplicate a propertylist to the specified position in the framelist. | |
cpl_propertylist * | irplib_framelist_get_propertylist (irplib_framelist *self, int pos) |
Get the propertylist of the specified frame in the framelist. | |
const cpl_propertylist * | irplib_framelist_get_propertylist_const (const irplib_framelist *self, int pos) |
Get the propertylist of the specified frame in the framelist. | |
cpl_error_code | irplib_framelist_load_propertylist (irplib_framelist *self, int pos, int ind, const char *regexp, cpl_boolean invert) |
Load the propertylist of the specified frame in the framelist. | |
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_error_code | irplib_framelist_set_tag_all (irplib_framelist *self, const char *tag) |
Set the tag of all frames in the list. | |
cpl_error_code | irplib_framelist_set (irplib_framelist *self, cpl_frame *frame, int pos) |
Add a frame to a framelist. | |
cpl_error_code | irplib_framelist_erase (irplib_framelist *self, int pos) |
Erase a frame from a framelist and delete it and its propertylist. | |
cpl_frame * | irplib_framelist_unset (irplib_framelist *self, int pos, cpl_propertylist **plist) |
Erase a frame from a framelist and return it to the caller. | |
void | irplib_framelist_empty (irplib_framelist *self) |
Erase all frames from a framelist. | |
cpl_error_code | irplib_framelist_contains (const irplib_framelist *self, const char *key, cpl_type type, cpl_boolean is_equal, double fp_tol) |
Verify that a property is present for all frames. | |
cpl_imagelist * | irplib_imagelist_load_framelist (const irplib_framelist *self, cpl_type pixeltype, int planenum, int extnum) |
Load an imagelist from a framelist. |
#include <irplib_framelist.h>
static int rrecipe(cpl_frameset * frameset) { // Error handling omitted for brevity irplib_framelist * allframes = irplib_framelist_cast(frameset); // Get raw frames of either type irplib_framelist * rawframes = irplib_framelist_extract_regexp(allframes, "^(" RAW_TYPE1 "|" RAW_TYPE2 ")$", CPL_FALSE); // Load the list of images cpl_imagelist * ilist = irplib_imagelist_load_framelist(rawframes, CPL_TYPE_FLOAT, 0, 0); const cpl_propertylist * plist; // A regular expression of the FITS cards needed by this recipe const char cards[] = "^(RA|DEC|EXPTIME)$"; double ra, dec; // Load the specified FITS cards for all raw frames irplib_framelist_load_propertylist_all(rawframes, 0, cards, CPL_FALSE)); // Verify the presence and uniformity of the FITS cards if (irplib_framelist_contains(rawframes, "RA", CPL_TYPE_DOUBLE, CPL_TRUE, 1e-5)) { // RA is missing in one or more headers // - or it varies by more than 1e-5 } if (irplib_framelist_contains(rawframes, "DEC", CPL_TYPE_DOUBLE, CPL_TRUE, 1e-5)) { // DEC is missing in one or more headers // - or it varies by more than 1e-5 } // Process the FITS cards plist = irplib_framelist_get_propertylist_const(rawframes, 0); ra = cpl_propertylist_get_double(plist, "RA"); dec = cpl_propertylist_get_double(plist, "DEC"); // Object deallocation irplib_framelist_delete(allframes); irplib_framelist_delete(rawframes); cpl_imagelist_delete(ilist); return 0; }
irplib_framelist* irplib_framelist_new | ( | void | ) |
Create an empty framelist.
Definition at line 178 of file irplib_framelist.c.
Referenced by irplib_framelist_cast(), irplib_framelist_extract(), and irplib_framelist_extract_regexp().
void irplib_framelist_delete | ( | irplib_framelist * | self | ) |
Deallocate an irplib_framelist with its frames and properties.
self | the framelist |
Definition at line 191 of file irplib_framelist.c.
References irplib_framelist_empty().
Referenced by irplib_framelist_extract(), and irplib_framelist_extract_regexp().
irplib_framelist* irplib_framelist_cast | ( | const cpl_frameset * | frameset | ) |
Create an irplib_framelist from a cpl_framelist.
frameset | The cpl_frameset |
Definition at line 209 of file irplib_framelist.c.
References irplib_framelist_new(), and irplib_framelist_set().
cpl_frameset* irplib_frameset_cast | ( | const irplib_framelist * | self | ) |
Create a CPL frameset from an irplib_framelist.
self | The framelist |
Definition at line 251 of file irplib_framelist.c.
irplib_framelist* irplib_framelist_extract | ( | const irplib_framelist * | self, | |
const char * | tag | |||
) |
Extract the frames with the given tag from a framelist.
self | A non-empty framelist | |
tag | The frame tag to search for. |
Definition at line 290 of file irplib_framelist.c.
References irplib_framelist_delete(), irplib_framelist_new(), and irplib_framelist_set().
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.
self | A non-empty framelist | |
regexp | The regular expression of frame tag(s) to search for. | |
invert | Boolean to invert the sense of the pattern matching. |
Definition at line 360 of file irplib_framelist.c.
References irplib_framelist_delete(), irplib_framelist_new(), and irplib_framelist_set().
int irplib_framelist_get_size | ( | const irplib_framelist * | self | ) |
Get the size of a framelist.
self | The framelist |
Definition at line 438 of file irplib_framelist.c.
Referenced by irplib_dfs_check_framelist_tag(), irplib_pfits_set_airmass(), naco_framelist_set_tag(), and naco_imagelist_load_diff().
cpl_frame* irplib_framelist_get | ( | irplib_framelist * | self, | |
int | pos | |||
) |
Get the specified frame from the framelist.
self | The framelist | |
pos | position (0 for first) |
Definition at line 456 of file irplib_framelist.c.
References irplib_framelist_get_const().
Referenced by naco_framelist_set_tag().
const cpl_frame* irplib_framelist_get_const | ( | const irplib_framelist * | self, | |
int | pos | |||
) |
Get the specified frame from the framelist.
self | The framelist | |
pos | position (0 for first) |
Definition at line 473 of file irplib_framelist.c.
Referenced by irplib_dfs_check_framelist_tag(), irplib_framelist_get(), irplib_pfits_set_airmass(), and naco_imagelist_load_diff().
cpl_error_code irplib_framelist_set_propertylist | ( | irplib_framelist * | self, | |
int | pos, | |||
const cpl_propertylist * | list | |||
) |
Duplicate a propertylist to the specified position in the framelist.
self | The framelist to modify | |
pos | position (0 for first). | |
list | The propertylist to copy |
Definition at line 496 of file irplib_framelist.c.
cpl_propertylist* irplib_framelist_get_propertylist | ( | irplib_framelist * | self, | |
int | pos | |||
) |
Get the propertylist of the specified frame in the framelist.
self | The framelist | |
pos | position (0 for first) |
Definition at line 529 of file irplib_framelist.c.
References irplib_framelist_get_propertylist_const().
const cpl_propertylist* irplib_framelist_get_propertylist_const | ( | const irplib_framelist * | self, | |
int | pos | |||
) |
Get the propertylist of the specified frame in the framelist.
self | The framelist | |
pos | position (0 for first) |
Definition at line 552 of file irplib_framelist.c.
Referenced by irplib_dfs_check_framelist_tag(), irplib_framelist_get_propertylist(), irplib_pfits_set_airmass(), and naco_framelist_set_tag().
cpl_error_code irplib_framelist_load_propertylist | ( | irplib_framelist * | self, | |
int | pos, | |||
int | ind, | |||
const char * | regexp, | |||
cpl_boolean | invert | |||
) |
Load the propertylist of the specified frame in the framelist.
self | The framelist to modify | |
pos | position (0 for first). | |
ind | The index of the date set to read | |
regexp | The regular expression of properties to load | |
invert | Boolean to invert the sense of the pattern matching. |
Definition at line 583 of file irplib_framelist.c.
Referenced by irplib_framelist_load_propertylist_all().
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.
self | The framelist to modify | |
ind | The index of the date set to read | |
regexp | The regular expression of properties to load | |
invert | Boolean to invert the sense of the pattern matching. |
Definition at line 638 of file irplib_framelist.c.
References irplib_framelist_load_propertylist().
cpl_error_code irplib_framelist_set_tag_all | ( | irplib_framelist * | self, | |
const char * | tag | |||
) |
Set the tag of all frames in the list.
self | The framelist to modify | |
tag | The new tag of the frames |
Definition at line 682 of file irplib_framelist.c.
cpl_error_code irplib_framelist_set | ( | irplib_framelist * | self, | |
cpl_frame * | frame, | |||
int | pos | |||
) |
Add a frame to a framelist.
self | The framelist to modify | |
frame | The frame to insert into the framelist | |
pos | position (0 for first). |
Definition at line 714 of file irplib_framelist.c.
Referenced by irplib_framelist_cast(), irplib_framelist_extract(), and irplib_framelist_extract_regexp().
cpl_error_code irplib_framelist_erase | ( | irplib_framelist * | self, | |
int | pos | |||
) |
Erase a frame from a framelist and delete it and its propertylist.
self | The non-empty framelist to modify | |
pos | position of frame to delete (0 for first). |
Definition at line 753 of file irplib_framelist.c.
cpl_frame* irplib_framelist_unset | ( | irplib_framelist * | self, | |
int | pos, | |||
cpl_propertylist ** | plist | |||
) |
Erase a frame from a framelist and return it to the caller.
self | The non-empty framelist to modify | |
pos | position of frame to delete (0 for first). | |
plist | Pointer to a propertylist or NULL |
Definition at line 803 of file irplib_framelist.c.
void irplib_framelist_empty | ( | irplib_framelist * | self | ) |
Erase all frames from a framelist.
self | The framelist to modify, or NULL |
Definition at line 849 of file irplib_framelist.c.
Referenced by irplib_framelist_delete().
cpl_error_code irplib_framelist_contains | ( | const irplib_framelist * | self, | |
const char * | key, | |||
cpl_type | type, | |||
cpl_boolean | is_equal, | |||
double | fp_tol | |||
) |
Verify that a property is present for all frames.
self | The framelist to verify | |
key | Property that must be present for all the frames | |
type | The type the property must have, or CPL_TYPE_INVALID | |
is_equal | If true, the value must be identical for all keys | |
fp_tol | The non-negative tolerance for floating point comparison |
irplib_framelist_contains(myframes, "MJD-OBS", CPL_TYPE_INVALID, CPL_FALSE, 0.0);
To verify that the EXPTIME is identical to within 0.1 millisecond:
irplib_framelist_contains(myframes, "EXPTIME", CPL_TYPE_INVALID, CPL_TRUE, 0.0001);
To verify that the keyword "ESO INS LAMP ST" is of type boolean and that it has the same value for all frames:
irplib_framelist_contains(myframes, "ESO INS LAMP ST", CPL_TYPE_BOOL, CPL_TRUE, 0.0);
Definition at line 909 of file irplib_framelist.c.
Referenced by naco_imagelist_load_diff().
cpl_imagelist* irplib_imagelist_load_framelist | ( | const irplib_framelist * | self, | |
cpl_type | pixeltype, | |||
int | planenum, | |||
int | extnum | |||
) |
Load an imagelist from a framelist.
self | The framelist | |
pixeltype | The required type of the pixels in the images | |
planenum | The (non-negative ) plane number | |
extnum | The non-negative extension (0 for primary data unit) |
Definition at line 1052 of file irplib_framelist.c.