10 #include <sys/timeb.h> 26 int Pix2Wl(
int mod,
int pos,
int spix,
int epix,
struct doas *pd)
28 int k, i, c = pos, t=0;
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]);
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]);
127 for(i = 0;i< 18 ;i++)
152 lm[refpix] = (2 * pos - k1) / (2 - k2);
154 lm[refpix] = (lm[refpix]) + (k1 - k2 * lm[refpix]);
158 for(k = refpix - 1 ; k >= spix; k--)
159 lm[k] = ((2 + k2) * lm[k + 1] - 2 * k1) / (2 - k2);
162 for (k = refpix + 1; k <= epix +1; k++)
163 lm[k] = ((2 - k2) * lm[k - 1] + 2 * k1) / (2 + k2);
165 for(i = spix; i<=epix; i++)
181 int x, y, BlindPix_1;
213 for(x = 2; x <
IDX - BlindPix_1; x++)
216 for(y = 0; y <
IDY; y++)
225 for(x = 2; x <
IDX - BlindPix_1; x++)
228 for(y = 0; y <
IDY; y++)
235 fd = fopen(
"TestLogRatio.dat",
"w");
240 for(x = 2; x <
IDX - BlindPix_1; x++)
243 fprintf(fd,
" %9.4lf", DOAS.
lambda[x]);
244 for(y = 0; y <
IDY; y++)
249 fprintf(fd,
" %9.4lf", DOAS.
VarY[y *
IDX + x]);
251 fprintf(fd,
"\n", NULL);
253 fprintf(fd,
"\n", NULL);
261 for(x = 2; x <
IDX - BlindPix_1; x++)
263 for(y = 0; y <
IDY; y++)
272 for(x = 2; x <
IDX - BlindPix_1; x++)
275 for(y = 0; y <
IDY; y++)
int SmoothFloatData(float *source, float *destination, int horpix, int verpix, int filw, int bp)
Calc. the smoothed matrix of a float one. .
double k2[20]
k2 dispersion parameter -slope (x stretch2
float * IsSmoothed
Smoothed measured spectrum.
int IDX
Number of sensible horizontal pixels.
float * IoSmoothed
Smoothed ref spectrum.
int FilterData(unsigned short *mat, int horpix, int verpix, int filw, int bp)
spectrumheader SPH
Spectrum Header Structure.
double wlref[20]
reference wavelength
int SmoothData(unsigned short *source, float *destination, int horpix, int verpix, int filw, int bp)
Calc. the smoothed matrix of an unsigned short one. .
int pixref[20]
reference pixel
unsigned short * ImatOrig
double lambda[1055]
Wavelength series.
double dhg[20]
shift parameter
double k1[20]
k1 dispersion parameter - intercept (x stretch1)
int IDY
Number of sensible vertical pixels.
int Pix2Wl(int mod, int pos, int spix, int epix, struct doas *pd)
int FFTFilter
Fast Fourier Trasform Filter windows.
int BuildLogRatio(void)
first attempt to apply the DOAS algorithm (..on going!!!)
unsigned short * IoMat
Reference spectrum.
int wl[]
WaveLength definition - for SD_Grating.
int wlc[20]
Central wavelength.
void CalcSpectrumLimits(int mod, int pos, int spix, int epix, int refpix)
float * AllocFloatMat(int hp, int vp)
float * LogRatioMat
log of the ratio