Functions | |
static FILE * | irplib_paf_init (const xsh_instrument *instrument, const char *recipe, const char *filename, const cpl_propertylist *primary_header) |
Open a new PAF file, output a default header. | |
static cpl_error_code | irplib_paf_dump (qc_description *pqc, const char *kwname, const cpl_propertylist *paflist, FILE *paf) |
Print a propertylist as PAF. | |
static cpl_error_code | irplib_paf_dump_int (char *key, int value, const char *comment, FILE *paf) |
Print an int-property as PAF. | |
static cpl_error_code | irplib_paf_dump_double (char *key, double value, const char *comment, FILE *paf) |
Print a double-property as PAF. | |
static cpl_error_code | irplib_paf_dump_string (char *key, const char *value, const char *comment, FILE *paf) |
Print a string-property as PAF. | |
cpl_error_code | xsh_paf_save (const xsh_instrument *instrument, const char *recipe, const cpl_propertylist *paflist, const char *filename, const char *pro_catg) |
Create a new PAF file. | |
static void | no_space (char *str) |
static cpl_error_code irplib_paf_dump | ( | qc_description * | pqc, | |
const char * | kwname, | |||
const cpl_propertylist * | paflist, | |||
FILE * | paf | |||
) | [static] |
Print a propertylist as PAF.
pqc | Pointer to the description of the QC parameter | |
kwname | Keyword name | |
paflist | Propertylist from which the values are extracted | |
paf | PAF stream |
The property names are printed with these modifications: Any space-character is replaced by a . (dot).
Thus a property name QC PART1 PART2 PART3 will cause the printing of a line with QC.PART1.PART2.PART3 as key.
Supported property-types: CPL_TYPE_CHAR (cast to int) CPL_TYPE_INT CPL_TYPE_LONG (only if sizeof(long) == sizeof(int), cast to int) CPL_TYPE_FLOAT (cast to double) CPL_TYPE_DOUBLE CPL_TYPE_STRING
Possible _cpl_error_code_ set in this function:
Definition at line 395 of file xsh_paf_save.c.
References irplib_paf_dump_double(), irplib_paf_dump_int(), irplib_paf_dump_string(), qc_description::kw_help, no_space(), and xsh_msg_dbg_low.
Referenced by xsh_paf_save().
static cpl_error_code irplib_paf_dump_double | ( | char * | key, | |
double | value, | |||
const char * | comment, | |||
FILE * | paf | |||
) | [static] |
Print a double-property as PAF.
key | Property key | |
value | Property value | |
comment | Optional property comment | |
paf | PAF stream |
Definition at line 490 of file xsh_paf_save.c.
References PAF_KEY_FORMAT, and PAF_KEY_LEN.
Referenced by irplib_paf_dump().
static cpl_error_code irplib_paf_dump_int | ( | char * | key, | |
int | value, | |||
const char * | comment, | |||
FILE * | paf | |||
) | [static] |
Print an int-property as PAF.
key | Property key | |
value | Property value | |
comment | Optional property comment | |
paf | PAF stream |
Definition at line 462 of file xsh_paf_save.c.
References PAF_KEY_FORMAT, and PAF_KEY_LEN.
Referenced by irplib_paf_dump().
static cpl_error_code irplib_paf_dump_string | ( | char * | key, | |
const char * | value, | |||
const char * | comment, | |||
FILE * | paf | |||
) | [static] |
Print a string-property as PAF.
key | Property key | |
value | Property value | |
comment | Optional property comment | |
paf | PAF stream |
Possible _cpl_error_code_ set in this function:
Definition at line 520 of file xsh_paf_save.c.
References PAF_KEY_FORMAT, and PAF_KEY_LEN.
Referenced by irplib_paf_dump().
static FILE * irplib_paf_init | ( | const xsh_instrument * | instrument, | |
const char * | recipe, | |||
const char * | filename, | |||
const cpl_propertylist * | primary_header | |||
) | [static] |
Open a new PAF file, output a default header.
instrument | Name of instrument in capitals (NACO, VISIR, etc.) | |
recipe | Name of recipe | |
filename | Filename of created product | |
primary_header | primary header |
This function creates a new PAF file with the requested file name. If another file already exists with the same name, it will be overwritten (if the file access rights allow it).
This function returns an opened file pointer, ready to receive more data through fprintf()'s. The caller is responsible for fclose()ing the file.
Possible _cpl_error_code_ set in this function:
Definition at line 226 of file xsh_paf_save.c.
References PAF_KEY_LEN, and xsh_stringcat_any().
Referenced by xsh_paf_save().
static void no_space | ( | char * | str | ) | [static] |
Definition at line 360 of file xsh_paf_save.c.
Referenced by irplib_paf_dump().
cpl_error_code xsh_paf_save | ( | const xsh_instrument * | instrument, | |
const char * | recipe, | |||
const cpl_propertylist * | paflist, | |||
const char * | filename, | |||
const char * | pro_catg | |||
) |
Create a new PAF file.
instrument | Name of instrument in capitals (NACO, VISIR, etc.) | |
recipe | Name of recipe | |
paflist | Propertylist to save | |
filename | Filename of created PArameter File | |
pro_catg | The PRO.CATG of the product file |
Create a PAF from some FITS cards from the file ref_file and QC parameters in a propertylist qclist. All QC parameters relevant to the product are checked. A message is issued for each missing QC parameter.
Definition at line 104 of file xsh_paf_save.c.
References irplib_paf_dump(), irplib_paf_init(), qc_description::kw_name, XSH_ASSURE_NOT_NULL, xsh_get_qc_desc_by_recipe(), xsh_instrument_arm_tostring(), xsh_is_qc_for_arm(), xsh_is_qc_for_pro_catg(), xsh_msg, xsh_msg_dbg_low, and xsh_msg_debug.
Referenced by main().