ERIS Pipeline Reference Manual 1.9.2
Data Structures
sc_fwhmest.h File Reference
#include <sc_basic.h>

Go to the source code of this file.

Data Structures

struct  _scxydata_
 
typedef struct _scxydata_ scxydata
 
cpl_error_code sc_fwhmest (double *fwhm, double *rms, cpl_table *spec, cpl_table *lines, const cpl_parameterlist *parlist)
 
int sc_fwhmest_gaussfunc (int n_data, int n_pars, double *p, double *deviates, double **derivs, void *pdata)
 

Detailed Description

Header for continuum interpolation and subtraction routine

Author
Marco Barden, Stefan Noll, & ESO In-Kind Team Innsbruck
Date
12 May 2013

Definition in file sc_fwhmest.h.

Typedef Documentation

◆ scxydata

typedef struct _scxydata_ scxydata

Structure for y(x) fitting

Parameters
xindependent variable of model
ymeasured "y" values
y_errmeasurement uncertainty in y

Function Documentation

◆ sc_fwhmest()

cpl_error_code sc_fwhmest ( double *  fwhm,
double *  rms,
cpl_table *  spec,
cpl_table *  lines,
const cpl_parameterlist *  parlist 
)

Estimate FWHM using isolated lines in spectrum.

This routine estimates the FWHM of the lines in a spectrum based on a set of identified isolated lines. Isolated lines are marked in the line list. Firstly, the FWHM is approximated by the value in the line list. Afterwards, fitting the data with a Gaussian is attempted. If the fitting is successful, this value is preferred over the initial estimate.

The input spectrum has to be a CPL table containing (at least) the following columns:

 lambda
 lflux
 class

The column "class" is expected to contain the following values: 0 = Continuum 1 = Line pixel 2 = Line peak 3 = Isolated line peak

Note
In the case of a wavelength-dependent line width (varfwhm = 1), the output FWHM is provided for the central wavelength of the input spectrum.

INPUT:

Parameters
specspectrum
linesline list
parlistgeneral CPL parameter list

OUTPUT:

Parameters
fwhmFWHM
rmsRMS error for the FWHM estimate

ERRORS:

  • CPL_ERROR_NONE: no error occurred
  • SC_ERROR_NDA: no isolated lines in spectra

Definition at line 49 of file sc_fwhmest.c.

References sc_basic_clipmean(), sc_fwhmest_gaussfunc(), and SC_MAXLEN.

Referenced by sc_skycorr_subcont().

◆ sc_fwhmest_gaussfunc()

int sc_fwhmest_gaussfunc ( int  n_data,
int  n_pars,
double *  p,
double *  deviates,
double **  derivs,
void *  pdata 
)

User function for CMPFIT. Provides error-weighted differences between a model Gaussian and a measured line profile.

INPUT:

Parameters
n_datanumber of data points
n_parsnumber of parameters
parray of fit parameters
derivsderivatives (not used)
pdataprivate data

OUTPUT:

Parameters
deviatesarray of residuals

ERRORS:

  • none

Definition at line 265 of file sc_fwhmest.c.

References sc_basic_gaussfunc().

Referenced by sc_fwhmest().