IIINSTRUMENT Pipeline Reference Manual 4.4.13
irplib_pfits.h
1/* $Id: irplib_pfits.h,v 1.12 2008-04-11 22:46:00 llundin Exp $
2 *
3 * This file is part of the irplib package
4 * Copyright (C) 2002,2003 European Southern Observatory
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02111-1307 USA
19 */
20
21/*
22 * $Author: llundin $
23 * $Date: 2008-04-11 22:46:00 $
24 * $Revision: 1.12 $
25 * $Name: not supported by cvs2svn $
26 */
27
28#ifndef IRPLIB_PFITS_H
29#define IRPLIB_PFITS_H
30
31/*-----------------------------------------------------------------------------
32 Includes
33 -----------------------------------------------------------------------------*/
34
35#include <cpl.h>
36
37#include "irplib_utils.h"
38#include "irplib_framelist.h"
39
40/*-----------------------------------------------------------------------------
41 Define
42 -----------------------------------------------------------------------------*/
43
44/* Maximum size of FITS string value */
45#define IRPLIB_FITS_STRLEN 68
46
47#define irplib_pfits_get_bool(LIST, KEY) \
48 irplib_pfits_get_bool_macro(LIST, KEY, cpl_func, __FILE__, __LINE__)
49
50#define irplib_pfits_get_double(LIST, KEY) \
51 irplib_pfits_get_double_macro(LIST, KEY, cpl_func, __FILE__, __LINE__)
52
53#define irplib_pfits_get_int(LIST, KEY) \
54 irplib_pfits_get_int_macro(LIST, KEY, cpl_func, __FILE__, __LINE__)
55
56#define irplib_pfits_get_string(LIST, KEY) \
57 irplib_pfits_get_string_macro(LIST, KEY, cpl_func, __FILE__, __LINE__)
58
59#define IRPLIB_PFITS_STRING_DPR_CATG "ESO DPR CATG"
60#define IRPLIB_PFITS_STRING_DPR_TECH "ESO DPR TECH"
61#define IRPLIB_PFITS_STRING_DPR_TYPE "ESO DPR TYPE"
62
63#define IRPLIB_PFITS_REGEXP_DPR \
64 IRPLIB_PFITS_STRING_DPR_CATG "|" \
65 IRPLIB_PFITS_STRING_DPR_TECH "|" \
66 IRPLIB_PFITS_STRING_DPR_TYPE
67
68#define IRPLIB_PFITS_WCS_REGEXP "WCSAXES|WCSNAME|(PC|CD|PV|PS)[0-9]+_[0-9]+|" \
69 "C(RVAL|RPIX|DELT|TYPE|UNIT|RDER|SYER)[0-9]+"
70
71#define IRPLIB_PFITS_REGEXP_PAF "DATE-OBS|MJD-OBS|ARCFILE|ESO TPL ID"
72
73/* DATE + EXTEND are already done, WCS needs handling elsewhere */
74#define IRPLIB_PFITS_REGEXP_RECAL_LAMP "EXPTIME"
75/* DATE + EXTEND are already done, WCS needs handling elsewhere */
76#define IRPLIB_PFITS_REGEXP_RECAL IRPLIB_PFITS_REGEXP_RECAL_LAMP "|AIRMASS"
77
78/*-----------------------------------------------------------------------------
79 Defines
80 -----------------------------------------------------------------------------*/
81
82#define IRPLIB_DFS_DOCATG_FROM_DPR(DOCATG, MATCH_CATG, \
83 MATCH_TYPE, \
84 MATCH_TECH) \
85 if ((docatg == NULL) && ((irplib_dfs_find_words MATCH_CATG) == 0) \
86 && ((irplib_dfs_find_words MATCH_TYPE) == 0) \
87 && ((irplib_dfs_find_words MATCH_TECH) == 0)) \
88 docatg = (DOCATG);
89
90/*-----------------------------------------------------------------------------
91 Function prototypes
92 -----------------------------------------------------------------------------*/
93
94const char * irplib_pfits_get_dpr_catg(const cpl_propertylist *);
95const char * irplib_pfits_get_dpr_tech(const cpl_propertylist *);
96const char * irplib_pfits_get_dpr_type(const cpl_propertylist *);
97
98cpl_boolean irplib_pfits_get_bool_macro(const cpl_propertylist * ,
99 const char *, const char *,
100 const char *, unsigned);
101
102double irplib_pfits_get_double_macro(const cpl_propertylist *,
103 const char *, const char *,
104 const char *, unsigned);
105
106int irplib_pfits_get_int_macro(const cpl_propertylist * ,
107 const char *, const char *,
108 const char *, unsigned);
109
110const char * irplib_pfits_get_string_macro(const cpl_propertylist * ,
111 const char *, const char *,
112 const char *, unsigned);
113
114/* Other functions */
115
116cpl_error_code irplib_pfits_set_airmass(cpl_propertylist *,
117 const irplib_framelist *);
118
119int irplib_dfs_find_words(const char *, const char *, ...)
120#ifdef __GNUC__
121 __attribute__((format (printf, 2, 3)))
122#endif
123;
124
125cpl_error_code irplib_dfs_check_framelist_tag(const irplib_framelist *,
126 const char * (*)(const char*,
127 const char*,
128 const char*));
129#endif
double irplib_pfits_get_double_macro(const cpl_propertylist *, const char *, const char *, const char *, unsigned)
Get the value of a property of type double.
Definition: irplib_pfits.c:155
int irplib_pfits_get_int_macro(const cpl_propertylist *, const char *, const char *, const char *, unsigned)
Get the value of a property of type int.
Definition: irplib_pfits.c:192
cpl_error_code irplib_dfs_check_framelist_tag(const irplib_framelist *self, const char *(*pfind)(const char *, const char *, const char *))
Check the tags in a frameset (group raw only)
Definition: irplib_pfits.c:260
const char * irplib_pfits_get_dpr_catg(const cpl_propertylist *)
The data category.
Definition: irplib_pfits.c:79
cpl_boolean irplib_pfits_get_bool_macro(const cpl_propertylist *, const char *, const char *, const char *, unsigned)
Get the value of a property of type boolean.
Definition: irplib_pfits.c:121
const char * irplib_pfits_get_dpr_type(const cpl_propertylist *)
The data type.
Definition: irplib_pfits.c:103
cpl_error_code irplib_pfits_set_airmass(cpl_propertylist *, const irplib_framelist *)
Update/Set the AIRMASS property.
Definition: irplib_pfits.c:373
const char * irplib_pfits_get_dpr_tech(const cpl_propertylist *)
The data technique.
Definition: irplib_pfits.c:91
const char * irplib_pfits_get_string_macro(const cpl_propertylist *, const char *, const char *, const char *, unsigned)
Get the value of a property of type string.
Definition: irplib_pfits.c:226
int irplib_dfs_find_words(const char *, const char *,...)
Match a string with word(s) against a list of 1-word-regexps.
Definition: irplib_pfits.c:302