Package cnuphys.splot.fit
Class Fit
java.lang.Object
cnuphys.splot.fit.Fit
General Fit container class. It holds all the information for a fit, but the
 actual fit is performed by the object held in the 
_fit instance
 variable, which is a numerical recipes fit object.- Author:
- heddle
- 
Nested Class SummaryNested Classes
- 
Constructor SummaryConstructorsConstructorDescriptionFit()Fit(double[] x, double[] y, double[] sigmaY) Fit(double[] x, double[] y, double[] sigmaY, double tolerance) Create a fit which is someone poorly named.Fit(double[] x, double[] y, double[] sigmaX, double[] sigmaY, double tolerance) Create a fit which is someone poorly named.
- 
Method SummaryModifier and TypeMethodDescriptionGet the error type that was used in the fittinggetFit()Returns the fit object, which is most likely a numerical recipes fitgetFitString(DataColumn curve) Get a report on the fit parameters in htmlGet the fit typegetHolds()Get the fit parameter holdsintGet the number of gaussiansintGet the polynomial order, the polynomial order--the power of the highest powerdouble[]Get the x error data for the fitdouble[]Get the y error data for the fitdoubleGet the tolerancedouble[]getX()Get the x data for the fitdouble[]getY()Get the y data for the fitvoidhold(int index, double val) Set a hold on a fit parameter.booleanisDirty()Check whether fit needs to be recomputedbooleanisHeld(int index) Check whether a parameter was heldstatic voidvoidsetDirty()Set the fit to be dirty.protected voidsetErrorType(Fit.ErrorType errorType) Set the error type used by the fitting.voidSet the fitvoidsetFitType(FitType type) Set the fit typevoidsetNumGaussian(int numGauss) Set the number of gaussiansvoidsetPolynomialOrder(int order) Get the polynomial order--the power of the highest powervoidsetSigmaX(double[] sigma) Set the x error data for the fitvoidsetSigmaY(double[] sigma) Set the y error data for the fitvoidsetTolerance(double tolerance) Set the tolerancevoidsetX(double[] x) Set the x data for the fitvoidsetY(double[] y) Set the y data for the fitintsize()The x and y data arrays should be the same size.
- 
Constructor Details- 
Fitpublic Fit()
- 
Fitpublic Fit(double[] x, double[] y, double[] sigmaY) 
- 
Fitpublic Fit(double[] x, double[] y, double[] sigmaY, double tolerance) Create a fit which is someone poorly named. It is really just a container that holds all the data for a fit. It will be used in the constructor of an actual fit.- Parameters:
- x- the x data
- y- the y data
- sigmaY- the y errors
- tolerance- accuracy parameter (for nonlinear fits)
 
- 
Fitpublic Fit(double[] x, double[] y, double[] sigmaX, double[] sigmaY, double tolerance) Create a fit which is someone poorly named. It is really just a container that holds all the data for a fit. It will be used in the constructor of an actual fit.- Parameters:
- x- the x data
- y- the y data
- sigmaX- the x errors
- sigmaY- the y errors
- tolerance- accuracy parameter (for nonlinear fits)
 
 
- 
- 
Method Details- 
sizepublic int size()The x and y data arrays should be the same size. This returns the smaller of the two sizes.- Returns:
- the minimum size of the data arrays
 
- 
holdpublic void hold(int index, double val) Set a hold on a fit parameter. If there already is one it will be overwritten using the new value.- Parameters:
- index- the index of the parameter
- val- the value at which the parameter is held.
 
- 
getHoldsGet the fit parameter holds- Returns:
- the fit parameter holds
 
- 
isHeldpublic boolean isHeld(int index) Check whether a parameter was held- Parameters:
- index- the index of the parameter
- Returns:
- trueif the index was held
 
- 
getXpublic double[] getX()Get the x data for the fit- Returns:
- the x data for the fit
 
- 
getYpublic double[] getY()Get the y data for the fit- Returns:
- the y data for the fit
 
- 
getSigmaYpublic double[] getSigmaY()Get the y error data for the fit- Returns:
- the y error data for the fit
 
- 
getSigmaXpublic double[] getSigmaX()Get the x error data for the fit- Returns:
- the x error data for the fit
 
- 
setXpublic void setX(double[] x) Set the x data for the fit- Parameters:
- x- the x data
 
- 
setYpublic void setY(double[] y) Set the y data for the fit- Parameters:
- y- the y data
 
- 
setSigmaYpublic void setSigmaY(double[] sigma) Set the y error data for the fit- Parameters:
- sigma- the y error data
 
- 
setSigmaXpublic void setSigmaX(double[] sigma) Set the x error data for the fit- Parameters:
- sigma- the x error data
 
- 
setErrorTypeSet the error type used by the fitting. The client does no set this, the methods that call the fits in FitUtilities set this. If the type is "Massaged zeroes" it meant that error of zero were given fake fakes (equal to the mean error) to prevent the fits from failing.- Parameters:
- errorType- the way the errors were used.
 
- 
getErrorTypeGet the error type that was used in the fitting- Returns:
- the error type that was used in the fitting
 
- 
setPolynomialOrderpublic void setPolynomialOrder(int order) Get the polynomial order--the power of the highest power- Parameters:
- order- the polynomial order--the power of the highest power
 
- 
getPolynomialOrderpublic int getPolynomialOrder()Get the polynomial order, the polynomial order--the power of the highest power- Returns:
- the polynomial order
 
- 
getNumGaussianpublic int getNumGaussian()Get the number of gaussians- Returns:
- the number of gaussians
 
- 
setNumGaussianpublic void setNumGaussian(int numGauss) Set the number of gaussians- Parameters:
- numGauss- the new number of gaussians
 
- 
setTolerancepublic void setTolerance(double tolerance) Set the tolerance- Parameters:
- tolerance- the value of the tolerance
 
- 
getTolerancepublic double getTolerance()Get the tolerance- Returns:
- the tolerance
 
- 
getFitReturns the fit object, which is most likely a numerical recipes fit- Returns:
- the fit object.
 
- 
setFitSet the fit- Parameters:
- fit- the new fit object, which is most likely a numerical recipes fit
 
- 
setDirtypublic void setDirty()Set the fit to be dirty. Perhaps more data have been added
- 
isDirtypublic boolean isDirty()Check whether fit needs to be recomputed- Returns:
- trueif fit must be recomputed
 
- 
getFitTypeGet the fit type- Returns:
- the fit type
 
- 
setFitTypeSet the fit type- Parameters:
- type- the fit type
 
- 
getFitStringGet a report on the fit parameters in html- Parameters:
- curve- the active curve
- Returns:
- the html fit string description
 
- 
main
 
-