IIINSTRUMENT Pipeline Reference Manual 4.6.1
visir_spectro.h
1/*
2 * This file is part of the VISIR Pipeline
3 * Copyright (C) 2002,2003,2015,2016 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 02111-1307 USA
18 */
19
20#ifndef VISIR_SPECTRO_H
21#define VISIR_SPECTRO_H
22
23/*-----------------------------------------------------------------------------
24 Includes
25 -----------------------------------------------------------------------------*/
26
27#include "visir_spc_optmod.h"
28#include "visir_inputs.h"
29#include "irplib_framelist.h"
30#include <cpl.h>
31#include <stdbool.h>
32
33/* approximate pixel position of 8um and 13 um on aquarius */
34#define VISIR_AQU_APPROX_WLEN8 140
35#define VISIR_AQU_APPROX_WLEN13 840
36
37typedef struct {
38 const char * recipename;
39 const cpl_parameterlist * parlist;
40 cpl_boolean do_fixcombi;
41 cpl_propertylist * phu;
42
43 /* Inputs */
44 int auto_bpm;
45 int plot;
46 double phi;
47 double ksi;
48 double eps;
49 double delta;
50 double gain;
51 double ron;
52 double ox_sigma;
53 int ox_niters;
54 int ox_smooth;
55 int ox_kernel;
56 int bkgcorrect;
57 const char * respcal;
58
59 /* only non zero for echelle */
60 int orderoffset;
61 size_t extract;
62
63 /* photometry */
64 double phot_emis_tol;
65} visir_spc_config;
66
67visir_spc_resol visir_spc_get_res_wl(const irplib_framelist *, double *,
68 double *, double *, double *, int);
69
70cpl_image * visir_spc_flip(const cpl_image *, double, visir_spc_resol,
71 visir_data_type, bool *);
72
73cpl_bivector * visir_bivector_load_fits(const char *, const char *,
74 const char *, int);
75cpl_error_code visir_vector_resample(cpl_vector *, const cpl_vector *,
76 const cpl_bivector *);
77void * visir_spc_extract_wcal(const cpl_image *, const cpl_image *,
78 const int, const int, const double, const double,
79 const double, const double, const visir_spc_resol,
80 const visir_spc_config *, const char *,
81 const char *, const int, const visir_apdefs *,
82 const cpl_size, const bool,
83 cpl_table **, cpl_image **, cpl_propertylist *);
84
85cpl_error_code visir_spc_wavecal(const cpl_image *,
86 cpl_propertylist *,
87 double, double, double,
88 double, visir_spc_resol,
89 const visir_spc_config *,
90 const char *,
91 const char *,
92 cpl_table **, int);
93
94cpl_error_code visir_spectro_qc(cpl_propertylist *, cpl_propertylist *,
95 cpl_boolean, const irplib_framelist *,
96 const char *, const char *);
97
98cpl_error_code visir_spc_echelle_limit(int *, int *, double,
99 const visir_spc_config * cfg,
100 int, int, int);
101cpl_image * visir_spc_column_extract(const cpl_image *, int, int, int);
102
103
104cpl_error_code
105visir_spc_extract_order(cpl_image ** order,
106 cpl_image ** comorder,
107 int * lcol, int * rcol,
108 const cpl_image * combined,
109 const cpl_image * imhcycle,
110 const double wlen,
111 const visir_spc_config * pconfig,
112 const cpl_boolean do_ech,
113 const int);
114
115int visir_norm_coord(const bool rev, const float coord, const int lcol,
116 const int rcol, const visir_apdefs * aps);
117#endif