GIRAFFE Pipeline Reference Manual

giutils.h
1 /*
2  * This file is part of the GIRAFFE Pipeline
3  * Copyright (C) 2002-2019 European Southern Observatory
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18  */
19 
20 #ifndef GIUTILS_H
21 #define GIUTILS_H
22 
23 #include <cxtypes.h>
24 
25 #include <cpl_macros.h>
26 #include <cpl_image.h>
27 #include <cpl_propertylist.h>
28 #include <cpl_parameterlist.h>
29 #include <cpl_frameset.h>
30 
31 
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
35 
36  enum GiInstrumentMode {
37  GIMODE_NONE = 0,
38  GIMODE_MEDUSA = 1,
39  GIMODE_IFU = 2,
40  GIMODE_ARGUS = 3
41  };
42 
43  typedef enum GiInstrumentMode GiInstrumentMode;
44 
45 
46  enum GiBadPixelFlags {
47  /* Good pixel */
48  GI_BPIX_OK = 0x00000,
49 
50  /* CCD bad pixel */
51  GI_BPIX_CCD = 0x00001,
52 
53  /* CCD hot pixel */
54  GI_BPIX_HOT = 0x00003,
55 
56  /* CCD dark pixel */
57  GI_BPIX_COLD = 0x00005,
58 
59  /* Pixel rejected by dark processing */
60  GI_RPIX_DARK = 0x00100,
61 
62  /* Pixel rejected by bias processing */
63  GI_RPIX_BIAS = 0x00200,
64 
65  /* Pixel rejected by multiple CR detection */
66  GI_RPIX_CRHM = 0x00400,
67 
68  /* Pixel rejected by single CR detection */
69  GI_RPIX_CRHS = 0x00800,
70 
71  /* Pixel rejected by estimation */
72  GI_RPIX_ESTM = 0x01000,
73 
74  /* Pixel rejected by optimal extraction */
75  GI_RPIX_EXTO = 0x02000,
76 
77  /* 2D growing in both directions */
78  GI_APIX_ESTM = 0x10000
79  };
80 
81  typedef enum GiBadPixelFlags GiBadPixelFlags;
82 
83 
84  enum GiBadPixelMasks {
85  /* CCD bad pixels */
86  GI_M_PIX_BAD = 0x000ff,
87 
88  /* Pixels rejected by processing */
89  GI_M_PIX_REJECT = 0x0ff00,
90 
91  /* Any bad pixel */
92  GI_M_PIX_SET = 0x0ffff
93  };
94 
95  typedef enum GiBadPixelMasks GiBadPixelMasks;
96 
97 
98  struct GiRecipeInfo {
99  cxchar* recipe;
100  cxint sequence;
101  cxchar* start;
102  cpl_parameterlist *options;
103  };
104 
105  typedef struct GiRecipeInfo GiRecipeInfo;
106 
107 
108  struct GiGroupInfo {
109  const cxchar* tag;
110  cpl_frame_group group;
111  };
112 
113  typedef struct GiGroupInfo GiGroupInfo;
114 
115 
116  /*
117  * Static information retrieval
118  */
119 
120  const cxchar* giraffe_get_license(void);
121 
122 
123  /*
124  * Miscellaneous
125  */
126 
127  GiInstrumentMode giraffe_get_mode(cpl_propertylist* properties);
128 
129  cxchar* giraffe_path_get_basename(const cxchar* path);
130 
131  cxchar* giraffe_localtime_iso8601(void);
132 
133  cxint giraffe_add_recipe_info(cpl_propertylist* plist,
134  const GiRecipeInfo* info);
135  cxint giraffe_add_frameset_info(cpl_propertylist* plist,
136  const cpl_frameset* set,
137  cxint sequence);
138 
139  cxint giraffe_propertylist_update(cpl_propertylist* self,
140  cpl_propertylist* properties,
141  const cxchar* hint);
142  cxint giraffe_propertylist_copy(cpl_propertylist* self,
143  const cxchar* name,
144  const cpl_propertylist* other,
145  const cxchar* othername);
146 
147  cxint giraffe_frameset_set_groups(cpl_frameset* set, GiGroupInfo* groups);
148 
149  cxint giraffe_propertylist_update_wcs(cpl_propertylist* properties,
150  cxsize naxis,
151  const cxdouble* crpix,
152  const cxdouble* crval,
153  const cxchar** ctype,
154  const cxchar** cunit,
155  const cpl_matrix* cd);
156 
157  cxdouble giraffe_propertylist_get_conad(const cpl_propertylist* properties);
158 
159  cxdouble giraffe_propertylist_get_ron(const cpl_propertylist* properties);
160 
161 #ifdef __cplusplus
162 }
163 #endif
164 
165 #endif /* GIUTILS_H */
cxint giraffe_add_recipe_info(cpl_propertylist *plist, const GiRecipeInfo *info)
Add recipe specific information to a property list.
Definition: giutils.c:623
cxint giraffe_add_frameset_info(cpl_propertylist *plist, const cpl_frameset *set, cxint sequence)
Add frameset specific information to a property list.
Definition: giutils.c:782
cxchar * giraffe_path_get_basename(const cxchar *path)
Gets the name of a file without any leading directory components.
Definition: giutils.c:518
cxchar * giraffe_localtime_iso8601(void)
Get the current date and time in ISO 8601 format.
Definition: giutils.c:580
cxint giraffe_propertylist_copy(cpl_propertylist *self, const cxchar *name, const cpl_propertylist *other, const cxchar *othername)
Copy a property from one list to another.
Definition: giutils.c:1104
cxdouble giraffe_propertylist_get_conad(const cpl_propertylist *properties)
Retrieve the ADU to electrons conversion factor from the given properties.
Definition: giutils.c:1469
cxint giraffe_propertylist_update(cpl_propertylist *self, cpl_propertylist *properties, const cxchar *hint)
Update a property list.
Definition: giutils.c:1013
const cxchar * giraffe_get_license(void)
Get the pipeline copyright and license.
Definition: giutils.c:418
cxdouble giraffe_propertylist_get_ron(const cpl_propertylist *properties)
Retrieve the read-out noise from the given properties.
Definition: giutils.c:1553
GiInstrumentMode giraffe_get_mode(cpl_propertylist *properties)
Determines the instrument mode from a property list.
Definition: giutils.c:440

This file is part of the GIRAFFE Pipeline Reference Manual 2.16.10.
Documentation copyright © 2002-2006 European Southern Observatory.
Generated on Thu Dec 15 2022 21:18:51 by doxygen 1.9.1 written by Dimitri van Heesch, © 1997-2004