public class Gaussian
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
AMP
The "amplitude" parameter
|
static java.lang.String |
CENTER
The "center" parameter
|
static java.lang.String |
PEDESTAL
The "pedestal" parameter
|
static java.lang.String |
SIGMA
The "sigma" parameter
|
Constructor and Description |
---|
Gaussian()
Creates a new instance of Gaussian
|
Modifier and Type | Method and Description |
---|---|
void |
addData(double x,
double y)
Adds a data point to the internal data
|
void |
addData(double x,
double y,
double y_err)
Adds a data point to the internal data
|
void |
clear()
Removes all internal data
|
boolean |
fit()
perform one step of the data fit
|
boolean |
fit(int iteration)
perform the data fit
|
boolean |
fitParameter(java.lang.String key)
Returns the boolean vaiable about including variable into the fitting
|
void |
fitParameter(java.lang.String key,
boolean incl)
Includes or excludes the parameter into fitting
|
double |
getParameter(java.lang.String key)
Returns the parameter value
|
double |
getParameterError(java.lang.String key)
Returns the parameter value error
|
double |
getValue(double x)
Returns the value of Gaussian function
|
boolean |
guessAndFit()
Finds the parameters of Gaussian with initial values defined from raw data
|
boolean |
guessAndFit(int iteration)
Perform the several iterations of the data fit with guessing the initial
values of parameters
|
static void |
main(java.lang.String[] args)
MAIN for debugging
|
void |
setData(double[] x_arr,
double[] y_arr)
Sets the data attribute of the Gaussian object
|
void |
setData(double[] x_arr,
double[] y_arr,
double[] y_err_arr)
Sets the data attribute of the Gaussian object
|
void |
setParameter(java.lang.String key,
double val)
Sets the parameter value
|
public static java.lang.String SIGMA
public static java.lang.String AMP
public static java.lang.String CENTER
public static java.lang.String PEDESTAL
public double getParameter(java.lang.String key)
key
- The parameter namepublic double getParameterError(java.lang.String key)
key
- The parameter namepublic void fitParameter(java.lang.String key, boolean incl)
key
- The parameter nameincl
- The boolean vaiable about including variable into the fittingpublic boolean fitParameter(java.lang.String key)
key
- The parameter namepublic void setParameter(java.lang.String key, double val)
key
- The parameter nameval
- The new parameter valuepublic void setData(double[] x_arr, double[] y_arr, double[] y_err_arr)
y_arr
- Y data arrayy_err_arr
- Y values error arrayx_arr
- The new data valuepublic void setData(double[] x_arr, double[] y_arr)
y_arr
- Y data arrayx_arr
- The new data valuepublic void clear()
public void addData(double x, double y)
x
- The x valuey
- The y valuepublic void addData(double x, double y, double y_err)
x
- The x valuey
- The y valuy_err
- The error of the y valuepublic boolean fit(int iteration)
iteration
- The number of iterationspublic boolean fit()
public boolean guessAndFit(int iteration)
iteration
- The number of iterationspublic boolean guessAndFit()
public double getValue(double x)
x
- The x-valuepublic static void main(java.lang.String[] args)
args
- The array of strings as parameters