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

extract/lib/fit_mpup.c File Reference

Misc. fitting procedures used by find_mpup. More...

Go to the source code of this file.

Defines

#define DISLIN   1
#define dist   par[0]*FMP_LENSSNORM
#define angle   par[1]*FMP_ANGLENORM
#define xc   par[2]*FMP_POSITNORM
#define yc   par[3]*FMP_POSITNORM
#define alpha   par[4]*FMP_ALPHANORM
#define dist   dpar[0]
#define angle   dpar[1]
#define xc   dpar[2]
#define yc   dpar[3]
#define alpha   dpar[4]
#define Ipsf(i)   (i==0 ? 1. : par[2*i-1])
#define Spsf(i)   par[2*i]
#define Ipup(i)   (par[2*npsf+2*i-1]*FMP_IPSFNORM)
#define Xpup(i)   (par[2*npsf+2*i ]*FMP_XPSFNORM + glpcen[i]/2.)
#define Xpup   (par[0] *FMP_XPUPNORM + (*npts)/2.)
#define Ipup(i)   (par[2*i+1]*FMP_IPUPNORM)
#define Spup(i)   (par[2*i+2]*FMP_SPUPNORM)
#define Is(g, p, l)   (Is[g*npsf*nloc + p*nloc + l])
#define Ss(g, p, l)   (Ss[g*npsf*nloc + p*nloc + l])

Functions

double gaussian_mpup (double arr[], int npts, double start, double step, double par[], double dpar[], double fit[])
 Fit a pure gaussian profile (nllsqfit_gaussian) to the mpup.

long nllsqfit_distMLA (long *mode, long *npup, long *npar, long *ldfj, double *par, double f[], double fjac[], long *nstate, long *iuser, double user[])
void model_distMLA (int npup, double dpar[], int npar, float xd[], float yd[], float rd[])
double set_geoPSF (float scale)
double geoPSF (double x)
 Geometric PSF profile, according to global parameters.

long nllsqfit_globalPSF (long *mode, long *npts, long *npar, long *ldfj, double *par, double fvec[], double fjac[], long *nstate, long *iuser, double x_n_sig[])
double globalPSF (double x, double psfpar[])
 Global PSF profile, according to parameters psfpar.

double deconv_globalPSF (int ngpsf, double psfpar[], double decfac)
 Partial deconvolution of the global PSF.

double set_corePSF (double psfpar[])
long nllsqfit_localPSFn (long *mode, long *npts, long *npar, long *ldfj, double *par, double fvec[], double fjac[], long *nstate, long *iuser, double x_n_sig[])
double final_mpup (double xarr[], int npts, double start, double step, double xloc[], double dxloc[], double xfit[])
 Final fit (nllsqfit_localPSFn) of the mpup profile.


Variables

int * glmlaml
int * glmlanl
double * glmlaxpup
double * glmlaypup
double glmlaxlc
double glmlaylc
int glnggeo
double * glIgeo
double * glXgeo
double * glSgeo
int glngpsf
double ** glIpsf
double ** glSpsf
int glngloc
int * glpcen


Detailed Description

Misc. fitting procedures used by find_mpup.

Copyright:
(c) 2003 CRAL-Observatoire de Lyon / IPNL
Date:
Fri Nov 12 17:07:45 2004
Author:
Yannick Copin <y.copin@ipnl.in2p3.fr>

Author
ycopin
Version:
Revision
1.17
Id
fit_mpup.c,v 1.17 2004/11/12 16:24:38 ycopin Exp

Definition in file fit_mpup.c.


Define Documentation

#define DISLIN   1
 

Local flag for DISLIN output (submitted to HAVE_LIBDISLIN definition)

Definition at line 27 of file fit_mpup.c.

Referenced by model_distMLA(), and study_triangulation().

#define dist   par[0]*FMP_LENSSNORM
 

#define angle   par[1]*FMP_ANGLENORM
 

#define xc   par[2]*FMP_POSITNORM
 

#define yc   par[3]*FMP_POSITNORM
 

#define alpha   par[4]*FMP_ALPHANORM
 

#define dist   dpar[0]
 

#define angle   dpar[1]
 

#define xc   dpar[2]
 

#define yc   dpar[3]
 

#define alpha   dpar[4]
 

#define Ipsf  )     (i==0 ? 1. : par[2*i-1])
 

#define Spsf  )     par[2*i]
 

#define Ipup  )     (par[2*npsf+2*i-1]*FMP_IPSFNORM)
 

#define Xpup  )     (par[2*npsf+2*i ]*FMP_XPSFNORM + glpcen[i]/2.)
 

#define Xpup   (par[0] *FMP_XPUPNORM + (*npts)/2.)
 

#define Ipup  )     (par[2*i+1]*FMP_IPUPNORM)
 

#define Spup  )     (par[2*i+2]*FMP_SPUPNORM)
 

#define Is g,
p,
 )     (Is[g*npsf*nloc + p*nloc + l])
 

#define Ss g,
p,
 )     (Ss[g*npsf*nloc + p*nloc + l])
 


Function Documentation

double gaussian_mpup double  arr[],
int  npts,
double  start,
double  step,
double  par[],
double  dpar[],
double  fit[]
 

Fit a pure gaussian profile (nllsqfit_gaussian) to the mpup.

Parameters:
arr profile array to be adjusted
npts nb of points in profile
start starting coordinate of the profile
step step of the profile
par parameters of the fit
dpar error on the parameters
fit adjusted profile (zero-ed if error)
Returns:
RMS if OK, -status otherwise (as returned by nllsqfit_bnd)

Definition at line 66 of file fit_mpup.c.

References nllsqfit_gaussian().

Referenced by main().

long nllsqfit_distMLA long *  mode,
long *  npup,
long *  npar,
long *  ldfj,
double *  par,
double  f[],
double  fjac[],
long *  nstate,
long *  iuser,
double  user[]
 

Fitting procedure for the MLA distortion. Distortion law: $ 1 + \alpha*r^2$. Parameters to be adjusted: lenssize, angle, (xc,yc), alpha.

To be used with nllsqfit_bnd. Derivatives have been checked.

Note:
Make use of global variables

If compilation variable USE_R4_DIST is defined, an extra term is added to the distortion law: $ 1 + \alpha*r^2 + \beta*r^4$

Definition at line 113 of file fit_mpup.c.

References FMP_ALPHANORM, FMP_ANGLENORM, FMP_LENSSNORM, FMP_POSITNORM, glmlaml, glmlanl, glmlaxlc, glmlaxpup, glmlaylc, and glmlaypup.

Referenced by main().

void model_distMLA int  npup,
double  dpar[],
int  npar,
float  xd[],
float  yd[],
float  rd[]
 

Reconstruct the mpup positions according to the dist. parameters computed from nllsqfit_distMLA.

Note:
Make use of global variables

Definition at line 220 of file fit_mpup.c.

References DISLIN, glmlaml, glmlanl, glmlaxlc, glmlaxpup, glmlaylc, glmlaypup, Plot::Limits, plot_axes(), plot_increase_limits(), plot_initialize(), plot_set_limits(), plot_start(), plot_title(), and Plot::Symbol.

Referenced by main().

double set_geoPSF float  scale  ) 
 

Set the geometric PSF (described by the global (allocated) arrays glIgeo, glXgeo and glSgeo) as a glnggeo -component model from an external ad-hoc analysis (see fit_mpupgeo), for a given spatial scale.

Parameters:
scale spatial scale on CCD (in px)
Returns:
norm of the geometric PSF

Definition at line 354 of file fit_mpup.c.

References GEOPUP3G_I0, GEOPUP3G_I1, GEOPUP3G_S0, GEOPUP3G_S1, GEOPUP3G_X1, GEOPUP5G_I0, GEOPUP5G_I1, GEOPUP5G_I2, GEOPUP5G_S0, GEOPUP5G_S1, GEOPUP5G_S2, GEOPUP5G_X1, GEOPUP5G_X2, GEOPUP7G_I0, GEOPUP7G_I1, GEOPUP7G_I2, GEOPUP7G_I3, GEOPUP7G_S0, GEOPUP7G_S1, GEOPUP7G_S2, GEOPUP7G_S3, GEOPUP7G_X1, GEOPUP7G_X2, GEOPUP7G_X3, glIgeo, glnggeo, glSgeo, and glXgeo.

Referenced by main().

double geoPSF double  x  ) 
 

Geometric PSF profile, according to global parameters.

Definition at line 427 of file fit_mpup.c.

References glIgeo, glnggeo, glSgeo, and glXgeo.

Referenced by main().

long nllsqfit_globalPSF 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 global PSF parameters: glnggeo(>0)-gaussian profile (x) glngpsf(>0)-gaussian global PSF simultaneously adjusted on npup mpups.

To be used with nllsqfit_bnd. Derivatives have been checked.

Note:
Make use of global variables

Bug:
In n_gauss_pup (in SAURON/find_mpup), Is and Ss are ngauss*ngauss (here npsf*npsf) instead of NGGEOPUP*ngauss (here ngeo*npsf)

Definition at line 454 of file fit_mpup.c.

References FMP_IPSFNORM, FMP_XPSFNORM, glIgeo, glnggeo, glngpsf, glpcen, glSgeo, and glXgeo.

Referenced by main().

double globalPSF double  x,
double  psfpar[]
 

Global PSF profile, according to parameters psfpar.

Definition at line 555 of file fit_mpup.c.

References glngpsf.

Referenced by main().

double deconv_globalPSF int  ngpsf,
double  psfpar[],
double  decfac
 

Partial deconvolution of the global PSF.

Parameters:
ngpsf number of gaussian components in global PSF
psfpar description of the global PSF
decfac deconvolution factor (Sdec = Smin*sqrt(decfac))
Returns:
norm of the partially deconvolved global PSF

Definition at line 577 of file fit_mpup.c.

Referenced by main().

double set_corePSF double  psfpar[]  ) 
 

Set the core PSF (described by the global (allocated) arrays glIpsf and glSpsf) as the convolution of the geom. PSF (glnggeo>0 components) and the global PSF (glngpsf>=0 components).

Parameters:
psfpar description of the global PSF (if glngpsf>0)
Returns:
norm of the core PSF

Definition at line 627 of file fit_mpup.c.

References glIgeo, glIpsf, glnggeo, glngpsf, glSgeo, and glSpsf.

Referenced by main().

long nllsqfit_localPSFn 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 local PSF parameters: fixed glnggeo(>0)-gaussian profile (x) fixed glngpsf(>=0)-gaussian global PSF (x) glngloc-gaussian local PSF adjusted on a single mpup.

To be used with nllsqfit_bnd. Derivatives have been checked.

Note:
Make use of global variables

Definition at line 668 of file fit_mpup.c.

References FMP_IPUPNORM, FMP_SPUPNORM, FMP_XPUPNORM, glIpsf, glnggeo, glngloc, glngpsf, glSpsf, and glXgeo.

Referenced by final_mpup().

double final_mpup double  xarr[],
int  npts,
double  start,
double  step,
double  xloc[],
double  dxloc[],
double  xfit[]
 

Final fit (nllsqfit_localPSFn) of the mpup profile.

Parameters:
xarr profile array to be adjusted
npts nb of points in profile
start starting coordinate of the profile
step step of the profile
xloc parameters of the fit (initialized to initial guess)
dxloc error on the parameters
xfit adjusted profile (zero-ed if error)
Returns:
RMS if OK, -status otherwise (as returned by nllsqfit_bnd)
Note:
Make use of global variables

Definition at line 776 of file fit_mpup.c.

References FMP_IPUPNORM, FMP_SPUPNORM, FMP_XPUPNORM, glngloc, and nllsqfit_localPSFn().

Referenced by main().


Variable Documentation

int* glmlaml
 

Definition at line 30 of file fit_mpup.c.

Referenced by main(), model_distMLA(), and nllsqfit_distMLA().

int * glmlanl
 

Definition at line 30 of file fit_mpup.c.

Referenced by main(), model_distMLA(), and nllsqfit_distMLA().

double* glmlaxpup
 

Definition at line 31 of file fit_mpup.c.

Referenced by main(), model_distMLA(), and nllsqfit_distMLA().

double * glmlaypup
 

Definition at line 31 of file fit_mpup.c.

Referenced by main(), model_distMLA(), and nllsqfit_distMLA().

double glmlaxlc
 

Definition at line 32 of file fit_mpup.c.

Referenced by main(), model_distMLA(), and nllsqfit_distMLA().

double glmlaylc
 

Definition at line 32 of file fit_mpup.c.

Referenced by main(), model_distMLA(), and nllsqfit_distMLA().

int glnggeo
 

Definition at line 35 of file fit_mpup.c.

double* glIgeo
 

Definition at line 36 of file fit_mpup.c.

double * glXgeo
 

Definition at line 36 of file fit_mpup.c.

double * glSgeo
 

Definition at line 36 of file fit_mpup.c.

int glngpsf
 

Definition at line 39 of file fit_mpup.c.

double** glIpsf
 

Definition at line 42 of file fit_mpup.c.

double ** glSpsf
 

Definition at line 42 of file fit_mpup.c.

int glngloc
 

Definition at line 45 of file fit_mpup.c.

int* glpcen
 

Definition at line 48 of file fit_mpup.c.

Referenced by main(), and nllsqfit_globalPSF().


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