QtiPlot 0.9.7.3
|
#include <MultiPeakFit.h>
Public Types | |
enum | PeakProfile { Gauss, Lorentz } |
Public Member Functions | |
void | enablePeakCurves (bool on) |
virtual double | eval (double *par, double x) |
Calculates the data for the output fit curve. | |
double | evalPeak (double *par, double x, int peak) |
void | guessInitialValues () |
Used by the GaussFit and LorentzFit derived classes to calculate initial values for the parameters. | |
MultiPeakFit (ApplicationWindow *parent, Graph *g=0, PeakProfile profile=Gauss, int peaks=1) | |
MultiPeakFit (ApplicationWindow *parent, QwtPlotCurve *c, PeakProfile profile=Gauss, int peaks=1) | |
MultiPeakFit (ApplicationWindow *parent, Table *t, const QString &xCol, const QString &yCol, int startRow=0, int endRow=-1, PeakProfile profile=Gauss, int peaks=1) | |
int | peaks () |
PeakProfile | profile () |
void | setNumPeaks (int n) |
void | setPeakCurvesColor (int colorIndex) |
void | setPeakCurvesColor (const QColor &color) |
Static Public Member Functions | |
static QStringList | generateExplanationList (int order) |
static QString | generateFormula (int order, PeakProfile profile) |
static QStringList | generateParameterList (int order) |
Private Member Functions | |
void | customizeFitResults () |
Customs and stores the fit results according to the derived class specifications. Used by exponential fits. | |
void | generateFitCurve () |
Adds the result curve to the plot. | |
void | init (int) |
void | insertPeakFunctionCurve (int peak) |
Inserts a peak function curve into the plot. | |
QString | logFitInfo (int iterations, int status) |
Output string added to the result log. | |
Static Private Member Functions | |
static QString | peakFormula (int peakIndex, PeakProfile profile) |
Private Attributes | |
int | d_peaks |
Number of peaks. | |
QColor | d_peaks_color |
Color for the peak curves. | |
PeakProfile | d_profile |
The peak profile. | |
bool | generate_peak_curves |
Tells weather the peak curves should be displayed together with the best line fit. |
MultiPeakFit::MultiPeakFit | ( | ApplicationWindow * | parent, |
QwtPlotCurve * | c, | ||
PeakProfile | profile = Gauss , |
||
int | peaks = 1 |
||
) |
References Fit::init().
MultiPeakFit::MultiPeakFit | ( | ApplicationWindow * | parent, |
Graph * | g = 0 , |
||
PeakProfile | profile = Gauss , |
||
int | peaks = 1 |
||
) |
References Fit::init().
MultiPeakFit::MultiPeakFit | ( | ApplicationWindow * | parent, |
Table * | t, | ||
const QString & | xCol, | ||
const QString & | yCol, | ||
int | startRow = 0 , |
||
int | endRow = -1 , |
||
PeakProfile | profile = Gauss , |
||
int | peaks = 1 |
||
) |
References Fit::init().
void MultiPeakFit::customizeFitResults | ( | ) | [private, virtual] |
Customs and stores the fit results according to the derived class specifications. Used by exponential fits.
Reimplemented from Fit.
References d_peaks, and Fit::d_results.
Referenced by generateFitCurve().
void MultiPeakFit::enablePeakCurves | ( | bool | on | ) | [inline] |
References generate_peak_curves.
Referenced by FitDialog::initBuiltInFunctions(), and MultiPeakFitTool::MultiPeakFitTool().
double MultiPeakFit::eval | ( | double * | , |
double | |||
) | [virtual] |
Calculates the data for the output fit curve.
Reimplemented from Fit.
References Fit::d_p, d_peaks, evalPeak(), and Filter::y().
double MultiPeakFit::evalPeak | ( | double * | par, |
double | x, | ||
int | peak | ||
) |
QStringList MultiPeakFit::generateExplanationList | ( | int | order | ) | [static] |
References peaks().
Referenced by setNumPeaks().
void MultiPeakFit::generateFitCurve | ( | ) | [private, virtual] |
Adds the result curve to the plot.
Reimplemented from Fit.
References Graph::addFitCurve(), Filter::createOutputGraph(), customizeFitResults(), Filter::d_curve, Filter::d_curveColor, Filter::d_explanation, Fit::d_gen_function, Filter::d_graphics_display, Filter::d_n, Filter::d_output_graph, Fit::d_p, d_peaks, d_peaks_color, Filter::d_points, Filter::d_prec, d_profile, Filter::d_result_table, Fit::d_results, Filter::d_x, Filter::d_y_col_name, Gauss, generate_peak_curves, ApplicationWindow::generateUniqueName(), Fit::insertFitFunctionCurve(), insertPeakFunctionCurve(), Graph::insertPlotItem(), Graph::Line, Filter::memoryErrorMessage(), ApplicationWindow::newHiddenTable(), Table::setHeader(), and Table::setText().
QString MultiPeakFit::generateFormula | ( | int | order, |
PeakProfile | profile | ||
) | [static] |
References Fit::formula(), Gauss, Lorentz, peakFormula(), and peaks().
Referenced by setNumPeaks().
QStringList MultiPeakFit::generateParameterList | ( | int | order | ) | [static] |
References peaks().
Referenced by setNumPeaks().
void MultiPeakFit::guessInitialValues | ( | ) | [virtual] |
Used by the GaussFit and LorentzFit derived classes to calculate initial values for the parameters.
Reimplemented from Fit.
References Filter::d_n, Fit::d_param_init, d_peaks, d_profile, Filter::d_x, Filter::d_y, and Lorentz.
void MultiPeakFit::init | ( | int | peaks | ) | [private] |
References Fit::d_df, Fit::d_f, Fit::d_fdf, Fit::d_fsimplex, d_peaks_color, d_profile, Gauss, gauss_multi_peak_d(), gauss_multi_peak_df(), gauss_multi_peak_f(), gauss_multi_peak_fdf(), generate_peak_curves, lorentz_multi_peak_d(), lorentz_multi_peak_df(), lorentz_multi_peak_f(), lorentz_multi_peak_fdf(), and setNumPeaks().
void MultiPeakFit::insertPeakFunctionCurve | ( | int | peak | ) | [private] |
Inserts a peak function curve into the plot.
References Graph::addFitCurve(), Graph::curveNamesList(), Filter::d_curve, Filter::d_from, Filter::d_output_graph, Fit::d_p, Fit::d_param_names, d_peaks_color, Filter::d_points, d_profile, Fit::d_results, Filter::d_to, Graph::insertPlotItem(), Graph::Line, FunctionCurve::loadData(), FunctionCurve::Normal, peakFormula(), FunctionCurve::setConstant(), FunctionCurve::setFormula(), and FunctionCurve::setRange().
Referenced by generateFitCurve().
QString MultiPeakFit::logFitInfo | ( | int | iterations, |
int | status | ||
) | [private, virtual] |
Output string added to the result log.
Reimplemented from Fit.
References d_peaks, Filter::d_prec, d_profile, Fit::d_results, and Lorentz.
QString MultiPeakFit::peakFormula | ( | int | peakIndex, |
PeakProfile | profile | ||
) | [static, private] |
References Fit::formula(), Gauss, and Lorentz.
Referenced by generateFormula(), and insertPeakFunctionCurve().
int MultiPeakFit::peaks | ( | ) | [inline] |
References d_peaks.
Referenced by generateExplanationList(), generateFormula(), and generateParameterList().
PeakProfile MultiPeakFit::profile | ( | ) | [inline] |
References d_profile.
void MultiPeakFit::setNumPeaks | ( | int | n | ) |
References Filter::d_explanation, Fit::d_formula, Fit::d_p, Fit::d_param_explain, Fit::d_param_names, d_peaks, d_profile, Fit::freeWorkspace(), Gauss, generateExplanationList(), generateFormula(), generateParameterList(), and Fit::initWorkspace().
Referenced by init().
void MultiPeakFit::setPeakCurvesColor | ( | int | colorIndex | ) |
References d_peaks_color, and ColorBox::defaultColor().
Referenced by FitDialog::initBuiltInFunctions(), and MultiPeakFitTool::MultiPeakFitTool().
void MultiPeakFit::setPeakCurvesColor | ( | const QColor & | color | ) | [inline] |
References d_peaks_color.
int MultiPeakFit::d_peaks [private] |
Number of peaks.
Referenced by customizeFitResults(), eval(), generateFitCurve(), guessInitialValues(), logFitInfo(), peaks(), and setNumPeaks().
QColor MultiPeakFit::d_peaks_color [private] |
Color for the peak curves.
Referenced by generateFitCurve(), init(), insertPeakFunctionCurve(), and setPeakCurvesColor().
PeakProfile MultiPeakFit::d_profile [private] |
The peak profile.
Referenced by evalPeak(), generateFitCurve(), guessInitialValues(), init(), insertPeakFunctionCurve(), logFitInfo(), profile(), and setNumPeaks().
bool MultiPeakFit::generate_peak_curves [private] |
Tells weather the peak curves should be displayed together with the best line fit.
Referenced by enablePeakCurves(), generateFitCurve(), and init().