OPERA  1.0
Open source echelle spectrograph reduction pipeline
operaFit.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void operaLMFitPolynomial (unsigned m_dat, double *x, double *y, int n_par, double par[], double *chi2, int verbose)
void operaLMFitGaussian (unsigned m_dat, double *x, double *y, double *a, double *x0, double *sig, double *chi2, int verbose)
 This function performs Gaussian Fitting using the Levenberg-Marquardt method.
void operaLMFit2DPolynomial (unsigned m_dat, double *x, double *y, double *fxy, int n_par, double par[], double *chi2, int verbose)
void operaLMFit2DGaussian (unsigned m_dat, double *x, double *y, double *fxy, double *a, double *x0, double *y0, double *sigx, double *sigy, double *chi2, int verbose)
 This function performs 2D Gaussian Fitting using the Levenberg-Marquardt method.
void operaFitSpline (unsigned nin, float *xin, float *yin, unsigned nout, float *xout, float *yout)
 This function performs interpolation of an input array using a sufficiently smooth piecewise-polynomial function (cubic spline)
void operaFit2DSpline (unsigned nxin, float *xin, unsigned nyin, float *yin, double *fxyin, unsigned nxout, float *xout, unsigned nyout, float *yout, float *fxyout)
 This function performs interpolation of an input 2D-array using a sufficiently smooth piecewise-polynomial function (cubic spline)
void spline (float x[], float y[], int n, float yp1, float ypn, float y2[])
void splint (float xa[], float ya[], float y2a[], int n, float x, float *y)
void splin2 (float x1a[], float x2a[], float **ya, float **y2a, int m, int n, float x1, float x2, float *y)
void splie2 (float x1a[], float x2a[], float **ya, int m, int n, float **y2a)
void operaMedfit (float xin[], float yin[], int ndata, float *a, float *b, float *abdev)
 This function performs robust linear fit: f(x) = a + b*x.
float rofunc (float b)
 This function ...
float select_nr (unsigned long k, unsigned long n, float arr[])
 This function ...
float ** matrix (long nrl, long nrh, long ncl, long nch)
void free_matrix (float **m, long nrl, long nrh, long ncl, long nch)
float * vector (long nl, long nh)
 This function allocates a float vector with subscript range v[nl..nh].
void free_vector (float *v, long nl, long nh)
 This function frees a float vector allocated with vector().
void nrerror (char error_text[])

Function Documentation

void free_matrix ( float **  m,
long  nrl,
long  nrh,
long  ncl,
long  nch 
)
void free_vector ( float *  v,
long  nl,
long  nh 
)

This function frees a float vector allocated with vector().

fvoid free_vector(float *v, long nl, long nh)

Parameters:
vis a double pointer that ..,
nlis a long that ..,
nhis a long that ..,
Returns:
void
float** matrix ( long  nrl,
long  nrh,
long  ncl,
long  nch 
)

Here is the call graph for this function:

void nrerror ( char  error_text[])
void operaFit2DSpline ( unsigned  nxin,
float *  xin,
unsigned  nyin,
float *  yin,
double *  fxyin,
unsigned  nxout,
float *  xout,
unsigned  nyout,
float *  yout,
float *  fxyout 
)

This function performs interpolation of an input 2D-array using a sufficiently smooth piecewise-polynomial function (cubic spline)

void operaFitSpline(unsigned nin, float *xin,float *yin, unsigned nout, float *xout, float *yout)

Parameters:
nxinis an unsigned for the number of x input data points
xinis a float array for the input x data points
nyinis an unsigned for the number of y input data points
yinis a float array for the input y data points
fxyinis a float array for the input fxy data points
nxoutis an unsigned for the number of x output data points.
xoutis a float array for the output x data points, which should be provided.
nyoutis an unsigned for the number of y output data points.
youtis a float array for the output y data points, which should be provided.
fxyoutis a float array for the output interpolated fxy data points, which is calculated
Returns:
void

Here is the call graph for this function:

void operaFitSpline ( unsigned  nin,
float *  xin,
float *  yin,
unsigned  nout,
float *  xout,
float *  yout 
)

This function performs interpolation of an input array using a sufficiently smooth piecewise-polynomial function (cubic spline)

void operaFitSpline(unsigned nin, float *xin,float *yin, unsigned nout, float *xout, float *yout)

Parameters:
ninis an unsigned for the number of input data points
xinis a float array for the input x data points
yinis a float array for the input y data points
noutis an unsigned for the number of output data points
xoutis a float array for the output x data points, which should be provided.
youtis a float array for the output interpolated y data points, which is calculated
Returns:
void

Here is the call graph for this function:

void operaLMFit2DGaussian ( unsigned  m_dat,
double *  x,
double *  y,
double *  fxy,
double *  a,
double *  x0,
double *  y0,
double *  sigx,
double *  sigy,
double *  chi2,
int  verbose 
)

This function performs 2D Gaussian Fitting using the Levenberg-Marquardt method.

void operaLMFit2DGaussian(unsigned m_dat, double *x, double *y, double *fxy, double *a, double *x0, double *y0, double *sigx, double *sigy, double *chi2, int verbose)

Parameters:
m_datis an unsigned for the number of data points
xis a double pointer with x data values
yis a double pointer with y data values
ais a double pointer for the amplitude of the Gaussian
x0is a double pointer for the x-center of the Gaussian
y0is a double pointer for the y-center of the Gaussian
sigxis a double pointer for the spread of the Gaussian in the x-direction
sigyis a double pointer for the spread of the Gaussian in the y-direction
chi2is a double pointer that returns the reduced chi-square of the fit
verboseis an int that controls print option: 1=on, 0=off
Returns:
void

Here is the call graph for this function:

void operaLMFit2DPolynomial ( unsigned  m_dat,
double *  x,
double *  y,
double *  fxy,
int  n_par,
double  par[],
double *  chi2,
int  verbose 
)
void operaLMFitGaussian ( unsigned  m_dat,
double *  x,
double *  y,
double *  a,
double *  x0,
double *  sig,
double *  chi2,
int  verbose 
)

This function performs Gaussian Fitting using the Levenberg-Marquardt method.

void operaLMFitGaussian(unsigned m_dat, double *x, double *y, double *a, double *x0, double *sig, double *chi2, int verbose)

Parameters:
m_datis an unsigned for the number of data points
xis a double pointer with x data values
yis a double pointer with y data values
ais a double pointer for the amplitude of the Gaussian
x0is a double pointer for the center of the Gaussian
sigis a double pointer for the spread of the Gaussian
chi2is a double pointer that returns the reduced chi-square of the fit
verboseis an int that controls print option: 1=on, 0=off
Returns:
void

Here is the call graph for this function:

void operaLMFitPolynomial ( unsigned  m_dat,
double *  x,
double *  y,
int  n_par,
double  par[],
double *  chi2,
int  verbose 
)
void operaMedfit ( float  xin[],
float  yin[],
int  ndata,
float *  a,
float *  b,
float *  abdev 
)

This function performs robust linear fit: f(x) = a + b*x.

void operaMedfit(float xin[], float yin[], int ndata, float *a, float *b, float *abdev)

Parameters:
xinis a float array with data values
yinis a float array with data values
ndatais an int for the number of data points
ais a double pointer for the linear coefficient
bis a double pointer for the angular coefficient
abdevis a double pointer for the absolute deviation (~chi-square)
Returns:
void

Here is the call graph for this function:

float rofunc ( float  b)

This function ...

float rofunc(float b)

Parameters:
bis a double that ..,
Returns:
float

Here is the call graph for this function:

float select_nr ( unsigned long  k,
unsigned long  n,
float  arr[] 
)

This function ...

float select_nr(unsigned long k, unsigned long n, float arr[])

Parameters:
kis an unsigned long that ..,
nis an unsigned long that ..,
arris a double pointer that ..,
Returns:
float
void splie2 ( float  x1a[],
float  x2a[],
float **  ya,
int  m,
int  n,
float **  y2a 
)

Here is the call graph for this function:

void splin2 ( float  x1a[],
float  x2a[],
float **  ya,
float **  y2a,
int  m,
int  n,
float  x1,
float  x2,
float *  y 
)

Here is the call graph for this function:

void spline ( float  x[],
float  y[],
int  n,
float  yp1,
float  ypn,
float  y2[] 
)

Here is the call graph for this function:

void splint ( float  xa[],
float  ya[],
float  y2a[],
int  n,
float  x,
float *  y 
)

Here is the call graph for this function:

float* vector ( long  nl,
long  nh 
)

This function allocates a float vector with subscript range v[nl..nh].

float *vector(long nl, long nh)

Parameters:
nlis a long that ..,
nhis a long that ..,
Returns:
float