SciDAVis
1.D4
|
Abstract base class for data analysis operations. More...
#include <Filter.h>
Public Member Functions | |
int | dataSize () |
Returns the size of the fitted data set. | |
bool | error () |
Filter (ApplicationWindow *parent, Table *t=0, const char *name=0) | |
Filter (ApplicationWindow *parent, Graph *g=0, const char *name=0) | |
virtual QString | legendInfo () |
Output string added to the plot as a new legend. | |
virtual bool | run () |
Actually does the job. Should be reimplemented in derived classes. | |
void | setColor (int colorId) |
Sets the color of the output fit curve. | |
void | setColor (const QString &colorName) |
Sets the color of the output fit curve. Provided for convenience. To be used in scripts only! | |
virtual void | setDataCurve (int curve, double start, double end) |
bool | setDataFromCurve (const QString &curveTitle, Graph *g=0) |
bool | setDataFromCurve (const QString &curveTitle, double from, double to, Graph *g=0) |
void | setInterval (double from, double to) |
Changes the data range if the source curve was already assigned. Provided for convenience. | |
void | setMaximumIterations (int iter) |
Sets the maximum number of iterations to be performed during an iterative session. | |
void | setOutputPoints (int points) |
Sets the number of points in the output curve. | |
void | setOutputPrecision (int digits) |
Sets the precision used for the output. | |
void | setTolerance (double eps) |
Sets the tolerance used by the GSL routines. | |
virtual void | showLegend () |
Adds a new legend to the plot. Calls virtual legendInfo() | |
~Filter () |
Protected Member Functions | |
QwtPlotCurve * | addResultCurve (double *x, double *y) |
Adds the result curve to the target output plot window. Creates a hidden table and frees the input data from memory. | |
virtual void | calculateOutputData (double *X, double *Y) |
Calculates the data for the output curve and store it in the X an Y vectors. | |
int | curveIndex (const QString &curveTitle, Graph *g) |
Performs checks and returns the index of the source data curve if OK, -1 otherwise. | |
virtual bool | isDataAcceptable () |
virtual QString | logInfo () |
Output string added to the log pannel of the application. | |
virtual void | output () |
Performs the data analysis and takes care of the output. |
Protected Attributes | |
QwtPlotCurve * | d_curve |
The curve to be analysed. | |
int | d_curveColorIndex |
Color index of the result curve. | |
QString | d_explanation |
String explaining the operation in the comment of the result table and in the project explorer. | |
double | d_from |
Data interval. | |
Graph * | d_graph |
The graph where the result curve should be displayed. | |
bool | d_init_err |
Error flag telling if something went wrong during the initialization phase. | |
int | d_max_iterations |
Maximum number of iterations per fit. | |
int | d_min_points |
Minimum number of data points necessary to perform the operation. | |
int | d_n |
Size of the data arrays. | |
int | d_points |
Number of result points to de calculated and displayed in the output curve. | |
int | d_prec |
Precision (number of significant digits) used for the results output. | |
bool | d_sort_data |
Specifies if the filter needs sorted data as input. | |
Table * | d_table |
A table source of data. | |
double | d_to |
double | d_tolerance |
GSL Tolerance, if ever needed... | |
double * | d_x |
x data set to be analysed | |
double * | d_y |
y data set to be analysed |
Private Member Functions | |
int | curveData (QwtPlotCurve *c, double start, double end, double **x, double **y) |
Sets x and y to the curve points between start and end. | |
void | init () |
int | sortedCurveData (QwtPlotCurve *c, double start, double end, double **x, double **y) |
Same as curveData, but sorts the points by their x value. |
Abstract base class for data analysis operations.
Filter::Filter | ( | ApplicationWindow * | parent, |
Table * | t = 0 , |
||
const char * | name = 0 |
||
) |
Filter::Filter | ( | ApplicationWindow * | parent, |
Graph * | g = 0 , |
||
const char * | name = 0 |
||
) |
|
protected |
Adds the result curve to the target output plot window. Creates a hidden table and frees the input data from memory.
References ColorBox::color(), d_curve, d_curveColorIndex, d_explanation, d_graph, d_points, ApplicationWindow::generateUniqueName(), Graph::insertPlotItem(), Graph::Line, AbstractAspect::name(), ApplicationWindow::newHiddenTable(), SciDAVis::Numeric, Column::setPlotDesignation(), Column::setValueAt(), Graph::updatePlot(), SciDAVis::X, and SciDAVis::Y.
Referenced by Fit::generateFitCurve(), and output().
|
inlineprotectedvirtual |
Calculates the data for the output curve and store it in the X an Y vectors.
Reimplemented in FFTFilter, SmoothFilter, and Interpolation.
Referenced by output().
|
private |
Sets x and y to the curve points between start and end.
Referenced by setDataCurve().
|
protected |
Performs checks and returns the index of the source data curve if OK, -1 otherwise.
References Graph::curveIndex(), d_graph, and d_init_err.
Referenced by setDataFromCurve().
|
inline |
Returns the size of the fitted data set.
References d_n.
|
inline |
|
private |
Reimplemented in GaussAmpFit, GaussFit, LorentzFit, ThreeExpFit, LinearFit, TwoExpFit, Integration, PolynomialFit, FFT, NonLinearFit, PluginFit, ExponentialFit, SigmoidalFit, and Differentiation.
References d_curve, d_curveColorIndex, d_explanation, d_graph, d_init_err, d_max_iterations, d_min_points, d_n, d_points, d_prec, d_sort_data, d_table, and d_tolerance.
Referenced by FFTFilter::FFTFilter(), Filter(), Interpolation::Interpolation(), and SmoothFilter::SmoothFilter().
|
protectedvirtual |
Reimplemented in Integration, and Interpolation.
References d_min_points, and d_n.
Referenced by setDataCurve().
|
inlinevirtual |
Output string added to the plot as a new legend.
Reimplemented in Fit, and PolynomialFit.
Referenced by showLegend().
|
inlineprotectedvirtual |
Output string added to the log pannel of the application.
Reimplemented in Integration.
Referenced by run().
|
protectedvirtual |
Performs the data analysis and takes care of the output.
Reimplemented in Deconvolution, Integration, Convolution, FFT, Correlation, and Differentiation.
References addResultCurve(), calculateOutputData(), and d_points.
Referenced by run().
|
virtual |
Actually does the job. Should be reimplemented in derived classes.
References d_init_err, d_n, logInfo(), and output().
Referenced by IntDialog::accept(), FFTDialog::accept(), ApplicationWindow::analyzeCurve(), ApplicationWindow::autoCorrelate(), ApplicationWindow::convolute(), ApplicationWindow::correlate(), ApplicationWindow::deconvolute(), FilterDialog::filter(), InterpolationDialog::interpolate(), and SmoothCurveDialog::smooth().
|
inline |
Sets the color of the output fit curve.
References d_curveColorIndex.
Referenced by FitDialog::accept(), FilterDialog::filter(), PolynomFitDialog::fit(), ExpDecayDialog::fit(), InterpolationDialog::interpolate(), and SmoothCurveDialog::smooth().
void Filter::setColor | ( | const QString & | colorName | ) |
Sets the color of the output fit curve. Provided for convenience. To be used in scripts only!
References ColorBox::colorIndex(), d_curveColorIndex, and ColorBox::isValidColor().
|
virtual |
Reimplemented in Fit.
References Graph::curve(), curveData(), d_curve, d_from, d_graph, d_init_err, d_n, d_sort_data, d_to, d_x, d_y, isDataAcceptable(), and sortedCurveData().
Referenced by setDataFromCurve().
bool Filter::setDataFromCurve | ( | const QString & | curveTitle, |
Graph * | g = 0 |
||
) |
References curveIndex(), d_from, d_graph, d_init_err, d_to, Graph::range(), and setDataCurve().
Referenced by FitDialog::accept(), ApplicationWindow::analyzeCurve(), Differentiation::Differentiation(), ExponentialFit::ExponentialFit(), FFT::FFT(), FFTFilter::FFTFilter(), MultiPeakFitTool::finalize(), PolynomFitDialog::fit(), ExpDecayDialog::fit(), GaussAmpFit::GaussAmpFit(), GaussFit::GaussFit(), Integration::Integration(), Interpolation::Interpolation(), LinearFit::LinearFit(), LorentzFit::LorentzFit(), NonLinearFit::NonLinearFit(), PluginFit::PluginFit(), PolynomialFit::PolynomialFit(), setInterval(), SigmoidalFit::SigmoidalFit(), SmoothFilter::SmoothFilter(), ThreeExpFit::ThreeExpFit(), and TwoExpFit::TwoExpFit().
bool Filter::setDataFromCurve | ( | const QString & | curveTitle, |
double | from, | ||
double | to, | ||
Graph * | g = 0 |
||
) |
References curveIndex(), d_init_err, and setDataCurve().
void Filter::setInterval | ( | double | from, |
double | to | ||
) |
Changes the data range if the source curve was already assigned. Provided for convenience.
References d_curve, and setDataFromCurve().
|
inline |
Sets the maximum number of iterations to be performed during an iterative session.
References d_max_iterations.
Referenced by FitDialog::accept().
|
inline |
Sets the number of points in the output curve.
References d_points.
Referenced by InterpolationDialog::interpolate().
|
inline |
Sets the precision used for the output.
References d_prec.
Referenced by ApplicationWindow::analyzeCurve(), PolynomFitDialog::fit(), and ExpDecayDialog::fit().
|
inline |
Sets the tolerance used by the GSL routines.
References d_tolerance.
Referenced by FitDialog::accept().
|
virtual |
Adds a new legend to the plot. Calls virtual legendInfo()
References d_graph, Graph::hasLegend(), Graph::legend(), legendInfo(), Graph::newLegend(), Legend::rect(), Graph::replot(), and Legend::setOrigin().
Referenced by ApplicationWindow::analyzeCurve(), FitDialog::closeEvent(), ExpDecayDialog::closeEvent(), and PolynomialFit::fit().
|
private |
Same as curveData, but sorts the points by their x value.
Referenced by setDataCurve().
|
protected |
The curve to be analysed.
Referenced by addResultCurve(), FFT::fftCurve(), Fit::Fit(), MultiPeakFit::generateFitCurve(), init(), Fit::legendInfo(), Fit::logFitInfo(), Integration::logInfo(), Differentiation::output(), FFT::output(), setDataCurve(), setInterval(), and Fit::setYErrorSource().
|
protected |
Color index of the result curve.
Referenced by Correlation::addResultCurve(), Convolution::addResultCurve(), addResultCurve(), Fit::Fit(), MultiPeakFit::generateFitCurve(), init(), Fit::insertFitFunctionCurve(), FFT::output(), and setColor().
|
protected |
String explaining the operation in the comment of the result table and in the project explorer.
Referenced by addResultCurve(), SmoothFilter::calculateOutputData(), FFTFilter::calculateOutputData(), FFT::fftCurve(), Fit::Fit(), GaussFit::GaussFit(), MultiPeakFit::generateFitCurve(), ExponentialFit::init(), SigmoidalFit::init(), PluginFit::init(), NonLinearFit::init(), PolynomialFit::init(), Interpolation::init(), TwoExpFit::init(), LinearFit::init(), ThreeExpFit::init(), LorentzFit::init(), init(), GaussFit::init(), GaussAmpFit::init(), Fit::logFitInfo(), FFT::output(), and MultiPeakFit::setNumPeaks().
|
protected |
Data interval.
Referenced by Interpolation::calculateOutputData(), Integration::logInfo(), setDataCurve(), and setDataFromCurve().
|
protected |
The graph where the result curve should be displayed.
Referenced by addResultCurve(), curveIndex(), Filter(), PolynomialFit::fit(), Fit::fit(), LinearFit::fit(), MultiPeakFit::generateFitCurve(), Fit::generateFitCurve(), init(), Fit::insertFitFunctionCurve(), MultiPeakFit::insertPeakFunctionCurve(), Integration::logInfo(), FFT::output(), setDataCurve(), setDataFromCurve(), and showLegend().
|
protected |
Error flag telling if something went wrong during the initialization phase.
Referenced by curveIndex(), error(), FFT::fftCurve(), FFT::fftTable(), PolynomialFit::fit(), Fit::Fit(), Fit::fit(), LinearFit::fit(), NonLinearFit::init(), Interpolation::init(), init(), Integration::logInfo(), run(), FFTFilter::setBand(), setDataCurve(), setDataFromCurve(), Correlation::setDataFromTable(), Convolution::setDataFromTable(), FFT::setDataFromTable(), FFTFilter::setFilterType(), SmoothFilter::setMethod(), Interpolation::setMethod(), NonLinearFit::setParametersList(), SmoothFilter::setPolynomOrder(), and SmoothFilter::setSmoothPoints().
|
protected |
Maximum number of iterations per fit.
Referenced by Fit::Fit(), Fit::fitGslMultifit(), Fit::fitGslMultimin(), init(), and setMaximumIterations().
|
protected |
Minimum number of data points necessary to perform the operation.
Referenced by Differentiation::init(), ExponentialFit::init(), SigmoidalFit::init(), PolynomialFit::init(), Interpolation::init(), TwoExpFit::init(), LinearFit::init(), ThreeExpFit::init(), init(), GaussAmpFit::init(), isDataAcceptable(), PluginFit::load(), Interpolation::setMethod(), MultiPeakFit::setNumPeaks(), and NonLinearFit::setParametersList().
|
protected |
Size of the data arrays.
Referenced by Correlation::addResultCurve(), Convolution::addResultCurve(), SigmoidalFit::calculateFitCurveData(), NonLinearFit::calculateFitCurveData(), ExponentialFit::calculateFitCurveData(), PluginFit::calculateFitCurveData(), PolynomialFit::calculateFitCurveData(), TwoExpFit::calculateFitCurveData(), LinearFit::calculateFitCurveData(), ThreeExpFit::calculateFitCurveData(), GaussAmpFit::calculateFitCurveData(), Interpolation::calculateOutputData(), FFTFilter::calculateOutputData(), dataSize(), Fit::errors(), Fit::evaluate_d(), Fit::evaluate_df(), Fit::evaluate_f(), FFT::fftCurve(), PolynomialFit::fit(), Fit::Fit(), Fit::fit(), LinearFit::fit(), Fit::fitGslMultifit(), Fit::fitGslMultimin(), MultiPeakFit::generateFitCurve(), Fit::generateFitCurve(), SigmoidalFit::guessInitialValues(), MultiPeakFit::guessInitialValues(), SmoothFilter::init(), FFTFilter::init(), init(), Fit::insertFitFunctionCurve(), MultiPeakFit::insertPeakFunctionCurve(), Interpolation::isDataAcceptable(), Integration::isDataAcceptable(), isDataAcceptable(), Fit::legendInfo(), Fit::logFitInfo(), Integration::logInfo(), Differentiation::output(), Correlation::output(), Fit::rSquare(), run(), setDataCurve(), Fit::setDataCurve(), Correlation::setDataFromTable(), Convolution::setDataFromTable(), FFT::setDataFromTable(), Interpolation::setMethod(), Fit::setYErrorSource(), SmoothFilter::smoothAverage(), SmoothFilter::smoothFFT(), SmoothFilter::smoothModifiedSavGol(), SmoothFilter::smoothSavGol(), and ~Filter().
|
protected |
Number of result points to de calculated and displayed in the output curve.
Referenced by addResultCurve(), SigmoidalFit::calculateFitCurveData(), NonLinearFit::calculateFitCurveData(), ExponentialFit::calculateFitCurveData(), PluginFit::calculateFitCurveData(), PolynomialFit::calculateFitCurveData(), TwoExpFit::calculateFitCurveData(), LinearFit::calculateFitCurveData(), ThreeExpFit::calculateFitCurveData(), GaussAmpFit::calculateFitCurveData(), Interpolation::calculateOutputData(), SmoothFilter::calculateOutputData(), FFTFilter::calculateOutputData(), Fit::Fit(), MultiPeakFit::generateFitCurve(), Fit::generateFitCurve(), Fit::generateFunction(), SmoothFilter::init(), FFTFilter::init(), init(), Fit::insertFitFunctionCurve(), MultiPeakFit::insertPeakFunctionCurve(), output(), and setOutputPoints().
|
protected |
Precision (number of significant digits) used for the results output.
Referenced by Fit::covarianceMatrix(), Fit::Fit(), init(), Fit::insertFitFunctionCurve(), MultiPeakFit::insertPeakFunctionCurve(), PolynomialFit::legendInfo(), Fit::legendInfo(), MultiPeakFit::logFitInfo(), Fit::logFitInfo(), and setOutputPrecision().
|
protected |
Specifies if the filter needs sorted data as input.
Referenced by Fit::Fit(), Interpolation::init(), Integration::init(), init(), and setDataCurve().
|
protected |
A table source of data.
Referenced by Correlation::addResultCurve(), Convolution::addResultCurve(), FFT::fftTable(), Filter(), init(), FFT::output(), Convolution::setDataFromTable(), Correlation::setDataFromTable(), and FFT::setDataFromTable().
|
protected |
Referenced by Interpolation::calculateOutputData(), Integration::logInfo(), setDataCurve(), and setDataFromCurve().
|
protected |
GSL Tolerance, if ever needed...
Referenced by Fit::Fit(), Fit::fitGslMultifit(), Fit::fitGslMultimin(), init(), Fit::logFitInfo(), and setTolerance().
|
protected |
x data set to be analysed
Referenced by Correlation::addResultCurve(), Convolution::addResultCurve(), SigmoidalFit::calculateFitCurveData(), ExponentialFit::calculateFitCurveData(), NonLinearFit::calculateFitCurveData(), PluginFit::calculateFitCurveData(), PolynomialFit::calculateFitCurveData(), TwoExpFit::calculateFitCurveData(), LinearFit::calculateFitCurveData(), ThreeExpFit::calculateFitCurveData(), GaussAmpFit::calculateFitCurveData(), Interpolation::calculateOutputData(), SmoothFilter::calculateOutputData(), FFTFilter::calculateOutputData(), Fit::evaluate_d(), Fit::evaluate_df(), Fit::evaluate_f(), FFT::fftCurve(), FFT::fftTable(), PolynomialFit::fit(), LinearFit::fit(), Fit::fitGslMultifit(), Fit::fitGslMultimin(), MultiPeakFit::generateFitCurve(), SigmoidalFit::guessInitialValues(), MultiPeakFit::guessInitialValues(), Fit::insertFitFunctionCurve(), MultiPeakFit::insertPeakFunctionCurve(), Interpolation::isDataAcceptable(), Integration::isDataAcceptable(), Fit::logFitInfo(), Integration::logInfo(), Differentiation::output(), Correlation::output(), Convolution::output(), Deconvolution::output(), setDataCurve(), Correlation::setDataFromTable(), Convolution::setDataFromTable(), FFT::setDataFromTable(), SmoothFilter::smoothFFT(), and ~Filter().
|
protected |
y data set to be analysed
Referenced by Interpolation::calculateOutputData(), SmoothFilter::calculateOutputData(), FFTFilter::calculateOutputData(), Fit::evaluate_d(), Fit::evaluate_f(), FFT::fftCurve(), FFT::fftTable(), PolynomialFit::fit(), LinearFit::fit(), Fit::fitGslMultifit(), Fit::fitGslMultimin(), SigmoidalFit::guessInitialValues(), MultiPeakFit::guessInitialValues(), Integration::logInfo(), Differentiation::output(), Correlation::output(), Convolution::output(), Deconvolution::output(), Fit::rSquare(), setDataCurve(), Correlation::setDataFromTable(), Convolution::setDataFromTable(), FFT::setDataFromTable(), Fit::setYErrorSource(), and ~Filter().