Isis 3 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) More... | |
virtual | ~ZeroBufferFit () |
Destructor. More... | |
void | setBin (int bin) |
Set binning/summing mode. More... | |
void | setLineTime (double ltime) |
Set scan line time. More... | |
int | size () const |
Returns the size of the data buffer. More... | |
int | nSize () const |
Returns the size of the fitted buffer. More... | |
int | nParms () const |
Number of parameter to be fitted. More... | |
void | setabsErr (double absError) |
Sets the absolute error parameter. More... | |
void | setrelErr (double relError) |
Sets the relative error parameter. More... | |
double | absErr () const |
Returns the current value of the absolute error. More... | |
double | relErr () const |
Returns the current value of the relative error. More... | |
HiVector | Solve (const HiVector &d) |
Compute non-linear fit to (typically) ZeroBufferSmooth module. More... | |
NLVector | guess () |
Compute the initial guess of the fit. More... | |
int | checkIteration (const int Iter, const NLVector &fitcoefs, const NLVector &uncerts, double cplxconj, int Istatus) |
Computes the interation check for convergence. More... | |
NLVector | f_x (const NLVector &a) |
Computes the function value at the current iteration. More... | |
NLMatrix | df_x (const NLVector &a) |
Computes the first derivative of the function at the current iteration. More... | |
double | Chisq () const |
Returns the Chi-Square value of the fit solution. More... | |
int | DoF () const |
Returns the Degrees of Freedom. More... | |
HiVector | Yfit () const |
Computes the solution vector using current coefficents. More... | |
HiVector | Normalize (const HiVector &v) |
Compute normalized solution vector from result. More... | |
void | setMaxIters (int m) |
Sets the maximum number of iterations. More... | |
int | maxIters () const |
Maximum number iterations for valid solution. More... | |
int | curvefit () |
int | status () const |
Return status of last fit processing. More... | |
bool | success () const |
Determine success from last fit processing. More... | |
bool | success (int status) const |
Check status for success of the given condition. More... | |
std::string | statusstr () const |
Return error message pertaining to last fit procesing. More... | |
std::string | statusstr (int status) const |
Return error message given status condition. More... | |
NLVector | coefs () const |
Return coefficients from last fit processing. More... | |
NLVector | uncert () const |
Return uncertainties from last fit processing. More... | |
int | nIterations () const |
Return number of iterations from last fit processing. More... | |
QString | name () const |
Returns name of component. More... | |
QString | getcsvFile () const |
Returns expanded name of last CSV file loaded by loadCsv. More... | |
virtual void | Process (const Module &c) |
Invokes the process method on the Module vector. More... | |
virtual void | Process (const HiVector &v) |
Default processing behavior makes a reference copy of data array. More... | |
HiVector | loadCsv (const QString &csvBase, const HiCalConf &conf, const DbProfile &prof, const int &elements=0) |
Provide generic loading of CSV file for all modules. More... | |
const HiVector & | ref () const |
Return data via a const reference. More... | |
double | operator() (int index) const |
Return individual element of the data vector. More... | |
const HiHistory & | History () const |
Return recorded history of events. More... | |
virtual void | record (PvlGroup &pvl, const QString keyname="ModuleHistory") const |
Record history in Pvl group object. More... | |
void | Dump (const QString &fname) const |
Dumps the component to a specified file. More... | |
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. More... | |
Protected Attributes | |
QString | _name |
Name of component. More... | |
QString | _csvFile |
Fully expanded name of CSV file if present. More... | |
HiHistory | _history |
Hierarchial component history. More... | |
int | _fmtWidth |
Default field with of double. More... | |
int | _fmtPrecision |
Default field with of double. More... | |
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::DbProfile::exists(), Isis::IsEqual(), Isis::IsTrueValue(), Isis::NonLinearLSQ::maxIters(), Isis::DbProfile::Name(), 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 |
Referenced by Solve().
|
virtual |
Computes the first derivative of the function at the current iteration.
Implements Isis::NonLinearLSQ.
References Isis::MIN().
|
inlineprotectedinherited |
|
inline |
|
inlineinherited |
Dumps the component to a specified file.
fname | Name of file to dump contents to |
References _FILEINFO_, Isis::FileName::expanded(), and Isis::IException::User.
|
virtual |
Computes the function value at the current iteration.
Implements Isis::NonLinearLSQ.
References Isis::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(), Isis::Statistics::AddData(), Isis::Statistics::Average(), Isis::MIN(), Isis::Module::ref(), Isis::Statistics::Reset(), 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, Isis::Module::_history, Isis::LoadCSV::filename(), Isis::LoadCSV::getVector(), Isis::LoadCSV::History(), and Isis::LoadCSV::validateSize().
|
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 |
Invokes the process method on the Module vector.
References Isis::Module::ref().
|
inlinevirtualinherited |
Default processing behavior makes a reference copy of data array.
Reimplemented in Isis::SplineFill, and Isis::LowPassFilter.
References Isis::Module::_data.
|
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.
Referenced by guess(), Isis::LowPassFilter::LowPassFilter(), Isis::Module::Process(), and Isis::SplineFill::SplineFill().
|
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(), Normalize(), Isis::Module::printOn(), Isis::LowPassFilter::Process(), Isis::SplineFill::Process(), Isis::Module::record(), Solve(), Isis::SplineFill::SplineFill(), and ZeroBufferFit().
|
protectedinherited |
Name of component.
Referenced by Isis::Module::name().