Main Page | Modules | Data Structures | File List | Data Fields | Globals | Related Pages

calib/source/wcalib.c File Reference

Main file for wcalib. More...

Go to the source code of this file.

Data Structures

struct  ArcLine
struct  ArcGroup

Defines

#define FWHMINIT   (double)2.
#define CRITER_SIG_1   (double)0.05
#define CRITER_SIG_2   (double)0.10
#define CRITER_NREJ_1   (double)0.2
#define CRITER_NREJ_2   (double)0.5
#define CRITER_DIFF_1   (int)3
#define CRITER_DIFF_2   (int)2

Typedefs

typedef ArcLine ArcLine
typedef ArcGroup ArcGroup

Functions

void ArcLine_Add (ArcLine **list, double lambda)
 Create or expand a list of lines.

ArcGroupArcGroup_New (ArcGroup **list, double lambda)
 Create a single-line group and Create or expand a list of groups.

void ArcGroup_Add (ArcGroup **list, double lambda)
 Add a line to 1st group of a list ???

void ArcLine_Delete (ArcLine *list)
 Delete a list of lines ???

void ArcGroup_Delete (ArcGroup *list)
 Delete a list of groups.

int Take_Ref (TABLE *table, double **ref, double borne1, double borne2)
 Extract from the ref table the line with bounds.

void Eval_bounds (ArcGroup *groupe, double Nhw, double dlambda)
 Compute the bounds for a set of line.

ArcGroupJoin_Ref_Peak (int size, double *array, double Nhw, double dlambda)
 Join the line in some set of line.

int Get_Spectrum_Data (SPECTRUM *spectre, double inf, double sup, double *coef, long ncoef, double xmin, double xmax)
 Return the intensity stored in a spectrum between bounds.

void MultiGauss (double *par, double *fj, int *ldfj, int *igo, int *iopt, double *ropt)
 Compute the multi-gaussian needed by lsq_fit_with_bounds_nonag.

void MultiGauss_nag (long *MODE, long *npts, long *nvar, long *ldfj, double *par, double *f, double *fj, long *nstate, long *iuser, double *ruser)
 Compute the multi-gaussian, needed by lsq_fit_with_bounds.

void SaveGauss (SPECTRUM *spectre, double *X, double *SIGMA, double *I, int ng, double *coef, long ncoef, double xmin, double xmax)
 Save the gaussian fit in a spectrum.

void SaveCalib (SPECTRUM *spectre, double *coefcal, long ncoefcal, double start, double end)
 Save the Calibration polynomial.

void Detection_peak (long NbPixel, double Wbound, double *X, double *LAMBDA, double *SIGMA, double *I, int *FLAG, double siginf, double sigsup)
 Fit gaussian on a set of line.

int main (int argc, char **argv)

Variables

double lbdastart
double lbdastep
int NbGauss
double * SPECTRE


Detailed Description

Main file for wcalib.

Copyright:
(c) 2003 CRAL-Observatoire de Lyon
Date:
Fri Mar 19 16:46:32 2004
Author:
J-L Villecroze, R Bacon, E Emsellem, A Pecontal

Yannick Copin <y.copin@ipnl.in2p3.fr>

Author
ycopin
Version:
Adapted from wcalib_SAU v1.6

Revision
1.16
Id
wcalib.c,v 1.16 2004/11/19 12:55:14 ycopin Exp

Todo:
Make a full port to SNIFS standards. Discard call to NAG. Complete the documentation.

Definition in file wcalib.c.


Define Documentation

#define FWHMINIT   (double)2.
 

Definition at line 27 of file wcalib.c.

Referenced by Detection_peak().

#define CRITER_SIG_1   (double)0.05
 

Definition at line 30 of file wcalib.c.

Referenced by main().

#define CRITER_SIG_2   (double)0.10
 

Definition at line 31 of file wcalib.c.

Referenced by main().

#define CRITER_NREJ_1   (double)0.2
 

Definition at line 32 of file wcalib.c.

Referenced by main().

#define CRITER_NREJ_2   (double)0.5
 

Definition at line 33 of file wcalib.c.

Referenced by main().

#define CRITER_DIFF_1   (int)3
 

Definition at line 34 of file wcalib.c.

Referenced by main().

#define CRITER_DIFF_2   (int)2
 

Definition at line 35 of file wcalib.c.

Referenced by main().


Typedef Documentation

typedef struct ArcLine ArcLine
 

Arc line structure

typedef struct ArcGroup ArcGroup
 

Arc line group structure


Function Documentation

void ArcLine_Add ArcLine **  list,
double  lambda
 

Create or expand a list of lines.

Parameters:
list Pointer to the list of lines (or NULL for a new list)
lambda Wavelength of the new line [AA]

Definition at line 71 of file wcalib.c.

References ArcLine::next.

Referenced by ArcGroup_Add(), and ArcGroup_New().

ArcGroup* ArcGroup_New ArcGroup **  list,
double  lambda
 

Create a single-line group and Create or expand a list of groups.

Parameters:
list Pointer to the list of groups (or NULL for a new list)
lambda Wavelength of the new line [AA]

Definition at line 104 of file wcalib.c.

References ArcLine_Add(), and ArcGroup::next.

Referenced by Join_Ref_Peak().

void ArcGroup_Add ArcGroup **  list,
double  lambda
 

Add a line to 1st group of a list ???

Parameters:
list Pointer to the list of groups
lambda Wavelength of the new line [AA]

Definition at line 143 of file wcalib.c.

References ArcLine_Add().

Referenced by Join_Ref_Peak().

void ArcLine_Delete ArcLine list  ) 
 

Delete a list of lines ???

Parameters:
list Pointer to the list of lines

Definition at line 157 of file wcalib.c.

References ArcLine::next.

Referenced by ArcGroup_Delete().

void ArcGroup_Delete ArcGroup list  ) 
 

Delete a list of groups.

Parameters:
list Pointer to the list of groups

Definition at line 173 of file wcalib.c.

References ArcLine_Delete(), ArcGroup::lines, and ArcGroup::next.

int Take_Ref TABLE *  table,
double **  ref,
double  borne1,
double  borne2
 

Extract from the ref table the line with bounds.

Parameters:
table Table where the ref line are stored
ref Array where the line are stored in the function
borne1 Lower bounds
borne2 Upper bounds
Returns:

Definition at line 199 of file wcalib.c.

Referenced by main().

void Eval_bounds ArcGroup groupe,
double  Nhw,
double  dlambda
 

Compute the bounds for a set of line.

Parameters:
groupe Groupe of line to calculate on
Nhw Line half-width [$d\lambda$]
dlambda $d\lambda$

Definition at line 240 of file wcalib.c.

References ArcLine::lambda, ArcGroup::lbda_inf, ArcGroup::lbda_sup, ArcGroup::lines, and ArcLine::next.

Referenced by Join_Ref_Peak().

ArcGroup* Join_Ref_Peak int  size,
double *  array,
double  Nhw,
double  dlambda
 

Join the line in some set of line.

Parameters:
size Size of the lines array
array Array of lines
Nhw Line half-width [$d\lambda$]
dlambda $d\lambda$
Returns:

Definition at line 269 of file wcalib.c.

References ArcGroup_Add(), ArcGroup_New(), and Eval_bounds().

Referenced by main().

int Get_Spectrum_Data SPECTRUM *  spectre,
double  inf,
double  sup,
double *  coef,
long  ncoef,
double  xmin,
double  xmax
 

Return the intensity stored in a spectrum between bounds.

Parameters:
spectre Spectrum
inf Lower bounds
sup Upper bounds
coef 
ncoef 
xmin 
xmax 
Returns:

Definition at line 321 of file wcalib.c.

References lbdastart, and SPECTRE.

Referenced by main().

void MultiGauss double *  par,
double *  fj,
int *  ldfj,
int *  igo,
int *  iopt,
double *  ropt
 

Compute the multi-gaussian needed by lsq_fit_with_bounds_nonag.

Parameters:
par 
fj 
ldfj 
igo 
iopt 
ropt 
Returns:

Definition at line 369 of file wcalib.c.

References lbdastart, lbdastep, NbGauss, and SPECTRE.

Referenced by Detection_peak().

void MultiGauss_nag long *  MODE,
long *  npts,
long *  nvar,
long *  ldfj,
double *  par,
double *  f,
double *  fj,
long *  nstate,
long *  iuser,
double *  ruser
 

Compute the multi-gaussian, needed by lsq_fit_with_bounds.

Parameters:
MODE 
npts 
nvar 
ldfj 
par 
f 
fj 
nstate 
iuser 
ruser 

Definition at line 410 of file wcalib.c.

References lbdastart, lbdastep, NbGauss, and SPECTRE.

void SaveGauss SPECTRUM *  spectre,
double *  X,
double *  SIGMA,
double *  I,
int  ng,
double *  coef,
long  ncoef,
double  xmin,
double  xmax
 

Save the gaussian fit in a spectrum.

Parameters:
spectre Spectrum where to store the data
X Wavelength array
SIGMA Sigma array
I Intensity
ng Number of gaussian
coef Polynomial fit coefficients
ncoef Nb of coefficients (deg + 1)
xmin 
xmax Fit boundaries for val_pol

Definition at line 456 of file wcalib.c.

Referenced by main().

void SaveCalib SPECTRUM *  spectre,
double *  coefcal,
long  ncoefcal,
double  start,
double  end
 

Save the Calibration polynomial.

Parameters:
spectre Spectrum where store the data
coefcal 
ncoefcal 
start 
end 

Definition at line 491 of file wcalib.c.

void Detection_peak long  NbPixel,
double  Wbound,
double *  X,
double *  LAMBDA,
double *  SIGMA,
double *  I,
int *  FLAG,
double  siginf,
double  sigsup
 

Fit gaussian on a set of line.

Parameters:
NbPixel Number of pixel in the current set of line
Wbound 
X Result wavelength array of this set of line
LAMBDA Wavelength array
SIGMA Sigma array
I Intensity array
FLAG Flag array
siginf Lower sigma bounds
sigsup Upper sigma bounds

Definition at line 520 of file wcalib.c.

References FWHMINIT, lbdastart, lbdastep, MultiGauss(), NbGauss, and SPECTRE.

Referenced by main().

int main int  argc,
char **  argv
 

Bug:
Do not check FCLASS yet: the preprocess does not propagate FCLASS on B-channel

Definition at line 596 of file wcalib.c.

References CRITER_DIFF_1, CRITER_DIFF_2, CRITER_NREJ_1, CRITER_NREJ_2, CRITER_SIG_1, CRITER_SIG_2, Detection_peak(), Get_Spectrum_Data(), init_snifs(), Join_Ref_Peak(), ArcGroup::lbda_inf, ArcGroup::lbda_sup, lbdastep, LRANGE4, ArcGroup::nb, NbGauss, ArcGroup::next, SaveGauss(), Take_Ref(), and WLMAXDEGRE.


Variable Documentation

double lbdastart
 

Definition at line 39 of file wcalib.c.

Referenced by Detection_peak(), Get_Spectrum_Data(), MultiGauss(), and MultiGauss_nag().

double lbdastep
 

Definition at line 40 of file wcalib.c.

Referenced by Detection_peak(), main(), MultiGauss(), and MultiGauss_nag().

int NbGauss
 

Definition at line 41 of file wcalib.c.

Referenced by Detection_peak(), main(), MultiGauss(), and MultiGauss_nag().

double* SPECTRE
 

Definition at line 42 of file wcalib.c.

Referenced by Detection_peak(), Get_Spectrum_Data(), MultiGauss(), and MultiGauss_nag().


Generated on Tue Nov 23 18:04:20 2004 for Snifs by doxygen 1.3.3