File: irplib_pfits.h

package info (click to toggle)
cpl-plugin-naco 4.4.1%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 7,512 kB
  • sloc: ansic: 45,092; sh: 12,405; makefile: 550; python: 296
file content (129 lines) | stat: -rw-r--r-- 5,327 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
/* $Id: irplib_pfits.h,v 1.12 2008-04-11 22:46:00 llundin Exp $
 *
 * This file is part of the irplib package 
 * Copyright (C) 2002,2003 European Southern Observatory
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02111-1307  USA
 */

/*
 * $Author: llundin $
 * $Date: 2008-04-11 22:46:00 $
 * $Revision: 1.12 $
 * $Name: not supported by cvs2svn $
 */

#ifndef IRPLIB_PFITS_H
#define IRPLIB_PFITS_H

/*-----------------------------------------------------------------------------
                                   Includes
 -----------------------------------------------------------------------------*/

#include <cpl.h>

#include "irplib_utils.h"
#include "irplib_framelist.h"

/*-----------------------------------------------------------------------------
                                   Define
 -----------------------------------------------------------------------------*/

/* Maximum size of FITS string value */
#define IRPLIB_FITS_STRLEN 68

#define irplib_pfits_get_bool(LIST, KEY) \
  irplib_pfits_get_bool_macro(LIST, KEY, cpl_func, __FILE__, __LINE__)

#define irplib_pfits_get_double(LIST, KEY) \
  irplib_pfits_get_double_macro(LIST, KEY, cpl_func, __FILE__, __LINE__)

#define irplib_pfits_get_int(LIST, KEY) \
  irplib_pfits_get_int_macro(LIST, KEY, cpl_func, __FILE__, __LINE__)

#define irplib_pfits_get_string(LIST, KEY) \
  irplib_pfits_get_string_macro(LIST, KEY, cpl_func, __FILE__, __LINE__)

#define IRPLIB_PFITS_STRING_DPR_CATG          "ESO DPR CATG"
#define IRPLIB_PFITS_STRING_DPR_TECH          "ESO DPR TECH"
#define IRPLIB_PFITS_STRING_DPR_TYPE          "ESO DPR TYPE"

#define IRPLIB_PFITS_REGEXP_DPR      \
    IRPLIB_PFITS_STRING_DPR_CATG "|" \
    IRPLIB_PFITS_STRING_DPR_TECH "|" \
    IRPLIB_PFITS_STRING_DPR_TYPE

#define IRPLIB_PFITS_WCS_REGEXP "WCSAXES|WCSNAME|(PC|CD|PV|PS)[0-9]+_[0-9]+|" \
                                "C(RVAL|RPIX|DELT|TYPE|UNIT|RDER|SYER)[0-9]+"

#define IRPLIB_PFITS_REGEXP_PAF "DATE-OBS|MJD-OBS|ARCFILE|ESO TPL ID"

/* DATE + EXTEND are already done, WCS needs handling elsewhere */
#define IRPLIB_PFITS_REGEXP_RECAL_LAMP "EXPTIME"
/* DATE + EXTEND are already done, WCS needs handling elsewhere */
#define IRPLIB_PFITS_REGEXP_RECAL IRPLIB_PFITS_REGEXP_RECAL_LAMP "|AIRMASS"

/*-----------------------------------------------------------------------------
                                   Defines
 -----------------------------------------------------------------------------*/

#define IRPLIB_DFS_DOCATG_FROM_DPR(DOCATG, MATCH_CATG,                         \
                                           MATCH_TYPE,                         \
                                           MATCH_TECH)                         \
    if ((docatg == NULL) && ((irplib_dfs_find_words MATCH_CATG) == 0)          \
                         && ((irplib_dfs_find_words MATCH_TYPE) == 0)          \
                         && ((irplib_dfs_find_words MATCH_TECH) == 0))         \
        docatg = (DOCATG);

/*-----------------------------------------------------------------------------
                            Function prototypes
  -----------------------------------------------------------------------------*/

const char * irplib_pfits_get_dpr_catg(const cpl_propertylist *);
const char * irplib_pfits_get_dpr_tech(const cpl_propertylist *);
const char * irplib_pfits_get_dpr_type(const cpl_propertylist *);

cpl_boolean irplib_pfits_get_bool_macro(const cpl_propertylist * ,
					const char *, const char *,
					const char *, unsigned);

double irplib_pfits_get_double_macro(const cpl_propertylist *,
                                     const char *, const char *,
                                     const char *, unsigned);

int irplib_pfits_get_int_macro(const cpl_propertylist * ,
                               const char *, const char *,
                               const char *, unsigned);

const char * irplib_pfits_get_string_macro(const cpl_propertylist * ,
                                           const char *, const char *,
                                           const char *, unsigned);

/* Other functions */

cpl_error_code irplib_pfits_set_airmass(cpl_propertylist *,
                                        const irplib_framelist *);

int irplib_dfs_find_words(const char *, const char *, ...)
#ifdef __GNUC__
    __attribute__((format (printf, 2, 3)))
#endif
;

cpl_error_code irplib_dfs_check_framelist_tag(const irplib_framelist *,
                                              const char * (*)(const char*,
                                                               const char*,
                                                               const char*));
#endif