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

extract/lib/fit_max.c File Reference

Misc. fitting procedures used by find_max. More...

Go to the source code of this file.

Defines

#define FMX_XPEAKNORM   0.3
#define FMX_XPEAKOFFS(k)   (glxpeakoffs[k])
#define FMX_IPEAKNORM(k)   (glipeaknorm[k])
#define FMX_SPEAKNORM   0.1
#define Xpeak(i)   (par[3*(i) ]*FMX_XPEAKNORM + FMX_XPEAKOFFS(i))
#define Ipeak(i)   (par[3*(i)+1]*FMX_IPEAKNORM(i))
#define Speak(i)   (par[3*(i)+2]*FMX_SPEAKNORM)

Functions

long nllsqfit_maxpack (long *mode, long *npts, long *npar, long *ldfj, double par[], double fvec[], double fjac[], long *nstate, long *iuser, double x_n_sig[])
double Fit_pack (double xarr[], int npts, int npeak, double packpar[], double dpackpar[], double xfit[])
 Simultaneous fit of a pack of peaks.


Variables

int glnggeo
double * glIgeo
double * glXgeo
double * glSgeo
int glngpsf
double ** glIpsf
double ** glSpsf
int glngloc
double * glipeaknorm
double * glxpeakoffs


Detailed Description

Misc. fitting procedures used by find_max.

Copyright:
(c) 2003 CRAL-Observatoire de Lyon
Date:
Date
2004/03/09 16:11:51
Author:
Yannick Copin <y.copin@ipnl.in2p3.fr>

Author
ycopin
Version:
Revision
1.8
Id
fit_max.c,v 1.8 2004/03/09 16:11:51 ycopin Exp

Definition in file fit_max.c.


Define Documentation

#define FMX_XPEAKNORM   0.3
 

Definition at line 39 of file fit_max.c.

Referenced by Fit_pack(), and nllsqfit_maxpack().

#define FMX_XPEAKOFFS  )     (glxpeakoffs[k])
 

Definition at line 40 of file fit_max.c.

Referenced by Fit_pack().

#define FMX_IPEAKNORM  )     (glipeaknorm[k])
 

Definition at line 41 of file fit_max.c.

Referenced by Fit_pack(), and nllsqfit_maxpack().

#define FMX_SPEAKNORM   0.1
 

Definition at line 42 of file fit_max.c.

Referenced by Fit_pack(), and nllsqfit_maxpack().

#define Xpeak  )     (par[3*(i) ]*FMX_XPEAKNORM + FMX_XPEAKOFFS(i))
 

#define Ipeak  )     (par[3*(i)+1]*FMX_IPEAKNORM(i))
 

#define Speak  )     (par[3*(i)+2]*FMX_SPEAKNORM)
 


Function Documentation

long nllsqfit_maxpack long *  mode,
long *  npts,
long *  npar,
long *  ldfj,
double  par[],
double  fvec[],
double  fjac[],
long *  nstate,
long *  iuser,
double  x_n_sig[]
 

Fitting procedure for the pack cross-dispersion profile: fixed glnggeo(>0)-gaussian profile (x) fixed glngpsf(>=0)-gaussian global PSF (x) 1-gaussian local PSF simultaneously adjusted.

To be used with nllsqfit_bnd. Derivatives have been checked.

Note:
Make use of global variables

Previous version known as n_3gausspup

See nllsqfit_globalPSFn for further development tips (including multi-gaussian local PSF)

Definition at line 61 of file fit_max.c.

References FMX_IPEAKNORM, FMX_SPEAKNORM, FMX_XPEAKNORM, glIpsf, glnggeo, glngpsf, glSpsf, and glXgeo.

Referenced by Fit_pack().

double Fit_pack double  xarr[],
int  npts,
int  npeak,
double  packpar[],
double  dpackpar[],
double  xfit[]
 

Simultaneous fit of a pack of peaks.

Parameters:
xarr multi-peak profile to be adjsuted
npts nb of pixels in profile
npeak nb of peaks in profile
packpar parameters of the fit (initial guess/fit result)
dpackpar error on the parameters
xfit adjusted multi-peak profile
Returns:
RMS if OK, -status otherwise (as returned by nllsqfit_bnd)

Definition at line 176 of file fit_max.c.

References FMX_IPEAKNORM, FMX_SPEAKNORM, FMX_XPEAKNORM, FMX_XPEAKOFFS, glipeaknorm, glngloc, glxpeakoffs, nllsqfit_maxpack(), and SNIFS_INTERSP.

Referenced by main().


Variable Documentation

int glnggeo
 

Definition at line 23 of file fit_max.c.

Referenced by geoPSF(), main(), Mpup_PSF(), nllsqfit_globalPSF(), nllsqfit_localPSF(), nllsqfit_localPSFn(), nllsqfit_maxpack(), set_corePSF(), and set_geoPSF().

double* glIgeo
 

Definition at line 24 of file fit_max.c.

Referenced by geoPSF(), main(), nllsqfit_globalPSF(), set_corePSF(), and set_geoPSF().

double * glXgeo
 

Definition at line 24 of file fit_max.c.

Referenced by geoPSF(), main(), Mpup_PSF(), nllsqfit_globalPSF(), nllsqfit_localPSF(), nllsqfit_localPSFn(), nllsqfit_maxpack(), and set_geoPSF().

double * glSgeo
 

Definition at line 24 of file fit_max.c.

Referenced by geoPSF(), main(), nllsqfit_globalPSF(), set_corePSF(), and set_geoPSF().

int glngpsf
 

Definition at line 27 of file fit_max.c.

Referenced by globalPSF(), main(), Mpup_PSF(), nllsqfit_globalPSF(), nllsqfit_localPSF(), nllsqfit_localPSFn(), nllsqfit_maxpack(), and set_corePSF().

double** glIpsf
 

Definition at line 30 of file fit_max.c.

Referenced by main(), nllsqfit_localPSF(), nllsqfit_localPSFn(), nllsqfit_maxpack(), and set_corePSF().

double ** glSpsf
 

Definition at line 30 of file fit_max.c.

Referenced by main(), nllsqfit_localPSF(), nllsqfit_localPSFn(), nllsqfit_maxpack(), and set_corePSF().

int glngloc
 

Definition at line 33 of file fit_max.c.

Referenced by final_mpup(), Fit_pack(), main(), and nllsqfit_localPSFn().

double * glipeaknorm
 

Definition at line 159 of file fit_max.c.

Referenced by Fit_pack().

double * glxpeakoffs
 

Definition at line 159 of file fit_max.c.

Referenced by Fit_pack().


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