Main Page | Data Structures | File List | Data Fields | Globals

peakfit.c File Reference


Detailed Description

Author:
Hal Finkel
Peak identification and fitting

#include <math.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <ctype.h>
#include <gsl/gsl_statistics.h>
#include <gsl/gsl_fit.h>
#include <gsl/gsl_vector.h>
#include <gsl/gsl_blas.h>
#include <gsl/gsl_multifit_nlin.h>
#include "common.h"

Include dependency graph for peakfit.c:

Include dependency graph

Data Structures

struct  bg_poly_data
 Data on the background for fitting. More...
struct  peak_pearson7_data
 Data on a peak for fitting. More...

Defines

#define MAXITER   100000
 The maximum number of iterations for fitting peaks and background.
#define MINBGPTS   3
 Mininum number of background points per side.
#define BGWIDTH   2
 The number of peak widths to look for background if possible.
#define SEARCHSTEP   0.1
 Search step for peak bounds.

Functions

void pf_prunepeaks (struct pf_data *d)
 Prune peaks without reasonable fits.
void pf_fitpeaks (struct pf_data *d)
 Fit peaks in the data set.
double pf_bgfunc (struct pf_data *d, int peak, double x)
 Evaluate the background function for a given peak.
double pf_peakfunc (struct pf_data *d, int peak, double x)
 Evaluate the peak fit function for a given peak.
double pf_fitfunc (struct pf_data *d, int peak, double x)
 Evaluate the total fit function for a given peak.

Define Documentation

#define BGWIDTH   2
 

The number of peak widths to look for background if possible.

#define MAXITER   100000
 

The maximum number of iterations for fitting peaks and background.

#define MINBGPTS   3
 

Mininum number of background points per side.

Total from both sides needs to be at least the number of fit parameters

#define SEARCHSTEP   0.1
 

Search step for peak bounds.


Function Documentation

double pf_bgfunc struct pf_data d,
int  peak,
double  x
 

Evaluate the background function for a given peak.

Parameters:
[in] d The data set
[in] peak The peak for which to evalutate the background function
[in] x The value at which to evaluate the function
Returns:
The value of the function

double pf_fitfunc struct pf_data d,
int  peak,
double  x
 

Evaluate the total fit function for a given peak.

Parameters:
[in] d The data set
[in] peak The peak for which to evalutate the total fit function
[in] x The value at which to evaluate the function
Returns:
The value of the function

Here is the call graph for this function:

void pf_fitpeaks struct pf_data d  ) 
 

Fit peaks in the data set.

Parameters:
[in,out] d The data set

double pf_peakfunc struct pf_data d,
int  peak,
double  x
 

Evaluate the peak fit function for a given peak.

Parameters:
[in] d The data set
[in] peak The peak for which to evalutate the peak fit function
[in] x The value at which to evaluate the function
Returns:
The value of the function

void pf_prunepeaks struct pf_data d  ) 
 

Prune peaks without reasonable fits.

Parameters:
[in,out] d The data set


Generated on Sun Feb 20 17:46:40 2005 for peakfinder-0.1 by  doxygen 1.3.9.1