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

common.h File Reference


Detailed Description

Author:
Hal Finkel
Main peakfinder program

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Data Structures

struct  pf_peak_bg
 Peak background fit. More...
struct  pf_peak_fit
 Peak fit. More...
struct  pf_peak
 Peak data. More...
struct  pf_cal_fit
 Calibration fit. More...
struct  pf_cal_pt
 Calibration point. More...
struct  pf_cal_pts
 Calibration points. More...
struct  pf_data
 Data set. More...
struct  pf_plot_params
 Plot parameters. More...

Defines

#define NCHAN   4096
 The maximum number of channels in the data set.
#define MAXCALPTS   1024
 The maximum number of calibration points.
#define MAXUNIT   256
 The maximum length of a calibration unit string.

Enumerations

enum  pf_peak_sort { sort_number, sort_height, sort_area }
 Peak sort type. More...

Functions

int pf_parse_command (char *command)
 Parse a command string.
int pf_loaddata (char *fn, struct pf_data *d)
 Load data from a file.
double pf_chanwindowavg (double *data, int ds, int ci, int ac)
 Compute the average counts per bin over some window.
void pf_plotdata (struct pf_data *d, struct pf_plot_params *p, struct pf_cal_fit *cal)
 Plot data.
void pf_plotpeak (struct pf_data *d, struct pf_plot_params *p, struct pf_cal_fit *cal)
 Plot a given peak.
int pf_printdata (struct pf_data *d, char *fn, int norm)
 Print the data set.
int pf_printpeaks (struct pf_data *d, char *fn, enum pf_peak_sort srt)
 Print the peaks.
int pf_printpeak (struct pf_data *d, struct pf_cal_fit *cal, int peak, char *fn)
 Print data about a given peak.
int pf_printcal (struct pf_data *d, struct pf_cal_fit *f, char *fn)
 Print data about the calibration fit.
void pf_fitpeaks (struct pf_data *d)
 Fit peaks in the data set.
void pf_prunepeaks (struct pf_data *d)
 Prune peaks without reasonable fits.
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.
int pf_calibrate (struct pf_data *d, struct pf_cal_fit *f, char *fn)
 Calibrate input using known data points.
double pf_calfunc (struct pf_cal_fit *f, double ch)
 Evaluate the calibration fit function for a given peak.


Define Documentation

#define MAXCALPTS   1024
 

The maximum number of calibration points.

#define MAXUNIT   256
 

The maximum length of a calibration unit string.

#define NCHAN   4096
 

The maximum number of channels in the data set.


Enumeration Type Documentation

enum pf_peak_sort
 

Peak sort type.

Enumeration values:
sort_number  Sort by peak number.
sort_height  Sort by peak height.
sort_area  Sort by peak area.


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_calfunc struct pf_cal_fit f,
double  ch
 

Evaluate the calibration fit function for a given peak.

Parameters:
[in] f The calibration fit
[in] ch The value at which to evaluate the function
Returns:
The value of the function

int pf_calibrate struct pf_data d,
struct pf_cal_fit f,
char *  fn
 

Calibrate input using known data points.

Parameters:
[in] d The data set
[out] f The calibration fit
[in] fn The file containing the calibration points
Returns:
Boolean success flag

double pf_chanwindowavg double *  data,
int  ds,
int  ci,
int  ac
 

Compute the average counts per bin over some window.

Parameters:
[in] data The data array
[in] ds The size of the data array
[in] ci The center of the window
[in] ac The size of the window
Returns:
The average over the window

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

int pf_loaddata char *  fn,
struct pf_data d
 

Load data from a file.

Parameters:
[in] fn The file name
[out] d The data set
Returns:
Boolean status flag

Here is the call graph for this function:

int pf_parse_command char *  command  ) 
 

Parse a command string.

Parameters:
[in] command The command to parse and execute
Returns:
Status code

Here is the call graph for this function:

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_plotdata struct pf_data d,
struct pf_plot_params p,
struct pf_cal_fit cal
 

Plot data.

Parameters:
[in] d The data set
[in] p The plotting parameters
[in] cal The calibration fit

Here is the call graph for this function:

void pf_plotpeak struct pf_data d,
struct pf_plot_params p,
struct pf_cal_fit cal
 

Plot a given peak.

Parameters:
[in] d The data set
[in] p The plotting parameters
[in] cal The calibration fit

Here is the call graph for this function:

int pf_printcal struct pf_data d,
struct pf_cal_fit f,
char *  fn
 

Print data about the calibration fit.

Parameters:
[in] d The data set
[in] f The calibration fit
[in] fn The output file name
Returns:
Boolean status flag

int pf_printdata struct pf_data d,
char *  fn,
int  norm
 

Print the data set.

Parameters:
[in] d The data set
[in] fn The output file name
[in] norm Flag indicating whether to print normalized data
Returns:
Boolean status flag

int pf_printpeak struct pf_data d,
struct pf_cal_fit cal,
int  peak,
char *  fn
 

Print data about a given peak.

Parameters:
[in] d The data set
[in] cal The calibration fit
[in] peak The peak about which to print data
[in] fn The output file name
Returns:
Boolean status flag

Here is the call graph for this function:

int pf_printpeaks struct pf_data d,
char *  fn,
enum pf_peak_sort  srt
 

Print the peaks.

Parameters:
[in] d The data set
[in] fn The output file name
[in] srt Peak sort type
Returns:
Boolean status flag

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:31 2005 for peakfinder-0.1 by  doxygen 1.3.9.1