DFS Utilities


Functions

int dfs_get_parameter_int (cpl_parameterlist *parlist, const char *name, const cpl_table *defaults)
 Reading a recipe integer parameter value.
double dfs_get_parameter_double (cpl_parameterlist *parlist, const char *name, const cpl_table *defaults)
 Reading a recipe double parameter value.
const char * dfs_get_parameter_string (cpl_parameterlist *parlist, const char *name, const cpl_table *defaults)
 Reading a recipe string parameter value.
int dfs_get_parameter_bool (cpl_parameterlist *parlist, const char *name, const cpl_table *defaults)
 Reading a recipe boolean parameter value.
int dfs_get_parameter_bool_const (const cpl_parameterlist *parlist, const char *name)
int dfs_get_parameter_int_const (const cpl_parameterlist *parlist, const char *name)
double dfs_get_parameter_double_const (const cpl_parameterlist *parlist, const char *name)
const char * dfs_get_parameter_string_const (const cpl_parameterlist *parlist, const char *name)
cpl_image * dfs_load_image (cpl_frameset *frameset, const char *category, cpl_type type, int ext, int calib)
 Loading image data of given category.
cpl_table * dfs_load_table (cpl_frameset *frameset, const char *category, int ext)
 Loading table data of given category.
cpl_propertylist * dfs_load_header (cpl_frameset *frameset, const char *category, int ext)
 Loading header associated to data of given category.
int dfs_save_image (cpl_frameset *frameset, const cpl_image *image, const char *category, cpl_propertylist *header, const cpl_parameterlist *parlist, const char *recipename, const char *version)
 Saving image data of given category.
int dfs_save_table (cpl_frameset *frameset, const cpl_table *table, const char *category, cpl_propertylist *header, const cpl_parameterlist *parlist, const char *recipename, const char *version)
 Saving table data of given category.
int dfs_files_dont_exist (cpl_frameset *frameset)
 Check if all SOF files exist.
int dfs_equal_keyword (cpl_frameset *frameset, const char *keyword)
 Saving table data of given category.
cpl_error_code dfs_save_table_ext (cpl_table *table, const char *tag, cpl_propertylist *extheader)
 Save a table in a extension (different from the first one).
cpl_error_code dfs_save_image_ext (cpl_image *image, const char *tag, cpl_propertylist *extheader)
 Save an image in a extension.
cpl_error_code dfs_save_image_null (cpl_frameset *frameset, cpl_parameterlist *parlist, const char *tag, const char *recipename, const char *version)
 Save a product with an empty primary extension.

Detailed Description

The module fors_dfs collects medium level functions related to DFS data IO.

Function Documentation

int dfs_equal_keyword ( cpl_frameset *  frameset,
const char *  keyword 
)

Saving table data of given category.

Parameters:
frameset The input set-of-frames
keyword The keyword that should be identical in all frames
Returns:
1 if consistent, 0 if inconsistent
The specified FITS header keyword should be identical in all the input frames. Only the FITS primary header is examined. If keyword is missing this is considered a case of identical keywords. Only integer and string keywords are compared: in case of other types 0 is always returned. If a file is not FITS, it is ignored.

int dfs_files_dont_exist ( cpl_frameset *  frameset  ) 

Check if all SOF files exist.

Parameters:
frameset The input set-of-frames
Returns:
1 if not all files exist, 0 if they all exist.

int dfs_get_parameter_bool ( cpl_parameterlist *  parlist,
const char *  name,
const cpl_table *  defaults 
)

Reading a recipe boolean parameter value.

Parameters:
parlist The input parameter list
name The parameter name
defaults The defaults table
Returns:
The parameter value
This function is just a wrapper to the basic CPL function cpl_parameter_get_bool(), but if a defaults table is passed then the parameter value is searched in that table. If it is found, the parameter value will be modified also on the input parameter list before being returned, so that it would appear on the recipe products headers. If the parameter is not found, then the parameter value is simply read from the input parameter list. If a defaults table is not specified, then this function works exactly as the function cpl_parameter_get_bool().

int dfs_get_parameter_bool_const ( const cpl_parameterlist *  parlist,
const char *  name 
)

See also:
dfs_get_parameter_bool

double dfs_get_parameter_double ( cpl_parameterlist *  parlist,
const char *  name,
const cpl_table *  defaults 
)

Reading a recipe double parameter value.

Parameters:
parlist The input parameter list
name The parameter name
defaults The defaults table
Returns:
The parameter value
This function is just a wrapper to the basic CPL function cpl_parameter_get_double(), but if a defaults table is passed then the parameter value is searched in that table. If it is found, the parameter value will be modified also on the input parameter list before being returned, so that it would appear on the recipe products headers. If the parameter is not found, then the parameter value is simply read from the input parameter list. If a defaults table is not specified, then this function works exactly as the function cpl_parameter_get_double().

double dfs_get_parameter_double_const ( const cpl_parameterlist *  parlist,
const char *  name 
)

See also:
dfs_get_parameter_double

int dfs_get_parameter_int ( cpl_parameterlist *  parlist,
const char *  name,
const cpl_table *  defaults 
)

Reading a recipe integer parameter value.

Parameters:
parlist The input parameter list
name The parameter name
defaults The defaults table
Returns:
The parameter value
This function is just a wrapper to the basic CPL function cpl_parameter_get_int(), but if a defaults table is passed then the parameter value is searched in that table. If it is found, the parameter value will be modified also on the input parameter list before being returned, so that it would appear on the recipe products headers. If the parameter is not found, then the parameter value is simply read from the input parameter list. If a defaults table is not specified, then this function works exactly as the function cpl_parameter_get_int().

int dfs_get_parameter_int_const ( const cpl_parameterlist *  parlist,
const char *  name 
)

See also:
dfs_get_parameter_int

const char* dfs_get_parameter_string ( cpl_parameterlist *  parlist,
const char *  name,
const cpl_table *  defaults 
)

Reading a recipe string parameter value.

Parameters:
parlist The input parameter list
name The parameter name
defaults The defaults table
Returns:
The parameter value
This function is just a wrapper to the basic CPL function cpl_parameter_get_string(), but if a defaults table is passed then the parameter value is searched in that table. If it is found, the parameter value will be modified also on the input parameter list before being returned, so that it would appear on the recipe products headers. If the parameter is not found, then the parameter value is simply read from the input parameter list. If a defaults table is not specified, then this function works exactly as the function cpl_parameter_get_string().

const char* dfs_get_parameter_string_const ( const cpl_parameterlist *  parlist,
const char *  name 
)

See also:
dfs_get_parameter_string

cpl_propertylist* dfs_load_header ( cpl_frameset *  frameset,
const char *  category,
int  ext 
)

Loading header associated to data of given category.

Parameters:
frameset The input set-of-frames
category The category of the frame containing the header
ext The FITS file extension to access (first = 0)
Returns:
The loaded property list
This function is just a wrapper to the basic CPL functions cpl_frameset_find() and cpl_propertylist_load(), as they typically are called every time a header should be loaded by a recipe. Error checking and proper messaging are also included here, to give a more readable look to the main recipe code.

In case of any error, a NULL pointer is returned. The error codes that are set in this case are the same set by the above mentioned CPL functions. The "where" string (accessible via a call to cpl_error_get_where() ) is not modified by this function, and therefore the function where the failure occurred is also reported.

cpl_image* dfs_load_image ( cpl_frameset *  frameset,
const char *  category,
cpl_type  type,
int  ext,
int  calib 
)

Loading image data of given category.

Parameters:
frameset The input set-of-frames
category The category of the image to load
type The data type of the loaded image
ext The FITS file extension to access (first = 0)
calib 1 = calibration file, 0 = raw file
Returns:
The loaded image
This function is just a wrapper to the basic CPL functions cpl_frameset_find() and cpl_image_load(), as they typically are called every time an image should be loaded by a recipe. Error checking and proper messaging are also included here, to give a more readable look to the main recipe code.

In case of any error, a NULL pointer is returned. The error codes that are set in this case are the same set by the above mentioned CPL functions. The "where" string (accessible via a call to cpl_error_get_where() ) is not modified by this function, and therefore the function where the failure occurred is also reported.

cpl_table* dfs_load_table ( cpl_frameset *  frameset,
const char *  category,
int  ext 
)

Loading table data of given category.

Parameters:
frameset The input set-of-frames
category The category of the table to load
ext The FITS file extension to access (first = 0)
Returns:
The loaded table
This function is just a wrapper to the basic CPL functions cpl_frameset_find() and cpl_table_load(), as they typically are called every time a table should be loaded by a recipe. Error checking and proper messaging are also included here, to give a more readable look to the main recipe code.

In case of any error, a NULL pointer is returned. The error codes that are set in this case are the same set by the above mentioned CPL functions. The "where" string (accessible via a call to cpl_error_get_where() ) is not modified by this function, and therefore the function where the failure occurred is also reported.

int dfs_save_image ( cpl_frameset *  frameset,
const cpl_image *  image,
const char *  category,
cpl_propertylist *  header,
const cpl_parameterlist *  parlist,
const char *  recipename,
const char *  version 
)

Saving image data of given category.

Parameters:
frameset The input set-of-frames (to be upgraded)
image The image to save
category The category of the image to save
header Header to input to cpl_dfs_setup_product_header()
parlist The recipe parameter list
recipename The name of the recipe
version The version of the pipeline
Returns:
0 in case of success.
This function is just a wrapper to the basic CPL functions that are routinely called every time an image product must be saved to disk by a recipe. Error checking and proper messaging are also included here, to give a more readable look to the main recipe code.

The output file name will be derived from the specified category by lowercasing it and by appending the suffix ".fits". The new image is properly logged in the input set-of-frames in case of success.

The error codes that are set in this case are the same set by the above mentioned CPL functions. The "where" string (accessible via a call to cpl_error_get_where() ) is not modified by this function, and therefore the function where the failure occurred is also reported.

cpl_error_code dfs_save_image_ext ( cpl_image *  image,
const char *  tag,
cpl_propertylist *  extheader 
)

Save an image in a extension.

Parameters:
image Image to save
tag PRO.CATG of the image
extheader Header for the extension or NULL
Returns:
CPL_ERROR_NONE of corresponding cpl_error_code on error.

cpl_error_code dfs_save_image_null ( cpl_frameset *  frameset,
cpl_parameterlist *  parlist,
const char *  tag,
const char *  recipename,
const char *  version 
)

Save a product with an empty primary extension.

Parameters:
frameset Frameset
parlist Parlist
tag PRO.CATG of the product
recipename Name of the recipe
version Version
Returns:
CPL_ERROR_NONE of corresponding cpl_error_code on error.

int dfs_save_table ( cpl_frameset *  frameset,
const cpl_table *  table,
const char *  category,
cpl_propertylist *  header,
const cpl_parameterlist *  parlist,
const char *  recipename,
const char *  version 
)

Saving table data of given category.

Parameters:
frameset The input set-of-frames (to be upgraded)
table The table to save
category The category of the table to save
header Header to input to cpl_dfs_setup_product_header()
parlist The recipe parameter list
recipename The name of the recipe
version The version of the pipeline
Returns:
0 in case of success.
This function is just a wrapper to the basic CPL functions that are routinely called every time a table product must be saved to disk by a recipe. Error checking and proper messaging are also included here, to give a more readable look to the main recipe code.

The output file name will be derived from the specified category by lowercasing it and by appending the suffix ".fits". The new table is properly logged in the input set-of-frames in case of success.

The error codes that are set in this case are the same set by the above mentioned CPL functions. The "where" string (accessible via a call to cpl_error_get_where() ) is not modified by this function, and therefore the function where the failure occurred is also reported.

cpl_error_code dfs_save_table_ext ( cpl_table *  table,
const char *  tag,
cpl_propertylist *  extheader 
)

Save a table in a extension (different from the first one).

Parameters:
table Table to save
tag PRO.CATG of the table
extheader Header for the extension or NULL
Returns:
CPL_ERROR_NONE of corresponding cpl_error_code on error.


Generated on Mon Mar 14 15:55:43 2011 for VIMOS DRS Reference Manual by  doxygen 1.4.7