UVES Pipeline Reference Manual  5.4.6
Data Structures | Typedefs | Enumerations | Functions | Variables
Property Lists

Data Structures

struct  _uves_propertylist_
 
struct  _uves_regexp_
 

Typedefs

typedef struct _uves_regexp_ uves_regexp
 
typedef struct _uves_propertylist_ uves_propertylist
 The opaque property list data type.
 

Enumerations

enum  { FITS_STDKEY_MAX = 8, FITS_SVALUE_MAX = 68 }
 

Functions

static void propertylist_append_property (uves_propertylist *plist, const cpl_property *p)
 
static void propertylist_prepend_property_cpl (cpl_propertylist *plist, const cpl_property *p)
 
static cpl_propertylist * uves_propertylist_to_cpl (const uves_propertylist *self)
 
static void uves_propertylist_from_cpl (uves_propertylist *self, const cpl_propertylist *list_cpl)
 
cpl_error_code uves_vector_save (const cpl_vector *v, const char *f, cpl_type_bpp bpp, const uves_propertylist *header, unsigned mode)
 
cpl_error_code uves_image_save (const cpl_image *image, const char *f, cpl_type_bpp bpp, const uves_propertylist *header, unsigned mode)
 
cpl_error_code uves_imagelist_save (const cpl_imagelist *imagelist, const char *f, cpl_type_bpp bpp, const uves_propertylist *header, unsigned mode)
 
cpl_error_code uves_table_save (const cpl_table *table, const uves_propertylist *header, const uves_propertylist *ext_header, const char *filename, unsigned mode)
 
cpl_error_code uves_dfs_setup_product_header (uves_propertylist *header, const cpl_frame *product_frame, const cpl_frameset *framelist, const cpl_parameterlist *parlist, const char *recid, const char *pipeline_id, const char *dictionary_id)
 
cpl_error_code uves_table_sort (cpl_table *t, const uves_propertylist *list)
 
static void error_push (void)
 
static void error_pop (void)
 
static cxint _uves_propertylist_filter_regexp (cxcptr key, cxcptr filter)
 
static cxbool _uves_propertylist_compare (const cpl_property *property, const char *name)
 
static cxbool _uves_propertylist_compare_regexp (const cpl_property *property, uves_regexp *re)
 
static uves_deque_iterator _uves_propertylist_find (const uves_propertylist *self, const char *name)
 
static cpl_property * _uves_propertylist_get (const uves_propertylist *self, const char *name)
 
static int _uves_propertylist_insert (uves_propertylist *self, const cxchar *where, cxbool after, const cxchar *name, cpl_type type, cxptr value)
 
static cxint _uves_propertylist_decode_fits (const qfits_header *header, cxint i, cxchar *key, cxint *type, cxchar *value, cxchar *comment)
 
static cxint _uves_propertylist_from_fits (uves_propertylist *self, const qfits_header *header, cx_compare_func filter, cxcptr data)
 
uves_propertylistuves_propertylist_new (void)
 Create an empty property list. More...
 
uves_propertylistuves_propertylist_duplicate (const uves_propertylist *self)
 Create a copy of the given property list. More...
 
void uves_propertylist_delete (const uves_propertylist *self)
 Destroy a property list. More...
 
long uves_propertylist_get_size (const uves_propertylist *self)
 Get the current size of a property list. More...
 
int uves_propertylist_is_empty (const uves_propertylist *self)
 Check whether a property list is empty. More...
 
cpl_type uves_propertylist_get_type (const uves_propertylist *self, const char *name)
 Get the the type of a property list entry. More...
 
int uves_propertylist_contains (const uves_propertylist *self, const char *name)
 Check whether a property is present in a property list. More...
 
int my_uves_propertylist_contains (const cpl_propertylist *self, const char *name)
 Check whether a property is present in a property list. More...
 
cpl_error_code uves_propertylist_set_comment (uves_propertylist *self, const char *name, const char *comment)
 Modify the comment field of the given property list entry. More...
 
cpl_error_code uves_propertylist_set_char (uves_propertylist *self, const char *name, char value)
 Set the value of the given character property list entry. More...
 
cpl_error_code uves_propertylist_set_bool (uves_propertylist *self, const char *name, int value)
 Set the value of the given boolean property list entry. More...
 
cpl_error_code uves_propertylist_set_int (uves_propertylist *self, const char *name, int value)
 Set the value of the given integer property list entry. More...
 
cpl_error_code uves_propertylist_set_long (uves_propertylist *self, const char *name, long value)
 Set the value of the given long property list entry. More...
 
cpl_error_code uves_propertylist_set_float (uves_propertylist *self, const char *name, float value)
 Set the value of the given float property list entry. More...
 
cpl_error_code uves_propertylist_set_double (uves_propertylist *self, const char *name, double value)
 Set the value of the given double property list entry. More...
 
cpl_error_code uves_propertylist_set_string (uves_propertylist *self, const char *name, const char *value)
 Set the value of the given string property list entry. More...
 
const cpl_property * uves_propertylist_get_const (const uves_propertylist *self, long position)
 Access property list elements by index. More...
 
cpl_property * uves_propertylist_get (uves_propertylist *self, long position)
 
const char * uves_propertylist_get_comment (const uves_propertylist *self, const char *name)
 Get the comment of the given property list entry. More...
 
char uves_propertylist_get_char (const uves_propertylist *self, const char *name)
 Get the character value of the given property list entry. More...
 
int uves_propertylist_get_bool (const uves_propertylist *self, const char *name)
 Get the boolean value of the given property list entry. More...
 
int uves_propertylist_get_int (const uves_propertylist *self, const char *name)
 Get the integer value of the given property list entry. More...
 
long uves_propertylist_get_long (const uves_propertylist *self, const char *name)
 Get the long value of the given property list entry. More...
 
float uves_propertylist_get_float (const uves_propertylist *self, const char *name)
 Get the float value of the given property list entry. More...
 
double uves_propertylist_get_double (const uves_propertylist *self, const char *name)
 Get the double value of the given property list entry. More...
 
const char * uves_propertylist_get_string (const uves_propertylist *self, const char *name)
 Get the string value of the given property list entry. More...
 
cpl_error_code uves_propertylist_insert_char (uves_propertylist *self, const char *here, const char *name, char value)
 Insert a character value into a property list at the given position. More...
 
cpl_error_code uves_propertylist_insert_bool (uves_propertylist *self, const char *here, const char *name, int value)
 Insert a boolean value into a property list at the given position. More...
 
cpl_error_code uves_propertylist_insert_int (uves_propertylist *self, const char *here, const char *name, int value)
 Insert a integer value into a property list at the given position. More...
 
int uves_propertylist_has (const uves_propertylist *self, const char *name)
 Check whether a property is present in a property list. More...
 
cpl_error_code uves_propertylist_insert_long (uves_propertylist *self, const char *here, const char *name, long value)
 Insert a long value into a property list at the given position. More...
 
cpl_error_code uves_propertylist_insert_float (uves_propertylist *self, const char *here, const char *name, float value)
 Insert a float value into a property list at the given position. More...
 
cpl_error_code uves_propertylist_insert_double (uves_propertylist *self, const char *here, const char *name, double value)
 Insert a double value into a property list at the given position. More...
 
cpl_error_code uves_propertylist_insert_string (uves_propertylist *self, const char *here, const char *name, const char *value)
 Insert a string value into a property list at the given position. More...
 
cpl_error_code uves_propertylist_insert_after_char (uves_propertylist *self, const char *after, const char *name, char value)
 Insert a character value into a property list after the given position. More...
 
cpl_error_code uves_propertylist_insert_after_bool (uves_propertylist *self, const char *after, const char *name, int value)
 Insert a boolean value into a property list after the given position. More...
 
cpl_error_code uves_propertylist_insert_after_int (uves_propertylist *self, const char *after, const char *name, int value)
 Insert a integer value into a property list after the given position. More...
 
cpl_error_code uves_propertylist_insert_after_long (uves_propertylist *self, const char *after, const char *name, long value)
 Insert a long value into a property list after the given position. More...
 
cpl_error_code uves_propertylist_insert_after_float (uves_propertylist *self, const char *after, const char *name, float value)
 Insert a float value into a property list after the given position. More...
 
cpl_error_code uves_propertylist_insert_after_double (uves_propertylist *self, const char *after, const char *name, double value)
 Insert a double value into a property list after the given position. More...
 
cpl_error_code uves_propertylist_insert_after_string (uves_propertylist *self, const char *after, const char *name, const char *value)
 Insert a string value into a property list after the given position. More...
 
cpl_error_code uves_propertylist_prepend_char (uves_propertylist *self, const char *name, char value)
 Prepend a character value to a property list. More...
 
cpl_error_code uves_propertylist_prepend_bool (uves_propertylist *self, const char *name, int value)
 Prepend a boolean value to a property list. More...
 
cpl_error_code uves_propertylist_prepend_int (uves_propertylist *self, const char *name, int value)
 Prepend a integer value to a property list. More...
 
cpl_error_code uves_propertylist_prepend_long (uves_propertylist *self, const char *name, long value)
 Prepend a long value to a property list. More...
 
cpl_error_code uves_propertylist_prepend_float (uves_propertylist *self, const char *name, float value)
 Prepend a float value to a property list. More...
 
cpl_error_code uves_propertylist_prepend_double (uves_propertylist *self, const char *name, double value)
 Prepend a double value to a property list. More...
 
cpl_error_code uves_propertylist_prepend_string (uves_propertylist *self, const char *name, const char *value)
 Prepend a string value to a property list. More...
 
cpl_error_code uves_propertylist_append_char (uves_propertylist *self, const char *name, char value)
 
cpl_error_code uves_propertylist_append_bool (uves_propertylist *self, const char *name, int value)
 
cpl_error_code uves_propertylist_append_int (uves_propertylist *self, const char *name, int value)
 
cpl_error_code uves_propertylist_append_long (uves_propertylist *self, const char *name, long value)
 
cpl_error_code uves_propertylist_append_float (uves_propertylist *self, const char *name, float value)
 
cpl_error_code uves_propertylist_append_double (uves_propertylist *self, const char *name, double value)
 
cpl_error_code uves_propertylist_append_string (uves_propertylist *self, const char *name, const char *value)
 
cpl_error_code uves_propertylist_append_c_char (uves_propertylist *self, const char *name, char value, const char *comment)
 Append a character value to a property list. More...
 
cpl_error_code uves_propertylist_append_c_bool (uves_propertylist *self, const char *name, int value, const char *comment)
 Append a boolean value to a property list. More...
 
cpl_error_code uves_propertylist_append_c_int (uves_propertylist *self, const char *name, int value, const char *comment)
 Append an integer value to a property list. More...
 
cpl_error_code uves_propertylist_append_c_long (uves_propertylist *self, const char *name, long value, const char *comment)
 Append a long value to a property list. More...
 
cpl_error_code uves_propertylist_append_c_float (uves_propertylist *self, const char *name, float value, const char *comment)
 Append a float value to a property list. More...
 
cpl_error_code uves_propertylist_append_c_double (uves_propertylist *self, const char *name, double value, const char *comment)
 Append a double value to a property list. More...
 
cpl_error_code uves_propertylist_append_c_string (uves_propertylist *self, const char *name, const char *value, const char *comment)
 Append a string value to a property list. More...
 
cpl_error_code uves_propertylist_append (uves_propertylist *self, const uves_propertylist *other)
 Append a property list.. More...
 
int uves_propertylist_erase (uves_propertylist *self, const char *name)
 Erase the given property from a property list. More...
 
int uves_propertylist_erase_regexp (uves_propertylist *self, const char *regexp, int invert)
 Erase all properties with name matching a given regular expression. More...
 
void uves_propertylist_empty (uves_propertylist *self)
 Remove all properties from a property list. More...
 
cpl_error_code uves_propertylist_update_char (uves_propertylist *self, const char *name, char value)
 Update a property list with a character value. More...
 
cpl_error_code uves_propertylist_update_bool (uves_propertylist *self, const char *name, int value)
 Update a property list with a boolean value. More...
 
cpl_error_code uves_propertylist_update_int (uves_propertylist *self, const char *name, int value)
 Update a property list with a integer value. More...
 
cpl_error_code uves_propertylist_update_long (uves_propertylist *self, const char *name, long value)
 Update a property list with a long value. More...
 
cpl_error_code uves_propertylist_update_float (uves_propertylist *self, const char *name, float value)
 Update a property list with a float value. More...
 
cpl_error_code uves_propertylist_update_double (uves_propertylist *self, const char *name, double value)
 Update a property list with a double value. More...
 
cpl_error_code uves_propertylist_update_string (uves_propertylist *self, const char *name, const char *value)
 Update a property list with a string value. More...
 
cpl_error_code uves_propertylist_copy_property (uves_propertylist *self, const uves_propertylist *other, const char *name)
 Copy a property from another property list. More...
 
cpl_error_code uves_propertylist_copy_property_regexp (uves_propertylist *self, const uves_propertylist *other, const char *regexp, int invert)
 Copy matching properties from another property list. More...
 
uves_propertylistuves_propertylist_load (const char *name, int position)
 Create a property list from a file. More...
 
uves_propertylistuves_propertylist_load_regexp (const char *name, int position, const char *regexp, int invert)
 Create a filtered property list from a file. More...
 
qfits_header * uves_propertylist_to_fits (const uves_propertylist *self)
 
uves_propertylistuves_propertylist_from_fits (const qfits_header *header)
 

Variables

static cpl_error_code push_pop_error
 

Detailed Description

This module is the same as CPL-3.1 property lists but implemented using a deque (a vector that can grow in both ends in amortized constant time) rather than a linked list.

This was a necessary change in order for property lists to be usable with MIDAS generated FLAMES calibration data (a simple loop is now O(n), not O(n^2), for FLAMES data we have n ~= 10^5)

This module still uses the cpl_property module

Function Documentation

uves_propertylist* uves_propertylist_new ( void  )
uves_propertylist* uves_propertylist_duplicate ( const uves_propertylist self)

Create a copy of the given property list.

Parameters
selfThe property list to be copied.
Returns
The created copy or NULL in case an error occurred.
CPL_ERROR_NULL_INPUT The parameter self is a NULL pointer.

The function creates a deep copy of the given property list self, i.e the created copy and the original property list do not share any resources.

Definition at line 801 of file uves_propertylist.c.

References uves_propertylist_new().

Referenced by convert_to_history(), extract_ff_rebin_merge(), and uves_reduce_mflat_combine().

void uves_propertylist_delete ( const uves_propertylist self)

Destroy a property list.

Parameters
selfThe property list to destroy.
Returns
Nothing.

The function destroys the property list self and its whole contents.

Definition at line 850 of file uves_propertylist.c.

Referenced by table_erase_selected(), uves_propertylist_load(), and uves_propertylist_load_regexp().

long uves_propertylist_get_size ( const uves_propertylist self)

Get the current size of a property list.

Parameters
selfA property list.
Returns
The property list's current size, or 0 if the list is empty. If an error occurs the function returns 0 and sets an appropriate error code.
CPL_ERROR_NULL_INPUT The parameter self is a NULL pointer.

The function reports the current number of elements stored in the property list self.

Definition at line 890 of file uves_propertylist.c.

Referenced by convert_to_history(), load_frame_header(), load_header(), parse_history(), scdcop(), test_bad_corr(), uves_find_property_const(), uves_pfits_set_history_val(), and uves_print_uves_propertylist().

int uves_propertylist_is_empty ( const uves_propertylist self)

Check whether a property list is empty.

Parameters
selfA property list.
Returns
The function returns 1 if the list is empty, and 0 otherwise. In case an error occurs the function returns -1 and sets an appropriate error code.
CPL_ERROR_NULL_INPUT The parameter self is a NULL pointer.

The function checks if self contains any properties.

Definition at line 932 of file uves_propertylist.c.

Referenced by uves_print_uves_propertylist().

cpl_type uves_propertylist_get_type ( const uves_propertylist self,
const char *  name 
)

Get the the type of a property list entry.

Parameters
selfA property list.
nameThe property name to look up.
Returns
The type of the stored value. If an error occurs the function returns CPL_TYPE_INVALID and sets an appropriate error code.
CPL_ERROR_NULL_INPUT The parameter self or name is a NULL pointer.
CPL_ERROR_DATA_NOT_FOUND The property list self does not contain a property with the name name.

The function returns the type of the value stored in self with the name name.

Definition at line 983 of file uves_propertylist.c.

Referenced by uves_pfits_get_ordpred().

int uves_propertylist_contains ( const uves_propertylist self,
const char *  name 
)

Check whether a property is present in a property list.

Parameters
selfA property list.
nameThe property name to look up.
Returns
The function returns 1 if the property is present, or 0 otherwise. If an error occurs the function returns 0 and sets an appropriate error code.
CPL_ERROR_NULL_INPUT The parameter self or name is a NULL pointer.

The function searches the property list self for a property with the name name and reports whether it was found or not.

Definition at line 1037 of file uves_propertylist.c.

Referenced by flames_midas_sccget(), set_column_format_unit_tnull(), uves_define_noise(), uves_flames_pfits_get_plateid(), uves_pfits_get_datancom(), uves_pfits_get_offset(), uves_pfits_get_ordpred(), uves_pfits_put_qc(), uves_qclog_init(), uves_reduce(), and uves_save_paf().

int my_uves_propertylist_contains ( const cpl_propertylist *  self,
const char *  name 
)

Check whether a property is present in a property list.

Parameters
selfA property list.
nameThe property name to look up.
Returns
The function returns 1 if the property is present, or 0 otherwise. If an error occurs the function returns 0 and sets an appropriate error code.
CPL_ERROR_NULL_INPUT The parameter self or name is a NULL pointer.

The function searches the property list self for a property with the name name and reports whether it was found or not.

Definition at line 1085 of file uves_propertylist.c.

cpl_error_code uves_propertylist_set_comment ( uves_propertylist self,
const char *  name,
const char *  comment 
)

Modify the comment field of the given property list entry.

Parameters
selfA property list.
nameThe property name to look up.
commentNew comment string.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
CPL_ERROR_NULL_INPUT The parameter self or name is a NULL pointer.
CPL_ERROR_DATA_NOT_FOUND The property list self does not contain a property with the name name.

The function searches the property list self for a property named name. If it is present in the list, its comment is replaced by the string comment. The provided comment string may be NULL. In this case an already existing comment is deleted.

Definition at line 1145 of file uves_propertylist.c.

Referenced by uves_pfits_put_qc(), uves_pfits_set_data_average(), uves_pfits_set_data_max(), uves_pfits_set_data_median(), uves_pfits_set_data_min(), uves_pfits_set_data_stddev(), uves_pfits_set_exptime(), and uves_pfits_set_ordpred().

cpl_error_code uves_propertylist_set_char ( uves_propertylist self,
const char *  name,
char  value 
)

Set the value of the given character property list entry.

Parameters
selfA property list.
nameThe property name to look up.
valueNew character value.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
CPL_ERROR_NULL_INPUT The parameter self or name is a NULL pointer.
CPL_ERROR_DATA_NOT_FOUND The property list self does not contain a property with the name name.

The function searches the property list self for a property named name. If it is present in the list, its character value is replaced with the character value.

Definition at line 1210 of file uves_propertylist.c.

cpl_error_code uves_propertylist_set_bool ( uves_propertylist self,
const char *  name,
int  value 
)

Set the value of the given boolean property list entry.

Parameters
selfA property list.
nameThe property name to look up.
valueNew boolean value.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
CPL_ERROR_NULL_INPUT The parameter self or name is a NULL pointer.
CPL_ERROR_DATA_NOT_FOUND The property list self does not contain a property with the name name.

The function searches the property list self for a property named name. If it is present in the list, its boolean value is replaced with the boolean value.

Definition at line 1273 of file uves_propertylist.c.

cpl_error_code uves_propertylist_set_int ( uves_propertylist self,
const char *  name,
int  value 
)

Set the value of the given integer property list entry.

Parameters
selfA property list.
nameThe property name to look up.
valueNew integer value.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
CPL_ERROR_NULL_INPUT The parameter self or name is a NULL pointer.
CPL_ERROR_DATA_NOT_FOUND The property list self does not contain a property with the name name.

The function searches the property list self for a property named name. If it is present in the list, its integer value is replaced with the integer value.

Definition at line 1335 of file uves_propertylist.c.

cpl_error_code uves_propertylist_set_long ( uves_propertylist self,
const char *  name,
long  value 
)

Set the value of the given long property list entry.

Parameters
selfA property list.
nameThe property name to look up.
valueNew long value.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
CPL_ERROR_NULL_INPUT The parameter self or name is a NULL pointer.
CPL_ERROR_DATA_NOT_FOUND The property list self does not contain a property with the name name.

The function searches the property list self for a property named name. If it is present in the list, its long value is replaced with the long value.

Definition at line 1397 of file uves_propertylist.c.

cpl_error_code uves_propertylist_set_float ( uves_propertylist self,
const char *  name,
float  value 
)

Set the value of the given float property list entry.

Parameters
selfA property list.
nameThe property name to look up.
valueNew float value.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
CPL_ERROR_NULL_INPUT The parameter self or name is a NULL pointer.
CPL_ERROR_DATA_NOT_FOUND The property list self does not contain a property with the name name.

The function searches the property list self for a property named name. If it is present in the list, its float value is replaced with the float value.

Definition at line 1460 of file uves_propertylist.c.

cpl_error_code uves_propertylist_set_double ( uves_propertylist self,
const char *  name,
double  value 
)

Set the value of the given double property list entry.

Parameters
selfA property list.
nameThe property name to look up.
valueNew double value.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
CPL_ERROR_NULL_INPUT The parameter self or name is a NULL pointer.
CPL_ERROR_DATA_NOT_FOUND The property list self does not contain a property with the name name.

The function searches the property list self for a property named name. If it is present in the list, its double value is replaced with the double value.

Definition at line 1523 of file uves_propertylist.c.

cpl_error_code uves_propertylist_set_string ( uves_propertylist self,
const char *  name,
const char *  value 
)

Set the value of the given string property list entry.

Parameters
selfA property list.
nameThe property name to look up.
valueNew string value.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
CPL_ERROR_NULL_INPUT The parameter self or name is a NULL pointer.
CPL_ERROR_DATA_NOT_FOUND The property list self does not contain a property with the name name.

The function searches the property list self for a property named name. If it is present in the list, its string value is replaced with the string value.

Definition at line 1586 of file uves_propertylist.c.

const cpl_property* uves_propertylist_get_const ( const uves_propertylist self,
long  position 
)

Access property list elements by index.

Parameters
selfThe property list to query.
positionIndex of the element to retrieve.
Returns
The function returns the property with index position, or NULL if position is out of range.
CPL_ERROR_NULL_INPUT The parameter self is a NULL pointer.

The function returns a handle for the property list element, the property, with the index position. Numbering of property list elements extends from 0 to uves_propertylist_get_size() - 1. If position is less than 0 or greater equal than uves_propertylist_get_size() the function returns NULL.

Definition at line 1642 of file uves_propertylist.c.

Referenced by parse_history(), uves_find_property_const(), and uves_print_uves_propertylist().

const char* uves_propertylist_get_comment ( const uves_propertylist self,
const char *  name 
)

Get the comment of the given property list entry.

Parameters
selfA property list.
nameThe property name to look up.
Returns
The comment of the property list entry, or NULL.
CPL_ERROR_NULL_INPUT The parameter self or name is a NULL pointer.
CPL_ERROR_DATA_NOT_FOUND The property list self does not contain a property with the name name.

The function searches the property list self for a property named name. If it is present in the list, its comment string is returned. If an entry with the name name is not found, or if the entry has no comment the function returns NULL.

Definition at line 1721 of file uves_propertylist.c.

char uves_propertylist_get_char ( const uves_propertylist self,
const char *  name 
)

Get the character value of the given property list entry.

Parameters
selfA property list.
nameThe property name to look up.
Returns
The character value stored in the list entry. The function returns '\0' if an error occurs and an appropriate error code is set.
CPL_ERROR_NULL_INPUT The parameter self or name is a NULL pointer.
CPL_ERROR_DATA_NOT_FOUND The property list self does not contain a property with the name name.
CPL_ERROR_TYPE_MISMATCH The sought-after property name is not of type CPL_TYPE_CHAR.

The function searches the property list self for a property named name. If it is present in the list, its character value is returned.

Definition at line 1788 of file uves_propertylist.c.

Referenced by uves_pfits_get_chipchoice().

int uves_propertylist_get_bool ( const uves_propertylist self,
const char *  name 
)

Get the boolean value of the given property list entry.

Parameters
selfA property list.
nameThe property name to look up.
Returns
The integer representation of the boolean value stored in the list entry. TRUE is represented as non-zero value while 0 indicates FALSE. The function returns 0 if an error occurs and an appropriate error code is set.
CPL_ERROR_NULL_INPUT The parameter self or name is a NULL pointer.
CPL_ERROR_DATA_NOT_FOUND The property list self does not contain a property with the name name.
CPL_ERROR_TYPE_MISMATCH The sought-after property name is not of type CPL_TYPE_BOOL.

The function searches the property list self for a property named name. If it is present in the list, its boolean value is returned.

Definition at line 1877 of file uves_propertylist.c.

int uves_propertylist_get_int ( const uves_propertylist self,
const char *  name 
)

Get the integer value of the given property list entry.

Parameters
selfA property list.
nameThe property name to look up.
Returns
The integer value stored in the list entry. The function returns 0 if an error occurs and an appropriate error code is set.
CPL_ERROR_NULL_INPUT The parameter self or name is a NULL pointer.
CPL_ERROR_DATA_NOT_FOUND The property list self does not contain a property with the name name.
CPL_ERROR_TYPE_MISMATCH The sought-after property name is not of type CPL_TYPE_INT.

The function searches the property list self for a property named name. If it is present in the list, its integer value is returned.

Definition at line 1964 of file uves_propertylist.c.

Referenced by scdcop(), set_column_format_unit_tnull(), uves_pfits_get_slit3_x1encoder(), and uves_pfits_get_slit3_x2encoder().

long uves_propertylist_get_long ( const uves_propertylist self,
const char *  name 
)

Get the long value of the given property list entry.

Parameters
selfA property list.
nameThe property name to look up.
Returns
The long value stored in the list entry. The function returns 0 if an error occurs and an appropriate error code is set.
CPL_ERROR_NULL_INPUT The parameter self or name is a NULL pointer.
CPL_ERROR_DATA_NOT_FOUND The property list self does not contain a property with the name name.
CPL_ERROR_TYPE_MISMATCH The sought-after property name is not of type CPL_TYPE_LONG.

The function searches the property list self for a property named name. If it is present in the list, its long value is returned.

Definition at line 2051 of file uves_propertylist.c.

float uves_propertylist_get_float ( const uves_propertylist self,
const char *  name 
)

Get the float value of the given property list entry.

Parameters
selfA property list.
nameThe property name to look up.
Returns
The float value stored in the list entry. The function returns 0 if an error occurs and an appropriate error code is set.
CPL_ERROR_NULL_INPUT The parameter self or name is a NULL pointer.
CPL_ERROR_DATA_NOT_FOUND The property list self does not contain a property with the name name.
CPL_ERROR_TYPE_MISMATCH The sought-after property name is not of type CPL_TYPE_FLOAT.

The function searches the property list self for a property named name. If it is present in the list, its float value is returned.

Definition at line 2138 of file uves_propertylist.c.

double uves_propertylist_get_double ( const uves_propertylist self,
const char *  name 
)

Get the double value of the given property list entry.

Parameters
selfA property list.
nameThe property name to look up.
Returns
The double value stored in the list entry. The function returns 0 if an error occurs and an appropriate error code is set.
CPL_ERROR_NULL_INPUT The parameter self or name is a NULL pointer.
CPL_ERROR_DATA_NOT_FOUND The property list self does not contain a property with the name name.
CPL_ERROR_TYPE_MISMATCH The sought-after property name is not of type CPL_TYPE_DOUBLE.

The function searches the property list self for a property named name. If it is present in the list, its double value is returned.

Definition at line 2225 of file uves_propertylist.c.

Referenced by uves_define_noise(), and uves_reduce().

const char* uves_propertylist_get_string ( const uves_propertylist self,
const char *  name 
)

Get the string value of the given property list entry.

Parameters
selfA property list.
nameThe property name to look up.
Returns
A handle to the string value stored in the list entry. The function returns NULL if an error occurs and an appropriate error code is set.
CPL_ERROR_NULL_INPUT The parameter self or name is a NULL pointer.
CPL_ERROR_DATA_NOT_FOUND The property list self does not contain a property with the name name.
CPL_ERROR_TYPE_MISMATCH The sought-after property name is not of type CPL_TYPE_STRING.

The function searches the property list self for a property named name. If it is present in the list, a handle to its string value is returned.

Definition at line 2314 of file uves_propertylist.c.

Referenced by flames_midas_sccget(), set_column_format_unit_tnull(), uves_flames_pfits_get_ident(), uves_flames_pfits_get_object(), and uves_save_paf().

cpl_error_code uves_propertylist_insert_char ( uves_propertylist self,
const char *  here,
const char *  name,
char  value 
)

Insert a character value into a property list at the given position.

Parameters
selfA property list.
hereName indicating the position at which the value is inserted.
nameThe property name to be assigned to the value.
valueThe character value to store.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
CPL_ERROR_NULL_INPUT The parameter self, here or name is a NULL pointer.
CPL_ERROR_UNSPECIFIED A property with the name name could not be inserted into self.

The function creates a new character property with name name and value value. The property is inserted into the property list self at the position of the property named here.

Definition at line 2397 of file uves_propertylist.c.

cpl_error_code uves_propertylist_insert_bool ( uves_propertylist self,
const char *  here,
const char *  name,
int  value 
)

Insert a boolean value into a property list at the given position.

Parameters
selfA property list.
hereName indicating the position at which the value is inserted.
nameThe property name to be assigned to the value.
valueThe boolean value to store.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
CPL_ERROR_NULL_INPUT The parameter self, here or name is a NULL pointer.
CPL_ERROR_UNSPECIFIED A property with the name name could not be inserted into self.

The function creates a new boolean property with name name and value value. The property is inserted into the property list self at the position of the property named here.

Definition at line 2462 of file uves_propertylist.c.

cpl_error_code uves_propertylist_insert_int ( uves_propertylist self,
const char *  here,
const char *  name,
int  value 
)

Insert a integer value into a property list at the given position.

Parameters
selfA property list.
hereName indicating the position at which the value is inserted.
nameThe property name to be assigned to the value.
valueThe integer value to store.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
CPL_ERROR_NULL_INPUT The parameter self, here or name is a NULL pointer.
CPL_ERROR_UNSPECIFIED A property with the name name could not be inserted into self.

The function creates a new integer property with name name and value value. The property is inserted into the property list self at the position of the property named here.

Definition at line 2527 of file uves_propertylist.c.

int uves_propertylist_has ( const uves_propertylist self,
const char *  name 
)

Check whether a property is present in a property list.

Parameters
selfA property list.
nameThe property name to look up.
Returns
The function returns 1 if the property is present, or 0 otherwise. If an error occurs the function returns 0 and sets an appropriate error code.
CPL_ERROR_NULL_INPUT The parameter self or name is a NULL pointer.

The function searches the property list self for a property with the name name and reports whether it was found or not.

Definition at line 2581 of file uves_propertylist.c.

Referenced by uves_reduce().

cpl_error_code uves_propertylist_insert_long ( uves_propertylist self,
const char *  here,
const char *  name,
long  value 
)

Insert a long value into a property list at the given position.

Parameters
selfA property list.
hereName indicating the position at which the value is inserted.
nameThe property name to be assigned to the value.
valueThe long value to store.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
CPL_ERROR_NULL_INPUT The parameter self, here or name is a NULL pointer.
CPL_ERROR_UNSPECIFIED A property with the name name could not be inserted into self.

The function creates a new long property with name name and value value. The property is inserted into the property list self at the position of the property named here.

Definition at line 2635 of file uves_propertylist.c.

cpl_error_code uves_propertylist_insert_float ( uves_propertylist self,
const char *  here,
const char *  name,
float  value 
)

Insert a float value into a property list at the given position.

Parameters
selfA property list.
hereName indicating the position at which the value is inserted.
nameThe property name to be assigned to the value.
valueThe float value to store.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
CPL_ERROR_NULL_INPUT The parameter self, here or name is a NULL pointer.
CPL_ERROR_UNSPECIFIED A property with the name name could not be inserted into self.

The function creates a new float property with name name and value value. The property is inserted into the property list self at the position of the property named here.

Definition at line 2700 of file uves_propertylist.c.

cpl_error_code uves_propertylist_insert_double ( uves_propertylist self,
const char *  here,
const char *  name,
double  value 
)

Insert a double value into a property list at the given position.

Parameters
selfA property list.
hereName indicating the position at which the value is inserted.
nameThe property name to be assigned to the value.
valueThe double value to store.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
CPL_ERROR_NULL_INPUT The parameter self, here or name is a NULL pointer.
CPL_ERROR_UNSPECIFIED A property with the name name could not be inserted into self.

The function creates a new double property with name name and value value. The property is inserted into the property list self at the position of the property named here.

Definition at line 2765 of file uves_propertylist.c.

cpl_error_code uves_propertylist_insert_string ( uves_propertylist self,
const char *  here,
const char *  name,
const char *  value 
)

Insert a string value into a property list at the given position.

Parameters
selfA property list.
hereName indicating the position at which the value is inserted.
nameThe property name to be assigned to the value.
valueThe string value to store.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
CPL_ERROR_NULL_INPUT The parameter self, here or name is a NULL pointer.
CPL_ERROR_UNSPECIFIED A property with the name name could not be inserted into self.

The function creates a new string property with name name and value value. The property is inserted into the property list self at the position of the property named here.

Definition at line 2830 of file uves_propertylist.c.

cpl_error_code uves_propertylist_insert_after_char ( uves_propertylist self,
const char *  after,
const char *  name,
char  value 
)

Insert a character value into a property list after the given position.

Parameters
selfA property list.
afterName of the property after which the value is inserted.
nameThe property name to be assigned to the value.
valueThe character value to store.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
CPL_ERROR_NULL_INPUT The parameter self, after or name is a NULL pointer.
CPL_ERROR_UNSPECIFIED A property with the name name could not be inserted into self.

The function creates a new character property with name name and value value. The property is inserted into the property list self after the property named after.

Definition at line 2895 of file uves_propertylist.c.

cpl_error_code uves_propertylist_insert_after_bool ( uves_propertylist self,
const char *  after,
const char *  name,
int  value 
)

Insert a boolean value into a property list after the given position.

Parameters
selfA property list.
afterName of the property after which the value is inserted.
nameThe property name to be assigned to the value.
valueThe boolean value to store.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
CPL_ERROR_NULL_INPUT The parameter self, after or name is a NULL pointer.
CPL_ERROR_UNSPECIFIED A property with the name name could not be inserted into self.

The function creates a new boolean property with name name and value value. The property is inserted into the property list self after the property named after.

Definition at line 2960 of file uves_propertylist.c.

cpl_error_code uves_propertylist_insert_after_int ( uves_propertylist self,
const char *  after,
const char *  name,
int  value 
)

Insert a integer value into a property list after the given position.

Parameters
selfA property list.
afterName of the property after which the value is inserted.
nameThe property name to be assigned to the value.
valueThe integer value to store.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
CPL_ERROR_NULL_INPUT The parameter self, after or name is a NULL pointer.
CPL_ERROR_UNSPECIFIED A property with the name name could not be inserted into self.

The function creates a new integer property with name name and value value. The property is inserted into the property list self after the property named after.

Definition at line 3025 of file uves_propertylist.c.

cpl_error_code uves_propertylist_insert_after_long ( uves_propertylist self,
const char *  after,
const char *  name,
long  value 
)

Insert a long value into a property list after the given position.

Parameters
selfA property list.
afterName of the property after which the value is inserted.
nameThe property name to be assigned to the value.
valueThe long value to store.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
CPL_ERROR_NULL_INPUT The parameter self, after or name is a NULL pointer.
CPL_ERROR_UNSPECIFIED A property with the name name could not be inserted into self.

The function creates a new long property with name name and value value. The property is inserted into the property list self after the property named after.

Definition at line 3090 of file uves_propertylist.c.

cpl_error_code uves_propertylist_insert_after_float ( uves_propertylist self,
const char *  after,
const char *  name,
float  value 
)

Insert a float value into a property list after the given position.

Parameters
selfA property list.
afterName of the property after which the value is inserted.
nameThe property name to be assigned to the value.
valueThe float value to store.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
CPL_ERROR_NULL_INPUT The parameter self, after or name is a NULL pointer.
CPL_ERROR_UNSPECIFIED A property with the name name could not be inserted into self.

The function creates a new float property with name name and value value. The property is inserted into the property list self after the property named after.

Definition at line 3155 of file uves_propertylist.c.

cpl_error_code uves_propertylist_insert_after_double ( uves_propertylist self,
const char *  after,
const char *  name,
double  value 
)

Insert a double value into a property list after the given position.

Parameters
selfA property list.
afterName of the property after which the value is inserted.
nameThe property name to be assigned to the value.
valueThe double value to store.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
CPL_ERROR_NULL_INPUT The parameter self, after or name is a NULL pointer.
CPL_ERROR_UNSPECIFIED A property with the name name could not be inserted into self.

The function creates a new double property with name name and value value. The property is inserted into the property list self after the property named after.

Definition at line 3220 of file uves_propertylist.c.

cpl_error_code uves_propertylist_insert_after_string ( uves_propertylist self,
const char *  after,
const char *  name,
const char *  value 
)

Insert a string value into a property list after the given position.

Parameters
selfA property list.
afterName of the property after which the value is inserted.
nameThe property name to be assigned to the value.
valueThe string value to store.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
CPL_ERROR_NULL_INPUT The parameter self, after or name is a NULL pointer.
CPL_ERROR_UNSPECIFIED A property with the name name could not be inserted into self.

The function creates a new string property with name name and value value. The property is inserted into the property list self after the property named after.

Definition at line 3286 of file uves_propertylist.c.

cpl_error_code uves_propertylist_prepend_char ( uves_propertylist self,
const char *  name,
char  value 
)

Prepend a character value to a property list.

Parameters
selfA property list.
nameThe property name to be assigned to the value.
valueThe character value to store.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
CPL_ERROR_NULL_INPUT The parameter self or name is a NULL pointer.

The function creates a new character property with name name and value value. The property is prepended to the property list self.

Definition at line 3343 of file uves_propertylist.c.

cpl_error_code uves_propertylist_prepend_bool ( uves_propertylist self,
const char *  name,
int  value 
)

Prepend a boolean value to a property list.

Parameters
selfA property list.
nameThe property name to be assigned to the value.
valueThe boolean value to store.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
CPL_ERROR_NULL_INPUT The parameter self or name is a NULL pointer.

The function creates a new boolean property with name name and value value. The property is prepended to the property list self.

Definition at line 3397 of file uves_propertylist.c.

cpl_error_code uves_propertylist_prepend_int ( uves_propertylist self,
const char *  name,
int  value 
)

Prepend a integer value to a property list.

Parameters
selfA property list.
nameThe property name to be assigned to the value.
valueThe integer value to store.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
CPL_ERROR_NULL_INPUT The parameter self or name is a NULL pointer.

The function creates a new integer property with name name and value value. The property is prepended to the property list self.

Definition at line 3451 of file uves_propertylist.c.

cpl_error_code uves_propertylist_prepend_long ( uves_propertylist self,
const char *  name,
long  value 
)

Prepend a long value to a property list.

Parameters
selfA property list.
nameThe property name to be assigned to the value.
valueThe long value to store.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
CPL_ERROR_NULL_INPUT The parameter self or name is a NULL pointer.

The function creates a new long property with name name and value value. The property is prepended to the property list self.

Definition at line 3505 of file uves_propertylist.c.

cpl_error_code uves_propertylist_prepend_float ( uves_propertylist self,
const char *  name,
float  value 
)

Prepend a float value to a property list.

Parameters
selfA property list.
nameThe property name to be assigned to the value.
valueThe float value to store.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
CPL_ERROR_NULL_INPUT The parameter self or name is a NULL pointer.

The function creates a new float property with name name and value value. The property is prepended to the property list self.

Definition at line 3559 of file uves_propertylist.c.

cpl_error_code uves_propertylist_prepend_double ( uves_propertylist self,
const char *  name,
double  value 
)

Prepend a double value to a property list.

Parameters
selfA property list.
nameThe property name to be assigned to the value.
valueThe double value to store.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
CPL_ERROR_NULL_INPUT The parameter self or name is a NULL pointer.

The function creates a new double property with name name and value value. The property is prepended to the property list self.

Definition at line 3613 of file uves_propertylist.c.

cpl_error_code uves_propertylist_prepend_string ( uves_propertylist self,
const char *  name,
const char *  value 
)

Prepend a string value to a property list.

Parameters
selfA property list.
nameThe property name to be assigned to the value.
valueThe string value to store.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
CPL_ERROR_NULL_INPUT The parameter self or name is a NULL pointer.

The function creates a new string property with name name and value value. The property is prepended to the property list self.

Definition at line 3667 of file uves_propertylist.c.

cpl_error_code uves_propertylist_append_c_char ( uves_propertylist self,
const char *  name,
char  value,
const char *  comment 
)

Append a character value to a property list.

Parameters
selfA property list.
nameThe property name to be assigned to the value.
valueThe character value to store.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
CPL_ERROR_NULL_INPUT The parameter self or name is a NULL pointer.

The function creates a new character property with name name and value value. The property is appended to the property list self.

Definition at line 3787 of file uves_propertylist.c.

cpl_error_code uves_propertylist_append_c_bool ( uves_propertylist self,
const char *  name,
int  value,
const char *  comment 
)

Append a boolean value to a property list.

Parameters
selfA property list.
nameThe property name to be assigned to the value.
valueThe boolean value to store.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
CPL_ERROR_NULL_INPUT The parameter self or name is a NULL pointer.

The function creates a new boolean property with name name and value value. The property is appended to the property list self.

Definition at line 3843 of file uves_propertylist.c.

cpl_error_code uves_propertylist_append_c_int ( uves_propertylist self,
const char *  name,
int  value,
const char *  comment 
)

Append an integer value to a property list.

Parameters
selfA property list.
nameThe property name to be assigned to the value.
valueThe integer value to store.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
CPL_ERROR_NULL_INPUT The parameter self or name is a NULL pointer.

The function creates a new integer property with name name and value value. The property is appended to the property list self.

Definition at line 3899 of file uves_propertylist.c.

Referenced by create_descr(), and load_header().

cpl_error_code uves_propertylist_append_c_long ( uves_propertylist self,
const char *  name,
long  value,
const char *  comment 
)

Append a long value to a property list.

Parameters
selfA property list.
nameThe property name to be assigned to the value.
valueThe long value to store.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
CPL_ERROR_NULL_INPUT The parameter self or name is a NULL pointer.

The function creates a new long property with name name and value value. The property is appended to the property list self.

Definition at line 3955 of file uves_propertylist.c.

cpl_error_code uves_propertylist_append_c_float ( uves_propertylist self,
const char *  name,
float  value,
const char *  comment 
)

Append a float value to a property list.

Parameters
selfA property list.
nameThe property name to be assigned to the value.
valueThe float value to store.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
CPL_ERROR_NULL_INPUT The parameter self or name is a NULL pointer.

The function creates a new float property with name name and value value. The property is appended to the property list self.

Definition at line 4011 of file uves_propertylist.c.

Referenced by create_descr(), and load_header().

cpl_error_code uves_propertylist_append_c_double ( uves_propertylist self,
const char *  name,
double  value,
const char *  comment 
)

Append a double value to a property list.

Parameters
selfA property list.
nameThe property name to be assigned to the value.
valueThe double value to store.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
CPL_ERROR_NULL_INPUT The parameter self or name is a NULL pointer.

The function creates a new double property with name name and value value. The property is appended to the property list self.

Definition at line 4067 of file uves_propertylist.c.

Referenced by create_descr(), load_header(), uves_mflat_process_chip(), and uves_reduce().

cpl_error_code uves_propertylist_append_c_string ( uves_propertylist self,
const char *  name,
const char *  value,
const char *  comment 
)

Append a string value to a property list.

Parameters
selfA property list.
nameThe property name to be assigned to the value.
valueThe string value to store.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
CPL_ERROR_NULL_INPUT The parameter self or name is a NULL pointer.

The function creates a new string property with name name and value value. The property is appended to the property list self.

Definition at line 4123 of file uves_propertylist.c.

Referenced by create_descr(), and load_header().

cpl_error_code uves_propertylist_append ( uves_propertylist self,
const uves_propertylist other 
)

Append a property list..

Parameters
selfA property list.
otherThe property to append.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
CPL_ERROR_NULL_INPUT The parameter self is a NULL pointer.

The function appends the property list other to the property list self.

Definition at line 4177 of file uves_propertylist.c.

Referenced by scdcop(), and uves_reduce_scired().

int uves_propertylist_erase ( uves_propertylist self,
const char *  name 
)

Erase the given property from a property list.

Parameters
selfA property list.
nameName of the property to erase.
Returns
On success the function returns the number of erased entries. If an error occurs the function returns 0 and an appropriate error code is set.
CPL_ERROR_NULL_INPUT The parameter self or name is a NULL pointer.

The function searches the property with the name name in the property list self and removes it. The property is destroyed. If self contains multiple duplicates of a property named name, only the first one is erased.

Definition at line 4239 of file uves_propertylist.c.

int uves_propertylist_erase_regexp ( uves_propertylist self,
const char *  regexp,
int  invert 
)

Erase all properties with name matching a given regular expression.

Parameters
selfA property list.
regexpRegular expression.
invertFlag inverting the sense of matching.
Returns
On success the function returns the number of erased entries. If an error occurs the function returns 0 and an appropriate error code is set.
CPL_ERROR_NULL_INPUT The parameter self or regexp is a NULL pointer.

The function searches for all the properties matching in the list self and removes them. Whether a property matches or not depends on the given regular expression regexp, and the flag invert. If invert is 0, all properties matching regexp are removed from the list. If invert is set to a non-zero value, all properties which do not match regexp are erased. The removed properties are destroyed.

The function expects POSIX 1003.2 compliant extended regular expressions.

Definition at line 4300 of file uves_propertylist.c.

Referenced by flames_midas_scddel(), and uves_utl_physmod().

void uves_propertylist_empty ( uves_propertylist self)

Remove all properties from a property list.

Parameters
selfA property list.
Returns
Nothing.
CPL_ERROR_NULL_INPUT The parameter self is a NULL pointer.

The function removes all properties from self. Each property is properly deallocated. After calling this function self is empty.

Definition at line 4382 of file uves_propertylist.c.

Referenced by test_bad_corr().

cpl_error_code uves_propertylist_update_char ( uves_propertylist self,
const char *  name,
char  value 
)

Update a property list with a character value.

Parameters
selfA property list.
nameThe property name to be assigned to the value.
valueThe character value to store.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
CPL_ERROR_NULL_INPUT The parameter self or name is a NULL pointer.
CPL_ERROR_TYPE_MISMATCH The property list self contains a property with the name name which is not of type CPL_TYPE_CHAR.

The function updates the property list self with the character value value. This means, if a property with the name name exists already its value is updated, otherwise a property with the name name is created and added to self. The update will fail if a property with the name name exists already which is not of type CPL_TYPE_CHAR.

Definition at line 4453 of file uves_propertylist.c.

cpl_error_code uves_propertylist_update_bool ( uves_propertylist self,
const char *  name,
int  value 
)

Update a property list with a boolean value.

Parameters
selfA property list.
nameThe property name to be assigned to the value.
valueThe boolean value to store.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
CPL_ERROR_NULL_INPUT The parameter self or name is a NULL pointer.
CPL_ERROR_TYPE_MISMATCH The property list self contains a property with the name name which is not of type CPL_TYPE_BOOL.

The function updates the property list self with the boolean value value. This means, if a property with the name name exists already its value is updated, otherwise a property with the name name is created and added to self. The update will fail if a property with the name name exists already which is not of type CPL_TYPE_BOOL.

Definition at line 4539 of file uves_propertylist.c.

cpl_error_code uves_propertylist_update_int ( uves_propertylist self,
const char *  name,
int  value 
)

Update a property list with a integer value.

Parameters
selfA property list.
nameThe property name to be assigned to the value.
valueThe integer value to store.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
CPL_ERROR_NULL_INPUT The parameter self or name is a NULL pointer.
CPL_ERROR_TYPE_MISMATCH The property list self contains a property with the name name which is not of type CPL_TYPE_INT.

The function updates the property list self with the integer value value. This means, if a property with the name name exists already its value is updated, otherwise a property with the name name is created and added to self. The update will fail if a property with the name name exists already which is not of type CPL_TYPE_INT.

Definition at line 4625 of file uves_propertylist.c.

Referenced by uves_flames_pfits_set_newplateid(), uves_pfits_set_hs(), uves_pfits_set_ocs_simcal(), uves_pfits_set_ordpred(), and uves_reduce_scired().

cpl_error_code uves_propertylist_update_long ( uves_propertylist self,
const char *  name,
long  value 
)

Update a property list with a long value.

Parameters
selfA property list.
nameThe property name to be assigned to the value.
valueThe long value to store.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
CPL_ERROR_NULL_INPUT The parameter self or name is a NULL pointer.
CPL_ERROR_TYPE_MISMATCH The property list self contains a property with the name name which is not of type CPL_TYPE_LONG.

The function updates the property list self with the long value value. This means, if a property with the name name exists already its value is updated, otherwise a property with the name name is created and added to self. The update will fail if a property with the name name exists already which is not of type CPL_TYPE_LONG.

Definition at line 4711 of file uves_propertylist.c.

cpl_error_code uves_propertylist_update_float ( uves_propertylist self,
const char *  name,
float  value 
)

Update a property list with a float value.

Parameters
selfA property list.
nameThe property name to be assigned to the value.
valueThe float value to store.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
CPL_ERROR_NULL_INPUT The parameter self or name is a NULL pointer.
CPL_ERROR_TYPE_MISMATCH The property list self contains a property with the name name which is not of type CPL_TYPE_FLOAT.

The function updates the property list self with the float value value. This means, if a property with the name name exists already its value is updated, otherwise a property with the name name is created and added to self. The update will fail if a property with the name name exists already which is not of type CPL_TYPE_FLOAT.

Definition at line 4797 of file uves_propertylist.c.

cpl_error_code uves_propertylist_update_double ( uves_propertylist self,
const char *  name,
double  value 
)

Update a property list with a double value.

Parameters
selfA property list.
nameThe property name to be assigned to the value.
valueThe double value to store.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
CPL_ERROR_NULL_INPUT The parameter self or name is a NULL pointer.
CPL_ERROR_TYPE_MISMATCH The property list self contains a property with the name name which is not of type CPL_TYPE_DOUBLE.

The function updates the property list self with the double value value. This means, if a property with the name name exists already its value is updated, otherwise a property with the name name is created and added to self. The update will fail if a property with the name name exists already which is not of type CPL_TYPE_DOUBLE.

Definition at line 4883 of file uves_propertylist.c.

Referenced by uves_flames_pfits_set_ccfposmax(), uves_pfits_set_bscale(), uves_pfits_set_cd1(), uves_pfits_set_cd11(), uves_pfits_set_cd12(), uves_pfits_set_cd21(), uves_pfits_set_cd22(), uves_pfits_set_cdelt1(), uves_pfits_set_cdelt2(), uves_pfits_set_crpix1(), uves_pfits_set_crpix2(), uves_pfits_set_crval1(), uves_pfits_set_crval2(), uves_pfits_set_data_average(), uves_pfits_set_data_max(), uves_pfits_set_data_median(), uves_pfits_set_data_min(), uves_pfits_set_data_stddev(), uves_pfits_set_dec(), uves_pfits_set_exptime(), uves_pfits_set_ra(), uves_pfits_set_wend(), uves_pfits_set_wlen1(), and uves_pfits_set_wstart().

cpl_error_code uves_propertylist_update_string ( uves_propertylist self,
const char *  name,
const char *  value 
)

Update a property list with a string value.

Parameters
selfA property list.
nameThe property name to be assigned to the value.
valueThe string value to store.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
CPL_ERROR_NULL_INPUT The parameter self or name is a NULL pointer.
CPL_ERROR_TYPE_MISMATCH The property list self contains a property with the name name which is not of type CPL_TYPE_STRING.

The function updates the property list self with the string value value. This means, if a property with the name name exists already its value is updated, otherwise a property with the name name is created and added to self. The update will fail if a property with the name name exists already which is not of type CPL_TYPE_STRING.

Definition at line 4969 of file uves_propertylist.c.

Referenced by uves_pfits_set_badpixcorr(), uves_pfits_set_bunit(), uves_pfits_set_bunit_no(), uves_pfits_set_ctype1(), uves_pfits_set_ctype2(), uves_pfits_set_cunit1(), uves_pfits_set_cunit2(), uves_pfits_set_dpr_catg(), uves_pfits_set_dpr_tech(), uves_pfits_set_dpr_type(), uves_pfits_set_object(), uves_pfits_set_redlevel(), uves_pfits_set_starttime(), uves_pfits_set_status(), uves_pfits_set_stoptime(), and uves_pfits_set_tunit_no().

cpl_error_code uves_propertylist_copy_property ( uves_propertylist self,
const uves_propertylist other,
const char *  name 
)

Copy a property from another property list.

Parameters
selfA property list.
otherThe property list from which a property is copied.
nameThe name of the property to copy.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
CPL_ERROR_NULL_INPUT The parameter self, other or name is a NULL pointer.
CPL_ERROR_DATA_NOT_FOUND The property list other does not contain a property with the name name.
CPL_ERROR_TYPE_MISMATCH The property list self contains a property with the name name which is not of the same type as the property which should be copied from other.

The function copies the property name from the property list other to the property list self. If the property list self does not already contain a property name the property is appended to self. If a property name exists already in self the function overwrites the contents of this property if and only if this property is of the same type as the property to be copied from other.

Definition at line 5064 of file uves_propertylist.c.

cpl_error_code uves_propertylist_copy_property_regexp ( uves_propertylist self,
const uves_propertylist other,
const char *  regexp,
int  invert 
)

Copy matching properties from another property list.

Parameters
selfA property list.
otherThe property list from which a property is copied.
regexpThe regular expression used to select properties.
invertFlag inverting the sense of matching.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
CPL_ERROR_NULL_INPUT The parameter self, other or regexp is a NULL pointer.
CPL_ERROR_ILLEGAL_INPUT The parameter regexp is an invalid regular expression.
CPL_ERROR_TYPE_MISMATCH The property list self contains a property with the name name which is not of the same type as the property which should be copied from other.

The function copies all properties with matching names from the property list other to the property list self. If the flag invert is zero, all properties whose names match the regular expression regexp are copied. If invert is set to a non-zero value, all properties with names not matching regexp are copied rather. The function expects POSIX 1003.2 compliant extended regular expressions.

If the property list self does not already contain one of the properties to be copied this property is appended to self. If a property to be copied exists already in self the function overwrites the contents of this property.

Before properties are copied from the property list other to self the types of the properties are checked and if any type mismatch is detected the function stops processing immediately. The property list self is not at all modified in this case.

See Also
uves_propertylist_copy_property()

Definition at line 5213 of file uves_propertylist.c.

Referenced by extract_ff_rebin_merge(), and scdcop().

uves_propertylist* uves_propertylist_load ( const char *  name,
int  position 
)

Create a property list from a file.

Parameters
nameName of the input file.
positionIndex of the data set to read.
Returns
The function returns the newly created property list or NULL if an error occurred.
CPL_ERROR_NULL_INPUT The parameter name is a NULL pointer.
CPL_ERROR_ILLEGAL_INPUT The position is less than 0 or the properties cannot be read from the file name.
CPL_ERROR_FILE_IO The file name does not exist.
CPL_ERROR_BAD_FILE_FORMAT The file name is not a valid FITS file.
CPL_ERROR_DATA_NOT_FOUND The requested data set at index position does not exist.

The function reads the properties of the data set with index position from the file name.

Currently only the FITS file format is supported. The property list is created by reading the FITS keywords from extension position. The numbering of the data sections starts from 0. When creating the property list from a FITS header, any keyword without a value like undefined keywords for instance are not transformed into a property.

See Also
uves_propertylist_load_regexp()

Definition at line 5441 of file uves_propertylist.c.

References uves_propertylist_delete(), and uves_propertylist_new().

Referenced by flames_midas_sccget(), flames_midas_scfinf(), flames_utl_unpack(), load_frame(), load_header(), test_load_3dtable(), uves_mflat_at_ypos(), uves_reduce_mflat_combine(), uves_reduce_scired(), uves_tablename_remove_units(), and uves_tablenames_unify_units().

uves_propertylist* uves_propertylist_load_regexp ( const char *  name,
int  position,
const char *  regexp,
int  invert 
)

Create a filtered property list from a file.

Parameters
nameName of the input file.
positionIndex of the data set to read.
regexpRegular expression used to filter properties.
invertFlag inverting the sense of matching property names.
Returns
The function returns the newly created property list or NULL if an error occurred.
CPL_ERROR_NULL_INPUT The parameter name or the parameter regexp is a NULL pointer.
CPL_ERROR_ILLEGAL_INPUT The position is less than 0, the properties cannot be read from the file name, or regexp is not a valid extended regular expression.
CPL_ERROR_FILE_IO The file name does not exist.
CPL_ERROR_BAD_FILE_FORMAT The file name is not a valid FITS file.
CPL_ERROR_DATA_NOT_FOUND The requested data set at index position does not exist.

The function reads all properties of the data set with index position with matching names from the file name. If the flag invert is zero, all properties whose names match the regular expression regexp are read. If invert is set to a non-zero value, all properties with names not matching regexp are read rather. The function expects POSIX 1003.2 compliant extended regular expressions.

Currently only the FITS file format is supported. The property list is created by reading the FITS keywords from extension position. The numbering of the data sections starts from 0.

When creating the property list from a FITS header, any keyword without a value like undefined keywords for instance are not transformed into a property. FITS format specific keyword prefixes (e.g. HIERARCH) must not be part of the given pattern string regexp, but only the actual FITS keyword name may be given.

See Also
uves_propertylist_load()

Definition at line 5588 of file uves_propertylist.c.

References uves_propertylist_delete(), and uves_propertylist_new().