UVES Pipeline Reference Manual  5.4.6
uves_physmod_utils.h
1 /* *
2  * This file is part of the ESO UVES Pipeline *
3  * Copyright (C) 2004,2005 European Southern Observatory *
4  * *
5  * This library 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, 51 Franklin St, Fifth Floor, Boston, MA 02111-1307 USA *
18  * */
19 /* ===========================================================================
20  * $Id: uves_physmod_utils.h,v 1.6 2010-09-24 09:32:07 amodigli Exp $
21  * $Name: not supported by cvs2svn $
22  * $Revision: 1.6 $
23  * $Log: not supported by cvs2svn $
24  * Revision 1.4 2007/06/06 08:17:33 amodigli
25  * replace tab with 4 spaces
26  *
27  * Revision 1.3 2006/08/17 13:56:53 jmlarsen
28  * Reduced max line length
29  *
30  * Revision 1.2 2006/04/10 12:38:43 jmlarsen
31  * Minor layout change
32  *
33  * Revision 1.1 2006/02/03 07:46:30 jmlarsen
34  * Moved recipe implementations to ./uves directory
35  *
36  * Revision 1.7 2005/12/05 16:11:47 amodigli
37  * Fixed some warning
38  *
39  * Revision 1.6 2005/12/02 12:56:09 amodigli
40  * Fixed compilation problems on mac
41  *
42  * Revision 1.5 2005/11/28 15:36:34 amodigli
43  * Renamed global variables and global function with prefix uves_physmod
44  *
45  * Revision 1.4 2005/11/25 08:05:15 amodigli
46  * Added plotting facility in physmod. Commented out some strange things in utils.
47  *
48  * Revision 1.3 2005/08/29 10:05:08 jmlarsen
49  * Conversion to/from electrons when calculating photonic noise
50  *
51  * Revision 1.2 2005/08/29 08:27:58 amodigli
52  * Put into repository updates on physical model
53  *
54  * Revision 1.1 2005/06/17 11:34:34 amodigli
55  * First release
56  *
57  * ===========================================================================
58  */
59 #ifndef UVES_PHYSMOD_UTILS_H
60 #define UVES_PHYSMOD_UTILS_H
61 
62 
63 #include <cpl.h>
64 
65 
66 #define ARM_UNDEF 0
67 #define ARM_BLUE 1
68 #define ARM_RED 2
69 
70 
71 
72 /*
73  double fc;
74  double l;
75  int m;
76  char uves_arm;
77 
78 
79  double uves_beta_ech;
80  double uves_beta_cd ;
81  char uves_ccd_id;
82  double uves_physmod_rcd;
83  double uves_physmod_rech ;
84  double uves_physmod_x_off;
85  double uves_physmod_y_off;
86  double x;
87  double y;
88 
89 */
90 
91 /*
92  double lm, k, theta, *palpha, *pbeta;
93  int disp;
94  float binx, biny;
95  double waveCent;
96  double ccdrotred, ccdrotblue;
97  double echred, echblue, xred, xblue;
98  double p, t, w;
99  double lambda;
100  double alpha, beta;
101  double *puves_beta_ech, *puves_beta_cd, *pfc;
102  double *puves_physmod_rech, *puves_physmod_rcd, *pblz;
103  double wave, order, blz;
104  double *pbinsize,*ppixscale,*ppixscalCD,*plinewidpx,*plinelenpx,*plinewidth,*presol;
105  double *px, *py;
106  double *plambda;
107  double *pdm;
108  int *pm;
109  double *lambdaC, *fsrStart, *fsrEnd;
110  int *nx, *ny;
111 */
112 
113 void uves_physmod_set_incidence(double echred, double echblue, double xred, double xblue);
114 void uves_set_ccd_rot(double* uves_ccd_rot, double ccdrotred, double ccdrotblue);
115 void uves_physmod_set_offset(double offset_x, double offset_y,
116  double uves_physmod_x_off, double uves_physmod_y_off);
117 void uves_air_config(double p, double t, double w);
118 double uves_air_index(double lambda);
119 int uves_config(char uves_arm, char uves_ccd_id, int disp, double waveCent,
120  float binx, float biny);
121 
122 int uves_config_cpl(int blue, int upper, int disp, double waveCent,
123  float binx, float biny);
124 int uves_config_cpl_new(int blue, int upper, int disp, double waveCent,
125  float binx, float biny);
126 
127 int uves_physmod_find_order(double lm);
128 
129 double uves_physmod_find_beta(int m, double k, double l, double alpha);
130 
131 void uves_physmod_lambda_order2beta(double lambda, int m,
132  double* puves_beta_ech, double* puves_beta_cd,
133  double* pfc);
134 void uves_beta2xy(double uves_beta_cd, double uves_beta_ech, double fc, double* px, double* py);
135 void uves_physmod_photo_beta(double lambda, double uves_beta_ech,
136  double uves_beta_cd, double* puves_physmod_rech,
137  double* puves_physmod_rcd, double* pblz);
138 void uves_physmod_pixscl(double wave, int order, double uves_physmod_rech,
139  double uves_physmod_rcd, float binx,
140  float biny, double fc, double slitwidth, double slitlength,
141  double* pbinsize, double* ppixscale, double* ppixscalCD,
142  double* plinewidpx, double* plinelenpx, double* plinewidth,
143  double* presol);
144 void uves_physmod_xy_model(double lambda, int m, double* px, double* py);
145 
146 void uves_physmod_lambda_order_model(double* plambda, int* pm, double x, double y);
147 void uves_physmod_find_FSR(int m, double* lambdaC, double* fsrStart, double* fsrEnd);
148 void uves_ccd_size(int* nx, int* ny);
149 void uves_physmod_xy_regres(double x,double y,double* px,double* py);
150 
151 
152 
153 /*
154  Global Variables and Constants
155 */
156 
157 extern float uves_bin[2];
158 extern double uves_ccd_rot[2];
159 
160 extern int uves_cfg_indx;
161 extern int uves_x_disp_id;
162 extern double uves_alpha0_cd, uves_beta0_cd;
163 extern char uves_arm_id;
164 
165 
166 extern double uves_physmod_offsetx[6];
167 extern double uves_physmod_offsety[6];
168 
169 #endif