dwvisser.analysis
Class GaussianFit

java.lang.Object
  |
  +--dwvisser.analysis.NonLinearFit
        |
        +--dwvisser.analysis.GaussianFit

public class GaussianFit
extends NonLinearFit

This abstract class uses NonLinearFit to fit a single gaussian peak with a background.. The background is a polynomial up to a quadradic term if desired. (Channel - Centroid) is the term the polynomial is expanded in.

Version:
0.5, 20 February 2001
Author:
Dale Visser
See Also:
NonLinearFit

Field Summary
static java.lang.String AREA
          name of Parameter--area of peak
static java.lang.String CENTROID
          name of Parameter--centroid of peak
static java.lang.String WIDTH
          name of Parameter--width of peak
 
Fields inherited from class dwvisser.analysis.NonLinearFit
chisq, counts, errors, lm, maxCH, minCH
 
Constructor Summary
GaussianFit(double[] spectrum, double[] errors, int begin, int end, Multiplet m)
          Class constructor.
 
Method Summary
 double derivative(double x, java.lang.String parName)
          Evaluates derivative with respect to parameterName at x.
 void estimate()
          If so requested, estimates A, Area, and Width.
 Multiplet getFitResult()
           
 double valueAt(double x)
          Calculates the gaussian with background at a given x.
 
Methods inherited from class dwvisser.analysis.NonLinearFit
addParameter, calculate, doFit, getParameter, p, setParameter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CENTROID

public static final java.lang.String CENTROID
name of Parameter--centroid of peak

See Also:
Constant Field Values

WIDTH

public static final java.lang.String WIDTH
name of Parameter--width of peak

See Also:
Constant Field Values

AREA

public static final java.lang.String AREA
name of Parameter--area of peak

See Also:
Constant Field Values
Constructor Detail

GaussianFit

public GaussianFit(double[] spectrum,
                   double[] errors,
                   int begin,
                   int end,
                   Multiplet m)
            throws FitException
Class constructor.

Method Detail

estimate

public void estimate()
              throws FitException
If so requested, estimates A, Area, and Width.

Specified by:
estimate in class NonLinearFit
Throws:
FitException - thrown if unrecoverable error occurs during estimation

valueAt

public double valueAt(double x)
Calculates the gaussian with background at a given x.

Specified by:
valueAt in class NonLinearFit
Parameters:
x - value to calculate at
Returns:
value of function at x

derivative

public double derivative(double x,
                         java.lang.String parName)
Evaluates derivative with respect to parameterName at x.

Specified by:
derivative in class NonLinearFit
Parameters:
x - value to evalueate at
parName - the name of the parameter to differentiate with respect to
Returns:
df(x)/d(parameterName) at x

getFitResult

public Multiplet getFitResult()