DFS related functions


Functions

cpl_error_code cpl_dfs_save_image (cpl_frameset *allframes, const cpl_parameterlist *parlist, const cpl_frameset *usedframes, const cpl_image *image, cpl_type_bpp bpp, const char *recipe, const char *procat, const cpl_propertylist *applist, const char *remregexp, const char *pipe_id, const char *filename)
 Save an image as a DFS-compliant pipeline product.
cpl_error_code cpl_dfs_save_table (cpl_frameset *allframes, const cpl_parameterlist *parlist, const cpl_frameset *usedframes, const cpl_table *table, const cpl_propertylist *tablelist, const char *recipe, const char *procat, const cpl_propertylist *applist, const char *remregexp, const char *pipe_id, const char *filename)
 Save a table as a DFS-compliant pipeline product.
cpl_error_code cpl_dfs_save_paf (const char *instrume, const char *recipe, const cpl_propertylist *paflist, const char *filename)
 Create a new PAF file.
cpl_error_code cpl_dfs_setup_product_header (cpl_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)
 Add product keywords to a pipeline product property list.
cpl_error_code cpl_dfs_update_product_header (cpl_frameset *self)
 Perform any DFS-compliancy required actions (DATAMD5/PIPEFILE update).

Function Documentation

cpl_error_code cpl_dfs_save_image ( cpl_frameset allframes,
const cpl_parameterlist parlist,
const cpl_frameset usedframes,
const cpl_image *  image,
cpl_type_bpp  bpp,
const char *  recipe,
const char *  procat,
const cpl_propertylist applist,
const char *  remregexp,
const char *  pipe_id,
const char *  filename 
)

Save an image as a DFS-compliant pipeline product.

Parameters:
allframes The list of input frames for the recipe
parlist The list of input parameters
usedframes The list of raw/calibration frames used for this product
image The image to be saved or NULL
bpp Bits per pixel
recipe The recipe name
procat The product category tag
applist Optional propertylist to append to product or NULL
remregexp Optional regexp of properties not to put in main header
pipe_id PACKAGE "/" PACKAGE_VERSION
filename Filename of created product
Note:
The image may be NULL in which case only the header information is saved

remregexp may be NULL

Returns:
CPL_ERROR_NONE or the relevant CPL error code on error
See also:
cpl_dfs_setup_product_header(), cpl_image_save().
The FITS header of the created product is created from the provided applist and the cards copied by cpl_dfs_setup_product_header(), with exception of the cards whose keys match the provided remregexp.

cpl_error_code cpl_dfs_save_paf ( const char *  instrume,
const char *  recipe,
const cpl_propertylist paflist,
const char *  filename 
)

Create a new PAF file.

Parameters:
instrume Name of instrument in capitals (NACO, VISIR, etc.)
recipe Name of recipe
paflist Propertylist to save
filename Filename of created PArameter File
Returns:
CPL_ERROR_NONE or the relevant CPL error code on error
See also:
cpl_dfs_save_image().
The example below shows how to create a PAF from some FITS cards from the file ref_file and QC parameters in a propertylist qclist. Please note that qclist can be used also in calls to cpl_dfs_save_image() and cpl_dfs_save_table(). Error handling is omitted for brevity:

   const char pafcopy[] = "^(DATE-OBS|ARCFILE|ESO TPL ID|ESO DET DIT|MJD-OBS)$";
   cpl_propertylist * paflist = cpl_propertylist_load_regexp(ref_file, 0,
                                                             pafcopy, 0);

   cpl_propertylist_append(paflist, qclist);

   cpl_dfs_save_paf("IIINSTRUMENT", "rrrecipe", paflist, "rrrecipe.paf");

   cpl_propertylist_delete(paflist);

cpl_error_code cpl_dfs_save_table ( cpl_frameset allframes,
const cpl_parameterlist parlist,
const cpl_frameset usedframes,
const cpl_table *  table,
const cpl_propertylist tablelist,
const char *  recipe,
const char *  procat,
const cpl_propertylist applist,
const char *  remregexp,
const char *  pipe_id,
const char *  filename 
)

Save a table as a DFS-compliant pipeline product.

Parameters:
allframes The list of input frames for the recipe
parlist The list of input parameters
usedframes The list of raw/calibration frames used for this product
table The table to be saved
tablelist Optional propertylist to append to table extension or NULL
recipe The recipe name
procat The product category tag
applist Optional propertylist to append to product or NULL
remregexp Optional regexp of properties not to put in main header
pipe_id PACKAGE "/" PACKAGE_VERSION
filename Filename of created product
Returns:
CPL_ERROR_NONE or the relevant CPL error code on error
See also:
cpl_dfs_save_image(), cpl_table_save().

cpl_error_code cpl_dfs_setup_product_header ( cpl_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 
)

Add product keywords to a pipeline product property list.

Parameters:
header Property list where keywords must be written
product_frame Frame describing the product
framelist List of frames including all raw input frames
parlist Recipe parameter list
recid Recipe name
pipeline_id Pipeline unique identifier
dictionary_id PRO dictionary identifier
Returns:
CPL_ERROR_NONE on success.
Errors:
CPL_ERROR_NULL_INPUT An input pointer is NULL.
CPL_ERROR_DATA_NOT_FOUND The input framelist contains no input frames or a frame in the input framelist does not specify a file. In the former case the string "set-of-frames" would be appended to the error message returned by cpl_error_get_message().
CPL_ERROR_ILLEGAL_INPUT The product frame is not tagged or not grouped as CPL_FRAME_GROUP_PRODUCT.
CPL_ERROR_FILE_NOT_FOUND A frame in the input framelist specifies a non-existing file.
CPL_ERROR_BAD_FILE_FORMAT A frame in the input framelist specifies an invalid file.

This function checks the header associated to a pipeline product, to ensure that it is DICB compliant. In particular, this function does the following:

  1. Copy to header, if they are present, the following primary FITS keywords from the first input frame in the framelist: ORIGIN, TELESCOPE, INSTRUME, OBJECT, RA, DEC, EPOCH, EQUINOX, RADECSYS, DATE-OBS, MJD-OBS, UTC, LST, PI-COI, OBSERVER. If those keywords are already present in the header property list, they are overwritten only in case they have the same type. If any of these keywords are present with an unexpected type, a warning is issued, but the keywords are copied anyway (provided that the above conditions are fulfilled), and no error is set.

  1. Copy all the HIERARCH.ESO._ keywords from the primary FITS header of the first input frame in framelist, with the exception of the HIERARCH.ESO.DPR._, and of the .PRO._ and .DRS._ keywords if the first input frame is a calibration. If those keywords are already present in header, they are overwritten.

  1. If found, remove the HIERARCH.ESO.DPR._ keywords from header.

  1. If found, remove the ARCFILE and ORIGFILE keywords from header.

  1. Add to header the following mandatory keywords from the PRO dictionary: PIPEFILE, PRO.DID, PRO.REC1.ID, PRO.REC1.DRS.ID, PRO.REC1.PIPE.ID, PRO.CATG, and PRO.TYPE. If those keywords are already present in header, they are overwritten. The keyword PRO.TYPE is always given the value "REDUCED".

  1. Check the existence of the keyword PRO.DATANCOM in header. If this keyword is missing, one is added, with the value of the total number of raw input frames.

  1. Add to header the keywords PRO.REC1.RAW1.NAME, PRO.REC1.RAW1.CATG, PRO.REC1.CAL1.NAME, PRO.REC1.CAL1.CATG, to describe the content of the input set-of-frames.

See the DICB PRO dictionary to have details on the mentioned PRO keywords.

Note:
The first input frame in framelist is the first raw frame in framelist. If there are no raw frames in input, then the first calibration frame is taken. Non-FITS files are handled as files with an empty FITS header.

cpl_error_code cpl_dfs_update_product_header ( cpl_frameset self  ) 

Perform any DFS-compliancy required actions (DATAMD5/PIPEFILE update).

Parameters:
self The list of frames used by the recipe
Returns:
CPL_ERROR_NONE or the relevant CPL error code on error
Errors:
CPL_ERROR_NULL_INPUT An input pointer is NULL.
CPL_ERROR_DATA_NOT_FOUND The input framelist contains a frame of type product with a missing filename.
CPL_ERROR_BAD_FILE_FORMAT The input framelist contains a frame of type product without a FITS card with key 'DATAMD5'.
CPL_ERROR_FILE_IO The input framelist contains a frame of type product for which the FITS card with key 'DATAMD5' could not be updated.


Generated on Thu Nov 8 15:27:58 2007 for Common Pipeline Library Reference Manual by  doxygen 1.5.1