VISIR Pipeline Reference Manual  4.1.7
irplib_pfits.h
1 /* $Id: irplib_pfits.h,v 1.11 2006-11-15 08:27:10 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: 2006-11-15 08:27:10 $
24  * $Revision: 1.11 $
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_double(LIST, KEY) \
48  irplib_pfits_get_double_macro(LIST, KEY, cpl_func, __FILE__, __LINE__)
49 
50 #define irplib_pfits_get_int(LIST, KEY) \
51  irplib_pfits_get_int_macro(LIST, KEY, cpl_func, __FILE__, __LINE__)
52 
53 #define irplib_pfits_get_string(LIST, KEY) \
54  irplib_pfits_get_string_macro(LIST, KEY, cpl_func, __FILE__, __LINE__)
55 
56 #define IRPLIB_PFITS_STRING_DPR_CATG "ESO DPR CATG"
57 #define IRPLIB_PFITS_STRING_DPR_TECH "ESO DPR TECH"
58 #define IRPLIB_PFITS_STRING_DPR_TYPE "ESO DPR TYPE"
59 
60 #define IRPLIB_PFITS_REGEXP_DPR \
61  IRPLIB_PFITS_STRING_DPR_CATG "|" \
62  IRPLIB_PFITS_STRING_DPR_TECH "|" \
63  IRPLIB_PFITS_STRING_DPR_TYPE
64 
65 #define IRPLIB_PFITS_WCS_REGEXP "WCSAXES|WCSNAME|(PC|CD|PV|PS)[0-9]+_[0-9]+|" \
66  "C(RVAL|RPIX|DELT|TYPE|UNIT|RDER|SYER)[0-9]+"
67 
68 #define IRPLIB_PFITS_REGEXP_PAF "DATE-OBS|MJD-OBS|ARCFILE|ESO TPL ID"
69 
70 /* DATE + EXTEND are already done, WCS needs handling elsewhere */
71 #define IRPLIB_PFITS_REGEXP_RECAL "EXPTIME|AIRMASS"
72 
73 /*-----------------------------------------------------------------------------
74  Defines
75  -----------------------------------------------------------------------------*/
76 
77 #define IRPLIB_DFS_DOCATG_FROM_DPR(DOCATG, MATCH_CATG, \
78  MATCH_TYPE, \
79  MATCH_TECH) \
80  if ((docatg == NULL) && ((irplib_dfs_find_words MATCH_CATG) == 0) \
81  && ((irplib_dfs_find_words MATCH_TYPE) == 0) \
82  && ((irplib_dfs_find_words MATCH_TECH) == 0)) \
83  docatg = (DOCATG);
84 
85 /*-----------------------------------------------------------------------------
86  Function prototypes
87  -----------------------------------------------------------------------------*/
88 
89 const char * irplib_pfits_get_dpr_catg(const cpl_propertylist *);
90 const char * irplib_pfits_get_dpr_tech(const cpl_propertylist *);
91 const char * irplib_pfits_get_dpr_type(const cpl_propertylist *);
92 
93 double irplib_pfits_get_double_macro(const cpl_propertylist *,
94  const char *, const char *,
95  const char *, unsigned);
96 
97 int irplib_pfits_get_int_macro(const cpl_propertylist * ,
98  const char *, const char *,
99  const char *, unsigned);
100 
101 const char * irplib_pfits_get_string_macro(const cpl_propertylist * ,
102  const char *, const char *,
103  const char *, unsigned);
104 
105 /* Other functions */
106 
107 cpl_error_code irplib_pfits_set_airmass(cpl_propertylist *,
108  const irplib_framelist *);
109 
110 int irplib_dfs_find_words(const char *, const char *, ...)
111 #ifdef __GNUC__
112  __attribute__((format (printf, 2, 3)))
113 #endif
114 ;
115 
116 cpl_error_code irplib_dfs_check_framelist_tag(const irplib_framelist *,
117  const char * (*)(const char*,
118  const char*,
119  const char*));
120 #endif
const char * irplib_pfits_get_dpr_catg(const cpl_propertylist *)
The data category.
Definition: irplib_pfits.c:79
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:191
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:338
const char * irplib_pfits_get_dpr_tech(const cpl_propertylist *)
The data technique.
Definition: irplib_pfits.c:91
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:120
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:157
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:225
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:267