Miscellaneous Utilities
Functions | |
const cxchar * | giraffe_get_license (void) |
Get the pipeline copyright and license. | |
GiInstrumentMode | giraffe_get_mode (cpl_propertylist *properties) |
Determines the instrument mode from a property list. | |
cxchar * | giraffe_path_get_basename (const cxchar *path) |
Gets the name of a file without any leading directory components. | |
cxchar * | giraffe_localtime_iso8601 (void) |
Get the current date and time in ISO 8601 format. | |
cxint | giraffe_add_recipe_info (cpl_propertylist *plist, const GiRecipeInfo *info) |
Add recipe specific information to a property list. | |
cxint | giraffe_add_frameset_info (cpl_propertylist *plist, const cpl_frameset *set, cxint sequence) |
Add frameset specific information to a property list. | |
cxint | giraffe_propertylist_update (cpl_propertylist *self, cpl_propertylist *properties, const cxchar *regexp) |
Update a property list. | |
cxint | giraffe_propertylist_copy (cpl_propertylist *self, const cxchar *name, const cpl_propertylist *other, const cxchar *othername) |
Copy a property from one list to another. | |
cxdouble | giraffe_propertylist_get_ron (const cpl_propertylist *properties) |
Retrieve the read-out noise from the given properties. |
Detailed Description
TBD
Function Documentation
cxint giraffe_add_frameset_info | ( | cpl_propertylist * | plist, | |
const cpl_frameset * | set, | |||
cxint | sequence | |||
) |
Add frameset specific information to a property list.
- Parameters:
-
plist The propertylist to update. set A reference frameset sequence Recipe sequence number
- Returns:
- The function returns 0 on success, or a non-zero number in case an error occurred.
The function adds DFS specific information to the property list plist, used for product frames. This information, name, tag, and MD5SUM of the files used during processing are taken from the contents of the reference frameset set.
The recipe sequence number sequence is the index of a recipe within a recipe chain. For single recipe calls this is always 1
.
Definition at line 586 of file giutils.c.
References giraffe_path_get_basename().
Referenced by giraffe_image_add_info(), and giraffe_table_add_info().
cxint giraffe_add_recipe_info | ( | cpl_propertylist * | plist, | |
const GiRecipeInfo * | info | |||
) |
Add recipe specific information to a property list.
TBD
Definition at line 488 of file giutils.c.
Referenced by giraffe_image_add_info(), and giraffe_table_add_info().
const cxchar* giraffe_get_license | ( | void | ) |
GiInstrumentMode giraffe_get_mode | ( | cpl_propertylist * | properties | ) |
Determines the instrument mode from a property list.
- Parameters:
-
properties The property list to query.
- Returns:
- The function returns the used instrument mode, or
GIMODE_NONE
if the mode cannot be determined or an error occurs.
The function determines the instrument mode by querying the properties properties.
Definition at line 305 of file giutils.c.
References gi_warning().
Referenced by giraffe_fiberlist_create(), giraffe_fov_build(), giraffe_grating_create(), giraffe_grating_setup(), giraffe_localize_spectra(), and giraffe_slitgeometry_load().
cxchar* giraffe_localtime_iso8601 | ( | void | ) |
Get the current date and time in ISO 8601 format.
- Returns:
- The string containing the current date and time in the ISO 8601 format. If an error occurs the function returns
NULL
.
The function formats the current date and the local system time according to the ISO 8601 format and puts both together in a string. The returned string must be deallocated using cx_free().
cxchar* giraffe_path_get_basename | ( | const cxchar * | path | ) |
Gets the name of a file without any leading directory components.
- Parameters:
-
path The name of the file path.
- Returns:
- The name of the file with any leading directory components removed.
Gets the name of the file without any leading directory components. The function allocates a buffer containing the stripped file name. The returned string should be deallocated using cx_free() when it is no longer needed.
Definition at line 383 of file giutils.c.
Referenced by giraffe_add_frameset_info().
cxint giraffe_propertylist_copy | ( | cpl_propertylist * | self, | |
const cxchar * | name, | |||
const cpl_propertylist * | other, | |||
const cxchar * | othername | |||
) |
cxdouble giraffe_propertylist_get_ron | ( | const cpl_propertylist * | properties | ) |
Retrieve the read-out noise from the given properties.
- Parameters:
-
properties The property list to use for the read-out noise computation.
- Returns:
- The function returns the computed read-out noise in electrons. In case an error occurred, a negative number is returned, and an appropriate error code is set.
- Errors:
CPL_ERROR_DATA_NOT_FOUND Any of the required (detecor read-out noise, conversion factor) properties was not found.
The function determines the detector read-out noise in electrons from the properties properties. The properties are searched for the measured read-out noise property (bias sigma). If this is not found, the default detector read-out noise property is taken. The conversion factor property is used to convert the read-out noise from ADU into electrons, as necessary.
Definition at line 1188 of file giutils.c.
Referenced by giraffe_compute_fiber_profiles(), giraffe_extract_spectra(), and giraffe_localize_spectra().
cxint giraffe_propertylist_update | ( | cpl_propertylist * | self, | |
cpl_propertylist * | properties, | |||
const cxchar * | regexp | |||
) |
Update a property list.
- Parameters:
-
self The property list to update. properties The source property list. regexp A property name pattern.
- Returns:
- The function returns 0 on success and a non-zero value in case an error occurred. In the latter case an error code is also set.
The function updates the target property list with properties from the source list properties, which are not present in self. If a pattern string is given only properties with names matching the given pattern regexp are taken into account when self is updated. If a pattern is given, it must be a valid regular expression. If the pattern string is either NULL
or the empty string, the whole source list is considered during the update operation.
Definition at line 747 of file giutils.c.
Referenced by giraffe_extract_spectra().