VISIR Pipeline Reference Manual  4.1.7
visir_spc_optmod.h
1 /* $Id: visir_spc_optmod.h,v 1.19 2013-03-18 15:10:52 jtaylor Exp $
2  *
3  * This file is part of the VISIR 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 02111-1307 USA
19  */
20 
21 /*
22  * $Author: jtaylor $
23  * $Date: 2013-03-18 15:10:52 $
24  * $Revision: 1.19 $
25  * $Name: not supported by cvs2svn $
26  */
27 
28 #ifndef VISIR_SPC_OPTMOD_H
29 #define VISIR_SPC_OPTMOD_H
30 
31 /*-----------------------------------------------------------------------------
32  Defines
33  -----------------------------------------------------------------------------*/
34 
35 /* The size of the VISIR Optical Model object */
36 #define VISIR_SPC_OPTMOD_SIZEOF (4*sizeof(int) + 14 * sizeof(double))
37 
38 /* The Central Wavelength [micron] for the LR Prism mode */
39 /* Computed by visir_spc_phys_lrp() */
40 #define VISIR_SPC_LRP_CWLEN 10.91
41 
42 /* According to HUKaufl the resolution is approximately 300 */
43 #define VISIR_SPC_LRP_RESOL 300.
44 
45 /* Dispersion at center [pixel/m] (Computed by visir_spc_phys_lrp()) */
46 #define VISIR_SPC_LRP_RESOL_DISP 121412177.
47 
48 /* Wavelength on the 1'st pixel [m] (Computed by visir_spc_phys_lrp()) */
49 #define VISIR_SPC_LRP_WLEN0 6.70e-6
50 
51 /* Wavelength on the last pixel [m] (Computed by visir_spc_phys_lrp()) */
52 #define VISIR_SPC_LRP_WLEN1 14.21e-6
53 
54 #define VISIR_SPC_LRP_NAME "LRP"
55 
56 /*-----------------------------------------------------------------------------
57  New types
58  -----------------------------------------------------------------------------*/
59 
60 enum visir_spc_resol_ {
61  VISIR_SPC_R_ERR = 0,
62  VISIR_SPC_R_LRP,
63  VISIR_SPC_R_LR,
64  VISIR_SPC_R_MR,
65  VISIR_SPC_R_HR,
66  VISIR_SPC_R_GHR
67 };
68 
69 typedef enum visir_spc_resol_ visir_spc_resol;
70 
71 struct visir_optmod_ {
72  /* For this struct only the size is public */
73  /* The first member ensures proper alignment of this and its
74  corresponding private struct, the second member ensures that
75  the two structs have identical sizes */
76 
77  /* Any access to the below two members leads to undefined behaviour! */
78 
79  double ensure_alignment;
80  char contents[VISIR_SPC_OPTMOD_SIZEOF - sizeof(double)];
81 };
82 
83 typedef struct visir_optmod_ visir_optmod;
84 
85 #undef VISIR_SPC_OPTMOD_SIZEOF
86 
87 /*-----------------------------------------------------------------------------
88  Function prototypes
89  -----------------------------------------------------------------------------*/
90 
91 int visir_spc_optmod_init(visir_spc_resol, double, visir_optmod *, int);
92 double visir_spc_optmod_wlen(const visir_optmod *, double *, double *);
93 double visir_spc_optmod_cross_dispersion(const visir_optmod *, double);
94 double visir_spc_optmod_echelle(const visir_optmod *, double, int);
95 double visir_spc_optmod_resolution(const visir_optmod *);
96 double visir_spc_optmod_dispersion(const visir_optmod *);
97 int visir_spc_optmod_side_is_A(const visir_optmod *);
98 int visir_spc_optmod_get_echelle_order(const visir_optmod *);
99 
100 #endif