DAS  3.1.6 - 18/09/2017
Functions
DOAS.h File Reference
#include "DOASdef.h"
+ Include dependency graph for DOAS.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void CalcSpectrumLimits (int mod, int pos, int spx, int epix, int refpix)
 
int Pix2Wl (int mod, int pos, int spix, int epix, struct doas *pd)
 

Function Documentation

§ CalcSpectrumLimits()

void CalcSpectrumLimits ( int  mod,
int  pos,
int  spx,
int  epix,
int  refpix 
)

Definition at line 67 of file DOAS.c.

References doas::k1, doas::k2, doas::lambda, and wl.

Referenced by DrawAreaPlotCB().

68 {
69 
70 /* Da calcoli di Giorgio
71 2773 0.675070513 -3.42932E-05
72 3312 0.608620686 -1.22438E-05
73 3840 0.513266027 9.38545E-06
74 4358 0.580417561 -8.00615E-06
75 4866 1.094769302 -1.17723E-04
76 5363 0.637981086 -2.18565E-05
77 5850 0.450432353 9.64196E-06
78 6237 0.926432179 -6.81376E-05
79 6795 0.509714198 -3.59181E-06
80 7253 0.961946259 -6.73045E-05
81 */
82 
83 /* Da calcoli di Danbo in DispersioneSPATRAM_EV.xls
84 
85  ATTENZIONE LA procedura di linearizzazione utilizza l'equazione: dl = K1 - K2 * l,
86  mentre la procedura di regressione di EXCEL utilizza (giustamente) dl = K1 + K2 * l,
87  quindi i valori di k2 in excel hanno il segno "-" mentre qui devono essere inseriti nel
88  vettore kk2 con il segno positivo.
89 
90 2823 dl = 2.35808044 - 0.000628126 * l
91 3337 dl = 0.767112208 - 4.67502E-05 * l
92 3850 dl = 0.824026577 - 5.67659E-05 * l
93 4358 dl = 3.011942876 - 0.000572933 * l
94 4861
95 5332
96 5814
97 6282
98 6734
99 7201
100 7677
101 8195
102 8622
103 9023
104 9405
105 9758
106 10066
107 10358
108 1.094769302 -1.17723E-04
109 
110 
111 
112 */
113 
114  int k, i, c = pos;
115 /* Da calcoli di Giorgio*/
116 // double kk1[] = {0.675070513,0.608620686,0.513266027,0.580417561,1.094769302,6,7,8,9,10,11,12,13,14,15,16,17,18};
117 // double kk2[] = {-3.42932E-05,-1.22438E-05,9.38545E-06,-8.00615E-06,-1.17723E-04,6,7,8,9,10,11,12,13,14,15,16,17,18};
118 
119 /* Da calcoli di Danbo*/
120 // double kk1[] = {2.35808044,0.767112208,0.824026577,3.011942876,1.094769302,1,1,1,1,1,1,1,1,1,1,1,1,1};
121 // double kk2[] = {0.000628126,4.67502E-05,5.67659E-05,0.000572933,1.17723E-04,1,1,1,1,1,1,1,1,1,1,1,1,1};
122 
123  double lm[1055];
124 
125  double k1,k2;
126 
127  for(i = 0;i< 18 ;i++)
128  {
129  if(pos == wl[i])
130  {
131 // k1 = kk1[i];
132 // k2 = kk2[i];
133  k1 = DOAS.k1[i];
134  k2 = DOAS.k2[i];
135  }
136  }
137 /*
138  DOAS.lambda[512] = (2 * pos - k1) / (2 - k2); // dl for wl at pix 512
139 
140  DOAS.lambda[512] = (DOAS.lambda[512]) + (k1 - k2 * DOAS.lambda[512]); // tot wl at pix 512
141 
142 
143  //Wavelenth series is build for decreasing pixel number
144  for(k = 511; k >= 0; k--)
145  DOAS.lambda[k] = ((2 + k2) * DOAS.lambda[k + 1] - 2 * k1) / (2 - k2);
146 
147  //Wavelenth series is build for increasing pixel number
148  for (k = 513; k <= IDX; k++)
149  DOAS.lambda[k] = ((2 - k2) * DOAS.lambda[k - 1] + 2 * k1) / (2 + k2);
150 */
151 
152  lm[refpix] = (2 * pos - k1) / (2 - k2); // dl for wl at pix pixref
153 
154  lm[refpix] = (lm[refpix]) + (k1 - k2 * lm[refpix]); // tot wl at pix pixref
155 
156 
157  //Wavelenth series is build for decreasing pixel number
158  for(k = refpix - 1 ; k >= spix; k--)
159  lm[k] = ((2 + k2) * lm[k + 1] - 2 * k1) / (2 - k2);
160 
161  //Wavelenth series is build for increasing pixel number
162  for (k = refpix + 1; k <= epix +1; k++)
163  lm[k] = ((2 - k2) * lm[k - 1] + 2 * k1) / (2 + k2);
164 
165  for(i = spix; i<=epix; i++)
166  DOAS.lambda[i] = lm[i];
167 
168 }
double k2[20]
k2 dispersion parameter -slope (x stretch2
Definition: DOASdef.h:23
double lambda[1055]
Wavelength series.
Definition: DOASdef.h:18
double k1[20]
k1 dispersion parameter - intercept (x stretch1)
Definition: DOASdef.h:22
int wl[]
WaveLength definition - for SD_Grating.
Definition: DAS_Spat.c:182
doas DOAS
Definition: DOAS.c:20
+ Here is the caller graph for this function:

§ Pix2Wl()

int Pix2Wl ( int  mod,
int  pos,
int  spix,
int  epix,
struct doas pd 
)

Definition at line 26 of file DOAS.c.

References doas::dhg, doas::k1, doas::k2, doas::lambda, doas::pixref, doas::wlc, and doas::wlref.

Referenced by D_pbr_CB(), DrawAreaPlotCB(), and WriteColumn().

27 {
28  int k, i, c = pos, t=0;
29 
30  for(i = 0;i< 18 ;i++)
31  {
32  if(pos == pd->wlc[i])
33  {
34  t = i;
35  }
36  }
37  // dl for wl at pix pixref
38  pd->lambda[pd->pixref[t]] = (2 * pd->wlref[t] - pd->k1[t]) / (2 - pd->k2[t]);
39 
40  // tot wl at pix pixref
41  pd->lambda[pd->pixref[t]] =
42  (pd->lambda[pd->pixref[t]]) + (pd->k1[t] - pd->k2[t] * pd->lambda[pd->pixref[t]]) * pd->dhg[t];
43 
44 
45  //Wavelenth series is build for decreasing pixel number
46  for(k = pd->pixref[t] - 1 ; k >= spix; k--)
47  pd->lambda[k] = ((2 + pd->k2[t]) * pd->lambda[k + 1] - 2 * pd->k1[t]) / (2 - pd->k2[t]);
48 
49  //Wavelenth series is build for increasing pixel number
50  for (k = pd->pixref[t] + 1; k <= epix +1; k++)
51  pd->lambda[k] = ((2 - pd->k2[t]) * pd->lambda[k - 1] + 2 * pd->k1[t]) / (2 + pd->k2[t]);
52 
53  return 0;
54 }
double k2[20]
k2 dispersion parameter -slope (x stretch2
Definition: DOASdef.h:23
double wlref[20]
reference wavelength
Definition: DOASdef.h:20
int pixref[20]
reference pixel
Definition: DOASdef.h:21
double lambda[1055]
Wavelength series.
Definition: DOASdef.h:18
double dhg[20]
shift parameter
Definition: DOASdef.h:24
double k1[20]
k1 dispersion parameter - intercept (x stretch1)
Definition: DOASdef.h:22
int wlc[20]
Central wavelength.
Definition: DOASdef.h:19
+ Here is the caller graph for this function:
______________________________________________________________________________________
Generated on Mon Sep 18 2017 11:46:05 for DAS - Rel. 3.1.6 - 18/09/2017.