ERIS Pipeline Reference Manual 1.9.2
eris_ifu_jitter_interface.h
1/* $Id$
2 *
3 * This file is part of the ERIS Pipeline
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 02110-1301 USA
19 */
20
21#ifndef ERISP_ERIS_ERIS_IFU_JITTER_INTERFACE_H_
22#define ERISP_ERIS_ERIS_IFU_JITTER_INTERFACE_H_
23
24#ifdef HAVE_CONFIG_H
25#include <config.h>
26#endif
27
28/*-----------------------------------------------------------------------------
29 Includes
30 -----------------------------------------------------------------------------*/
31
32#include <time.h>
33#include <math.h>
34
35#include <cpl.h>
36#include <hdrl.h>
37#include "eris_ifu_functions.h"
38#include "eris_ifu_extract_spec_static.h"
39
40/*-----------------------------------------------------------------------------
41 Define
42 -----------------------------------------------------------------------------*/
43typedef enum {M_UNSET, M_SCIENCE, M_STDSTAR, M_PUPIL, M_TELLURIC} jitterModes;
44
45typedef enum {NONE=0, DAVIES=1, AUSTRIAN=2} skyTweakModes;
46
47typedef enum {LINEAR=1, SPLINE=2} stretchResamplingModes;
48
49typedef enum {UNSET, DISTANCES, EDGES, GRID } slitletDetectionModes;
50
51struct paramStruct {
52 skyTweakModes skyTweak;
53 bool skip_sky_oh_align;
54 bool skip_oh_align;
55 bool discard_subband;
56 bool stretch_sky;
57 int stretch_degree;
58 stretchResamplingModes stretch_resampling;
59 bool tbsub;
60 double velocityOffset;
61 double bpmThreshold;
62 slitletDetectionModes slitletDetectionMode; // SINFONI resampling
63 double firstCol; // SINFONI resampling
64 int fineTuneMode; // SINFONI resampling
65 bool combine;
66 bool darCorrection;
67 int darShiftMethod;
68 double darShiftWidth;
69 int darShiftLength;
70 bool resampleExposureMap;
71 bool extractSource;
72 double derot_corr;
73 int bpc_iter;
74};
75
76/*
77struct objectSkyPairStruct {
78 hdrl_image *object;
79 hdrl_image *sky;
80 cpl_image *resampledImg;
81 cpl_propertylist *objHdr;
82 cpl_propertylist *skyHdr;
83 cpl_propertylist *outHdr;
84};
85*/
86struct objSkyStruct {
87 int obj;
88 int sky;
89};
90
91struct exposureEntry {
92 cpl_frame *frame;
93 cpl_propertylist *hdr;
94 bool isObject;
95 double dit;
96 double obsDate;
97 double centeredObsDate;
98 int skyIndex;
99 double alt;
100 double rot;
101 double derot_corr;
102 hdrl_image *rawImage;
103 cpl_image *dqiImage;
104 hdrl_imagelist *cube;
105 cpl_imagelist *cubeBpm;
106 cpl_propertylist *cubeHdr;
107 cpl_mask *badPixelMask; //refers to rawImage BPM
108 hdrl_image *darkSubtrImage; //dark subtracted,
109 // flat fielded, distortion corrected image
110 hdrl_image *skySubtrImage; //sky subtracted,
111 // flat fielded, distortion corrected image
112};
113
114typedef enum {NODATA, SCIENCE, PSF, STD, STD_FLUX, MODE_PUPIL, IGNORE_SOF_MODE
115} sofModes;
116
117struct sofStruct {
118 sofModes mode;
119 ifsBand band;
120 ifsPreopticsScale scale;
121 ifsInstrument instrument;
122 int exposureTableCnt; // number of detected exposures
123 int exposureTableSize; // allocated dimension table
124 int objectCnt; // number of objects
125 struct exposureEntry *exposureTable;
126// struct objSkyStruct **objSkyPairs;
127 hdrl_image *masterDark;
128 hdrl_image *masterFlat;
129 cpl_image *waveMap;
130 cpl_mask *badPixelMask; //ORed BPM of all calibration files
131 cpl_image *dqi;
132 cpl_polynomial **distortion;
133 cpl_vector *oh_ref_peaks;
134 cpl_frame *oh_ref_frame;
135 cpl_table *borders;
136 cpl_polynomial *poly_u;
137 cpl_polynomial *poly_v;
138 cpl_vector *distances;
139 cpl_bivector *positions;
140};
141/*-----------------------------------------------------------------------------
142 Functions prototypes
143 -----------------------------------------------------------------------------*/
144
145/*----------------------------------------------------------------------------*/
146
148 const char *recipeName,
149 jitterModes jitterMode,
150 cpl_parameterlist *pl);
151
153 const char *recipeName,
154 jitterModes jitterMode,
155 cpl_parameterlist *pl);
156
157cpl_error_code eris_ifu_jitter_fetch_params(
158 const char* context,
159 const char* recipe_name,
160 const cpl_parameterlist * parlist,
161 struct stdParamStruct *stdParams,
162 struct paramStruct *params);
163
164
165cpl_error_code eris_ifu_jitter_processSof(
166 cpl_frameset* frames,
167 struct stdParamStruct stdParams,
168 struct paramStruct params,
169 struct sofStruct *sof);
170
172 cpl_frameset *frames,
173 ifsInstrument *instrument,
174 ifsBand *band,
175 ifsPreopticsScale *scale);
176
178 cpl_frameset *frames,
179 struct stdParamStruct params,
180 struct sofStruct *sof);
181
182cpl_error_code eris_ifu_jitter_get_objsky_pairs(
183 struct sofStruct *sof);
184
185void eris_free_exposureEntry(struct exposureEntry* ee);
186
187cpl_error_code eris_ifu_jitter_fill_extract_parameterlist(char* context,
188 jitterModes jitterMode,
189 cpl_parameterlist *pl);
190
191#endif
192
193
cpl_error_code eris_ifu_jitter_processSof(cpl_frameset *frames, struct stdParamStruct stdParams, struct paramStruct params, struct sofStruct *sof)
Process SOF (Set of Frames) file and load all calibration data.
cpl_error_code eris_ifu_stdstar_fill_common_parameterlist(const char *recipeName, jitterModes jitterMode, cpl_parameterlist *pl)
Fill parameter list with standard star-specific parameters.
cpl_error_code eris_ifu_jitter_get_objsky_exposures(cpl_frameset *frames, struct stdParamStruct params, struct sofStruct *sof)
Load all object and sky exposures from frameset.
cpl_error_code eris_ifu_jitter_fetch_params(const char *context, const char *recipe_name, const cpl_parameterlist *parlist, struct stdParamStruct *stdParams, struct paramStruct *params)
Fetch and parse jitter recipe parameters from parameter list.
cpl_error_code eris_ifu_jitter_fill_extract_parameterlist(char *context, jitterModes jitterMode, cpl_parameterlist *pl)
Fill parameter list with source extraction parameters.
cpl_error_code eris_ifu_jitter_get_instrument_settings(cpl_frameset *frames, ifsInstrument *instrument, ifsBand *band, ifsPreopticsScale *scale)
Extract instrument configuration from frameset.
cpl_error_code eris_ifu_jitter_fill_common_parameterlist(const char *recipeName, jitterModes jitterMode, cpl_parameterlist *pl)
Fill parameter list with common jitter recipe parameters.