ERIS Pipeline Reference Manual 1.8.14
eris_ifu_jitter_static.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_STATIC_H_
22#define ERISP_ERIS_ERIS_IFU_JITTER_STATIC_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#include <gsl/gsl_interp2d.h>
35
36#include <cpl.h>
37#include <hdrl.h>
38#include "eris_ifu_functions.h"
39#include "eris_ifu_jitter_interface.h"
40#include "eris_ifu_extract_spec_static.h"
41
42/*-----------------------------------------------------------------------------
43 Define
44 -----------------------------------------------------------------------------*/
45
46typedef enum {OBJECT_CUBE, STD_CUBE, PSF_CUBE, STD_FLUX_CUBE, SKY_OBJECT_CUBE,
47 SKY_STD_CUBE, SKY_PSF_CUBE, SKY_STD_FLUX_CUBE, TWEAKED_CUBE, TWEAKED_STD_CUBE,
48 DAR_CUBE, DAR_STD_CUBE, DAR_PSF_CUBE, DAR_STD_FLUX_CUBE, PUPIL_CUBE,
49 JITTER_CUBE, BPM_CUBE, STD_CUBE_NOFLAT, STD_FLUX_CUBE_NOFLAT,
50 OBJECT_CUBE_COADD, TWEAKED_CUBE_COADD, DAR_CUBE_COADD,DAR_STD_CUBE_COADD,
51 DAR_PSF_CUBE_COADD, DAR_PUPIL_CUBE_COADD, STD_CUBE_COADD,
52 PSF_CUBE_COADD, STD_FLUX_CUBE_COADD, PUPIL_CUBE_COADD,
53 STD_FLUX_CUBE_COADD_NOFLAT, STD_CUBE_COADD_NOFLAT}
54cubeType;
55
56/*
57struct cubesStruct {
58 int cubeCnt;
59 cpl_imagelist **cube;
60 cpl_propertylist **header;
61};
62*/
63
64/*-----------------------------------------------------------------------------
65 Functions prototypes
66 -----------------------------------------------------------------------------*/
67
68/*----------------------------------------------------------------------------*/
69
70cpl_error_code eris_ifu_jitter_process_exposures(struct sofStruct *sof,
71 struct stdParamStruct stdParams,
72 struct paramStruct params,
73 cpl_frameset *frameset,
74 const cpl_parameterlist * parlist,
75 const char* recipe_name,
76 const char* context);
77
78cpl_error_code eris_ifu_jitter_process_cubes(struct sofStruct *sof,
79 struct stdParamStruct stdParams,
80 struct paramStruct params,
81 cpl_frameset *frameset,
82 const cpl_parameterlist * parlist,
83 const char* recipe_name,
84 cubeType *obj_type);
85
86cpl_imagelist *eris_ifu_jitter_reconstruct_cube(
87 cpl_image *resampledDetImage,
88 slitletDetectionModes mode,
89 int fineTuneMode,
90 double firstCol,
91 cpl_vector *distancesV,
92 cpl_bivector *positionsVV);
93
94hdrl_image *eris_ifu_jitter_subtract_background(
95 skyTweakModes sky_tweak,
96 int sofIdx,
97 struct sofStruct *sof,
98 productDepthType productDepth);
99
100hdrl_imagelist *eris_ifu_jitter_build_cube(
101 hdrl_image *image,
102 int sofIdx,
103 struct sofStruct *sof,
104 struct paramStruct params,
105 bool doVelocityCorrection,
106 cpl_polynomial *ohLambdaCorrection,
107 productDepthType productDepth);
108
109cpl_error_code eris_ifu_extract_spec(
110 const cpl_imagelist *data_in,
111 const cpl_imagelist *noise_in,
112 cpl_image *mask,
113 cpl_vector **spec_data_out,
114 cpl_vector **spec_noise_out);
115
116cubeType
117eris_ifu_jitter_get_obj_type(sofModes mode);
118cubeType
119eris_ifu_jitter_get_sky_type(sofModes mode);
120cubeType
121eris_ifu_jitter_get_coadd_obj_type(cubeType type);
122cpl_error_code
123eris_ifu_jitter_get_procatg_and_filename(cubeType type, char **proCatg,
124 char **filenamePrefix);
125
126void eris_ifu_jitter_free_sofStruct(struct sofStruct* sof_struct);
127
128cpl_error_code
129eris_ifu_jitter_extract(cpl_frameset * frameset,
130 const cpl_parameterlist * parlist, cubeType obj_type, const char* pcatg,
131 struct stdParamStruct stdParams, const char* recipe_name,
132 const char* context);
133cpl_error_code
134eris_ifu_jitter_extract_spec_processSof(
135 cubeType obj_type,
136 cpl_frameset* frames,
137 struct esParamStruct params,
138 struct esSofStruct *sof);
139
140cpl_error_code eris_ifu_extract_spec_fetch_params(
141 const cpl_parameterlist * parlist,
142 struct esParamStruct *params,
143 const char* context);
144
145cpl_error_code eris_ifu_dar_correction(hdrl_imagelist *cube,
146 cpl_propertylist *hdr,
147 int method,
148 double radius,
149 int length);
150
151cpl_error_code eris_ifu_dar_cpl_shift(
152 cpl_image *inImg,
153 cpl_image *out1Img,
154 cpl_image *out2Img,
155 double xShift,
156 double yShift,
157 cpl_kernel kernelType,
158 double width,
159 cpl_size kernelSize);
160
161cpl_error_code eris_ifu_dar_gsl_shift(
162 cpl_image *inImg,
163 cpl_image *outImg,
164 double xShift,
165 double yShift,
166 const gsl_interp2d_type *T);
167
168void
169eris_ifu_jitter_get_cube_type_string(cubeType type);
170
171cpl_error_code
172eris_frameset_duplicate_cube_tag(cpl_frameset* frameset, const char* pcatg, cpl_boolean apply_flat);
173int
174eris_frameset_count_tag(cpl_frameset * sof, const char* tag);
175
176cpl_error_code eris_ifu_update_wcs_with_OCS_keywords(
177 struct sofStruct *sof);
178
179#endif
180
181