Isis Developer Reference
|
Computes non-linear lsq fit of HiRISE Drift (Zd module) More...
#include <ZeroBufferFit.h>
Public Types | |
typedef TNT::Array1D< double > | NLVector |
typedef TNT::Array2D< double > | NLMatrix |
Public Member Functions | |
ZeroBufferFit (const HiCalConf &conf) | |
Compute second level drift correction (Zf module) | |
virtual | ~ZeroBufferFit () |
Destructor. | |
void | setBin (int bin) |
Set binning/summing mode. | |
void | setLineTime (double ltime) |
Set scan line time. | |
int | size () const |
Returns the size of the data buffer. | |
int | nSize () const |
Returns the size of the fitted buffer. | |
int | nParms () const |
Number of parameter to be fitted. | |
void | setabsErr (double absError) |
Sets the absolute error parameter. | |
void | setrelErr (double relError) |
Sets the relative error parameter | |
double | absErr () const |
Returns the current value of the absolute error. | |
double | relErr () const |
Returns the current value of the relative error. | |
HiVector | Solve (const HiVector &d) |
Compute non-linear fit to (typically) ZeroBufferSmooth module. | |
NLVector | guess () |
Compute the initial guess of the fit. | |
int | checkIteration (const int Iter, const NLVector &fitcoefs, const NLVector &uncerts, double cplxconj, int Istatus) |
Computes the interation check for convergence. | |
NLVector | f_x (const NLVector &a) |
Computes the function value at the current iteration. | |
NLMatrix | df_x (const NLVector &a) |
Computes the first derivative of the function at the current iteration. | |
double | Chisq () const |
Returns the Chi-Square value of the fit solution. | |
int | DoF () const |
Returns the Degrees of Freedom. | |
HiVector | Yfit () const |
Computes the solution vector using current coefficents. | |
HiVector | Normalize (const HiVector &v) |
Compute normalized solution vector from result. | |
void | setMaxIters (int m) |
Sets the maximum number of iterations. | |
int | maxIters () const |
Maximum number iterations for valid solution. | |
int | curvefit () |
int | status () const |
Return status of last fit processing. | |
bool | success () const |
Determine success from last fit processing. | |
bool | success (int status) const |
Check status for success of the given condition | |
std::string | statusstr () const |
Return error message pertaining to last fit procesing. | |
std::string | statusstr (int status) const |
Return error message given status condition. | |
NLVector | coefs () const |
Return coefficients from last fit processing. | |
NLVector | uncert () const |
Return uncertainties from last fit processing. | |
int | nIterations () const |
Return number of iterations from last fit processing. | |
QString | name () const |
Returns name of component. | |
QString | getcsvFile () const |
Returns expanded name of last CSV file loaded by loadCsv. | |
virtual void | Process (const Module &c) |
Invokes the process method on the Module vector. | |
virtual void | Process (const HiVector &v) |
Default processing behavior makes a reference copy of data array. | |
HiVector | loadCsv (const QString &csvBase, const HiCalConf &conf, const DbProfile &prof, const int &elements=0) |
Provide generic loading of CSV file for all modules. | |
const HiVector & | ref () const |
Return data via a const reference. | |
double | operator() (int index) const |
Return individual element of the data vector. | |
const HiHistory & | History () const |
Return recorded history of events. | |
virtual void | record (PvlGroup &pvl, const QString keyname="ModuleHistory") const |
Record history in Pvl group object. | |
void | Dump (const QString &fname) const |
Dumps the component to a specified file. | |
Protected Types | |
enum | { DefaultWidth = 10 , DefaultPrecision = 6 } |
Protected Member Functions | |
void | Terminate (const std::string &message="") |
void | Abort (const std::string &reason="") |
bool | doContinue () const |
QString | formatDbl (const double &value) const |
Properly format values that could be special pixels. | |
Protected Attributes | |
QString | _name |
Name of component. | |
QString | _csvFile |
Fully expanded name of CSV file if present. | |
HiHistory | _history |
Hierarchial component history. | |
int | _fmtWidth |
Default field with of double. | |
int | _fmtPrecision |
Default field with of double. | |
Computes non-linear lsq fit of HiRISE Drift (Zd module)
This class is best used with individual HiRISE images as the number of lines is critical to proper use. It is best applied by getting the buffer as a reference and applying it during systematic processing.
This class models the drift correction using the Levenberg-Marquardt algorithm.
|
inherited |
|
inherited |
Isis::ZeroBufferFit::ZeroBufferFit | ( | const HiCalConf & | conf | ) |
Compute second level drift correction (Zf module)
This class provides the second level drift correction that is
conf |
References Isis::Module::_history, Isis::HiHistory::add(), Isis::ConfKey(), Isis::IsEqual(), Isis::IsTrueValue(), Isis::NonLinearLSQ::maxIters(), Isis::HiLineTimeEqn::setBin(), Isis::HiLineTimeEqn::setLineTime(), Isis::NonLinearLSQ::setMaxIters(), Isis::toDouble(), Isis::ToDouble(), Isis::toInt(), Isis::ToInteger(), and Isis::ToString().
|
inlinevirtual |
Destructor.
|
protectedinherited |
|
inlinevirtual |
Returns the current value of the absolute error.
Reimplemented from Isis::NonLinearLSQ.
|
virtual |
Computes the interation check for convergence.
Iter | Current iteration |
fitcoefs | Vector of current fit coefficients |
uncerts | Uncertainties |
cplxconj | Complex conjugate of the current iteration |
Istatus | State of current iteration |
Reimplemented from Isis::NonLinearLSQ.
|
inline |
Returns the Chi-Square value of the fit solution.
Referenced by Solve().
|
inlineinherited |
Return coefficients from last fit processing.
Referenced by Solve().
|
inherited |
|
virtual |
Computes the first derivative of the function at the current iteration.
Implements Isis::NonLinearLSQ.
References MIN.
|
inlineprotectedinherited |
Referenced by Isis::NonLinearLSQ::curvefit().
|
inline |
|
inlineinherited |
Dumps the component to a specified file.
fname | Name of file to dump contents to |
References _FILEINFO_, and Isis::IException::User.
|
virtual |
Computes the function value at the current iteration.
Implements Isis::NonLinearLSQ.
References MIN.
|
inlineprotectedinherited |
Properly format values that could be special pixels.
This method applies ISIS special pixel value conventions to properly print pixel values.
[in] | (double) | value Input value to test for specialness and print as requested by caller |
[in] | (int) | width Width of field in which to print the value |
[in] | (int) | prec Precision used to format the value |
References Isis::Module::_fmtPrecision, Isis::Module::_fmtWidth, Isis::IsSpecial(), and Isis::PixelToString().
Referenced by Isis::Module::printOn().
|
inlineinherited |
Returns expanded name of last CSV file loaded by loadCsv.
References Isis::Module::_csvFile.
|
virtual |
Compute the initial guess of the fit.
This method provides the non-linear fit with an initial guess of the solution. It involves a linear fit to the latter half of the data to provide the first two coefficents, the difference of the averages of the residuals at both ends of the data set and 5 times the last line time as the final (fourth) element...a bit involved really.
Implements Isis::NonLinearLSQ.
References Isis::Module::_history, Isis::HiHistory::add(), MIN, and Isis::ToString().
|
inlineinherited |
Return recorded history of events.
References Isis::Module::_history.
|
inlineinherited |
Provide generic loading of CSV file for all modules.
This method provides generalized access to CSV files through the standardized format.
cvsBase | Name of base keyword for CSV file |
conf | Configuration parameters |
prof | Module profile parameters |
samples | Number of expect elements to be read from CSV file |
References Isis::Module::_csvFile, and Isis::Module::_history.
|
inlineinherited |
Maximum number iterations for valid solution.
Referenced by ZeroBufferFit().
|
inlineinherited |
Returns name of component.
References Isis::Module::_name.
|
inlineinherited |
Return number of iterations from last fit processing.
Referenced by Solve().
Compute normalized solution vector from result.
References Isis::Module::_history, Isis::HiHistory::add(), and Isis::ToString().
|
inlinevirtual |
Number of parameter to be fitted.
This is the number of parameters that ZeroBufferFit needs to fit. This method is a requirement of the NonLinearLSQ class.
Implements Isis::NonLinearLSQ.
Referenced by DoF().
|
inlinevirtual |
Returns the size of the fitted buffer.
Important: This returns the size of the buffer being fitted and not the size of original data buffer. This is a requirement of the NonLinearLSQ class. USE WITH CAUTION!
Implements Isis::NonLinearLSQ.
Referenced by DoF().
|
inlineinherited |
Return individual element of the data vector.
References Isis::Module::_data.
|
inlinevirtualinherited |
Default processing behavior makes a reference copy of data array.
Reimplemented in Isis::LowPassFilter, and Isis::SplineFill.
References Isis::Module::_data.
|
inlinevirtualinherited |
Invokes the process method on the Module vector.
References Isis::Module::Process().
Referenced by Isis::Module::Process().
|
inlinevirtualinherited |
Record history in Pvl group object.
References Isis::Module::_history, and Isis::HiHistory::makekey().
|
inlineinherited |
Return data via a const reference.
References Isis::Module::_data.
|
inlinevirtual |
Returns the current value of the relative error.
Reimplemented from Isis::NonLinearLSQ.
|
inline |
Sets the absolute error parameter.
|
inline |
Set binning/summing mode.
bin | Summing mode of observatio |
References Isis::HiLineTimeEqn::setBin().
|
inline |
|
inlineinherited |
Sets the maximum number of iterations.
m | User provides the maximum number iterations |
Referenced by ZeroBufferFit().
|
inline |
Sets the relative error parameter
|
inline |
Returns the size of the data buffer.
This is the size of the original data buffer.
Compute non-linear fit to (typically) ZeroBufferSmooth module.
This method computes a non-linear fit to the result of the ZeroBufferSmooth module. There are several things that can go wrong and some config conditions that dictate behavior of this process.
Should the image be a short exposure (i.e., not many lines) the fit will not succeed so it simply skips this entire module providing the input result (d) as the solution. This wil also occur when the user has selected the skip option for the module.
A fit is attempted on the ZeroBufferSmooth data. The non-linear solution must converge within the specifed number of iterations (MaximumIterations) or a polynomial fit will be used in leui of a valid solution.
d | ZeroBufferSmooth data solution as input to this method |
References Isis::Module::_history, Isis::HiHistory::add(), Chisq(), Isis::NonLinearLSQ::coefs(), Isis::NonLinearLSQ::curvefit(), DoF(), Isis::NonLinearLSQ::nIterations(), Isis::NonLinearLSQ::statusstr(), Isis::NonLinearLSQ::success(), Isis::ToString(), Isis::NonLinearLSQ::uncert(), and Yfit().
|
inlineinherited |
Return status of last fit processing.
Referenced by Isis::NonLinearLSQ::statusstr(), and Isis::NonLinearLSQ::success().
|
inlineinherited |
Return error message pertaining to last fit procesing.
Referenced by Solve().
|
inlineinherited |
Return error message given status condition.
References Isis::NonLinearLSQ::status().
|
inlineinherited |
Determine success from last fit processing.
Referenced by Solve().
|
inlineinherited |
Check status for success of the given condition
References Isis::NonLinearLSQ::status().
|
protectedinherited |
|
inlineinherited |
Return uncertainties from last fit processing.
Referenced by Solve().
HiVector Isis::ZeroBufferFit::Yfit | ( | ) | const |
Computes the solution vector using current coefficents.
Referenced by Solve().
|
protectedinherited |
Fully expanded name of CSV file if present.
Referenced by Isis::Module::getcsvFile(), and Isis::Module::loadCsv().
|
protectedinherited |
Default field with of double.
Referenced by Isis::Module::formatDbl().
|
protectedinherited |
Default field with of double.
Referenced by Isis::Module::formatDbl().
|
protectedinherited |
Hierarchial component history.
Referenced by guess(), Isis::Module::History(), Isis::Module::loadCsv(), Isis::LowPassFilter::LowPassFilter(), Isis::LowPassFilter::LowPassFilter(), Normalize(), Isis::Module::printOn(), Isis::LowPassFilter::Process(), Isis::SplineFill::Process(), Isis::Module::record(), Solve(), Isis::SplineFill::SplineFill(), Isis::SplineFill::SplineFill(), Isis::SplineFill::SplineFill(), and ZeroBufferFit().
|
protectedinherited |
Name of component.
Referenced by Isis::Module::name().