FORS Pipeline Reference Manual  5.0.9
Macros | Functions | Variables
Quality Control Utilities

Macros

#define cleanup
 

Functions

cpl_error_code fors_header_write_string (cpl_propertylist *header, const char *name, const char *value, const char *comment)
 Write a string value to the active QC1 PAF object and to a header. More...
 
cpl_error_code fors_header_write_double (cpl_propertylist *header, double value, const char *name, const char *unit, const char *comment)
 Write an integer value to the active QC1 PAF object and to a header. More...
 
cpl_error_code fors_header_write_int (cpl_propertylist *header, int value, const char *name, const char *unit, const char *comment)
 
cpl_error_code fors_qc_start_group (cpl_propertylist *header, const char *qcdic_version, const char *instrument)
 Initiate a new QC1 group. More...
 
void fors_qc_write_group_heading (const cpl_frame *raw_frame, const char *pro_catg, const char *instrument)
 Initiate a new QC1 group and log basic QC. More...
 
cpl_error_code fors_qc_end_group (void)
 Close current QC1 PAF file. More...
 
cpl_error_code fors_qc_write_string (const char *name, const char *value, const char *comment, const char *instrument)
 Add string parameter to current QC1 group. More...
 
cpl_error_code fors_qc_write_string_chat (const char *name, const char *value, const char *comment, const char *instrument)
 
cpl_error_code fors_qc_write_double (const char *name, double value, const char *unit, const char *comment, const char *instrument)
 Add double parameter to current QC1 group. More...
 
cpl_error_code fors_qc_write_int (const char *name, int value, const char *unit, const char *comment, const char *instrument)
 
cpl_error_code fors_qc_keyword_to_paf (cpl_propertylist *header, const char *name, const char *unit, const char *comment, const char *instrument)
 Copy a keyword value to the currently active QC1 PAF object. More...
 
cpl_error_code fors_qc_write_qc_string (cpl_propertylist *header, const char *name, const char *value, const char *comment, const char *instrument)
 Write a string value to the active QC1 PAF object and to a header. More...
 
cpl_error_code fors_qc_write_qc_double (cpl_propertylist *header, double value, const char *name, const char *unit, const char *comment, const char *instrument)
 Write an integer value to the active QC1 PAF object and to a header. More...
 
cpl_error_code fors_qc_write_qc_int (cpl_propertylist *header, int value, const char *name, const char *unit, const char *comment, const char *instrument)
 

Variables

const char *const fors_qc_dic_version = "2.0"
 
static ForsPAFpafFile = NULL
 
static int pafIndex = 0
 

Detailed Description

The module collects utility functions for quality control operations.

Macro Definition Documentation

#define cleanup
Value:
do { \
cpl_propertylist_delete(header); \
} while(0)

Definition at line 100 of file fors_qc.c.

Function Documentation

cpl_error_code fors_header_write_string ( cpl_propertylist *  header,
const char *  name,
const char *  value,
const char *  comment 
)

Write a string value to the active QC1 PAF object and to a header.

Returns
CPL_ERROR_NONE on success
Parameters
headerProduct header
nameQC1 PAF entry name.
valueValue to write.
unitOptional unit to be associated to value.
commentComment to be associated to value.
instrumentInstrument name

An entry with the specified name is written to the current QC1 PAF object. From the entry name, the name of the QC keyword that should be written to header is derived prepending the string "ESO " and replacing all '.' with a blank (e.g., "QC.BIAS.MASTER.MEAN" becomes "ESO QC BIAS MASTER MEAN"). Finally, the new keyword is written to the header. Note that before calling this funtion a QC1 PAF object must be created with a call to fors_qc_start_group().

Definition at line 78 of file fors_header.c.

cpl_error_code fors_header_write_double ( cpl_propertylist *  header,
double  value,
const char *  name,
const char *  unit,
const char *  comment 
)

Write an integer value to the active QC1 PAF object and to a header.

Returns
CPL_ERROR_NONE on success
Parameters
headerProduct header
valueValue to write.
nameQC1 PAF entry name.
unitOptional unit to be associated to value.
commentComment to be associated to value.
instrumentInstrument name

This function writes the header entries directly to the header of the FITS file written to disk, using the qfits_replace_card() call. An entry with the specified name is written to the current QC1 PAF object. From the entry name, the name of the QC keyword that should be written to header is derived prepending the string "ESO " and replacing all '.' with a blank (e.g., "QC.BIAS.MASTER.MEAN" becomes "ESO QC BIAS MASTER MEAN"). Finally, the new keyword is written to the header. Note that before calling this funtion a QC1 PAF object must be created with a call to fors_qc_start_group().

Definition at line 131 of file fors_header.c.

cpl_error_code fors_qc_start_group ( cpl_propertylist *  header,
const char *  qcdic_version,
const char *  instrument 
)

Initiate a new QC1 group.

Parameters
headerproduct header
qcdic_versiondictionary ID
instrumentinstrument name
Returns
CPL_ERROR_NONE on success

A new PAF object is initiated, with the name depending on the root PAF_ROOT_NAME and the current pafIndex. If the previous QC1 PAF file is found open, this is an error: fors_qc_end_group() should be called first.

Definition at line 77 of file fors_qc.c.

References fors_qc_write_qc_string(), and newForsPAF().

Referenced by test_qc().

void fors_qc_write_group_heading ( const cpl_frame *  raw_frame,
const char *  pro_catg,
const char *  instrument 
)

Initiate a new QC1 group and log basic QC.

Parameters
raw_frameinput frame
pro_catgproduct category
instrumentinstrument name

This function logs common QC parameters.

Definition at line 115 of file fors_qc.c.

References assure, fors_qc_keyword_to_paf(), and fors_qc_write_string().

cpl_error_code fors_qc_end_group ( void  )

Close current QC1 PAF file.

Returns
CPL_ERROR_NONE on success

The current QC1 PAF object is written to disk file. If no PAF object is present, this is an error: fors_qc_start_group() should be called first. If the PAF file is empty, the PAF object is destroyed, but no PAF file is created.

Definition at line 200 of file fors_qc.c.

References deleteForsPAF(), forsPAFIsEmpty(), and forsPAFWrite().

Referenced by test_qc().

cpl_error_code fors_qc_write_string ( const char *  name,
const char *  value,
const char *  comment,
const char *  instrument 
)

Add string parameter to current QC1 group.

Parameters
nameParameter name
valueParameter value
commentParameter comment
instrumentInstrument name
Returns
CPL_ERROR_NONE on success

To the current QC1 PAF object is appended a string parameter. If no PAF object is present, this is an error: fors_qc_start_group() should be called first.

Definition at line 235 of file fors_qc.c.

References forsPAFAppendString().

Referenced by fors_qc_keyword_to_paf(), fors_qc_write_group_heading(), fors_qc_write_qc_string(), and test_qc().

cpl_error_code fors_qc_write_double ( const char *  name,
double  value,
const char *  unit,
const char *  comment,
const char *  instrument 
)

Add double parameter to current QC1 group.

Parameters
nameParameter name
valueParameter value
unitParameter unit
commentParameter comment;
instrumentInstrument name
Returns
CPL_ERROR_NONE on success

To the current QC1 PAF object is appended a double parameter. The comment string is mandatory. The parameter unit must be specified, unless the specified parameter is adimensional, otherwise a null pointer should be passed. To the comment string the unit string (if present) will be appended, enclosed in round brackets, and then the string "[@em instrument]". If no PAF object is present, this is an error: fors_qc_start_group() should be called first.

Definition at line 321 of file fors_qc.c.

References forsPAFAppendDouble().

Referenced by fors_qc_keyword_to_paf(), fors_qc_write_qc_double(), and test_qc().

cpl_error_code fors_qc_keyword_to_paf ( cpl_propertylist *  header,
const char *  name,
const char *  unit,
const char *  comment,
const char *  instrument 
)

Copy a keyword value to the currently active QC1 PAF object.

Parameters
headerPointer to a keyword header.
nameKeyword name.
unitOptional unit to be associated to keyword value.
commentOptional comment to be associated to keyword value.
instrumentInstrument name
Returns
CPL_ERROR_NONE on success

A keyword with the specified name is searched in the header. Its type is determined, then its value is read with the appropriate interface. From the keyword name the corresponding PAF keyword name is derived by removing any "ESO " at keyword name beginning, and replacing blanks with dots (e.g., "ESO TPL ID" becomes "TPL.ID"). Finally, the new PAF keyword, with the same type as the header keyword, is written to the currently active QC1 PAF object. Note that before calling this funtion a QC1 PAF object must be created with a call to fors_qc_start_group().

Definition at line 425 of file fors_qc.c.

References fors_qc_write_double(), and fors_qc_write_string().

Referenced by fors_qc_write_group_heading(), and test_qc().

cpl_error_code fors_qc_write_qc_string ( cpl_propertylist *  header,
const char *  name,
const char *  value,
const char *  comment,
const char *  instrument 
)

Write a string value to the active QC1 PAF object and to a header.

Returns
CPL_ERROR_NONE on success
Parameters
headerProduct header
nameQC1 PAF entry name.
valueValue to write.
unitOptional unit to be associated to value.
commentComment to be associated to value.
instrumentInstrument name

An entry with the specified name is written to the current QC1 PAF object. From the entry name, the name of the QC keyword that should be written to header is derived prepending the string "ESO " and replacing all '.' with a blank (e.g., "QC.BIAS.MASTER.MEAN" becomes "ESO QC BIAS MASTER MEAN"). Finally, the new keyword is written to the header. Note that before calling this funtion a QC1 PAF object must be created with a call to fors_qc_start_group().

Definition at line 535 of file fors_qc.c.

References fors_qc_write_string().

Referenced by fors_qc_start_group().

cpl_error_code fors_qc_write_qc_double ( cpl_propertylist *  header,
double  value,
const char *  name,
const char *  unit,
const char *  comment,
const char *  instrument 
)

Write an integer value to the active QC1 PAF object and to a header.

Returns
CPL_ERROR_NONE on success
Parameters
headerProduct header
valueValue to write.
nameQC1 PAF entry name.
unitOptional unit to be associated to value.
commentComment to be associated to value.
instrumentInstrument name

This function writes the header entries directly to the header of the FITS file written to disk, using the qfits_replace_card() call. An entry with the specified name is written to the current QC1 PAF object. From the entry name, the name of the QC keyword that should be written to header is derived prepending the string "ESO " and replacing all '.' with a blank (e.g., "QC.BIAS.MASTER.MEAN" becomes "ESO QC BIAS MASTER MEAN"). Finally, the new keyword is written to the header. Note that before calling this funtion a QC1 PAF object must be created with a call to fors_qc_start_group().

Definition at line 604 of file fors_qc.c.

References fors_qc_write_double().