Go to the documentation of this file.
28 #ifndef LATTICES_FIT2D_H
29 #define LATTICES_FIT2D_H
32 #include <casacore/casa/aips.h>
33 #include <casacore/scimath/Functionals/CompoundFunction.h>
34 #include <casacore/casa/BasicSL/Constants.h>
35 #include <casacore/scimath/Fitting/NonLinearFitLM.h>
36 #include <casacore/casa/Logging/LogIO.h>
40 template<
class T>
class Array;
41 template<
class T>
class Matrix;
42 template<
class T>
class Vector;
43 template<
class T>
class Lattice;
44 template<
class T>
class MaskedLattice;
333 }
else if (
value < range(0) ||
value > range(1)) {
342 #ifndef CASACORE_NO_AUTO_TEMPLATES
343 #include <casacore/lattices/LatticeMath/Fit2D2.tcc>
344 #endif //# CASACORE_NO_AUTO_TEMPLATES
Vector< Double > getParams(uInt which) const
Fit2D & operator=(const Fit2D &other)
Assignment operator.
Bool includeIt(Double value, const Vector< Double > &range, Int includeIt) const
Vector< Double > availableErrors() const
The errors.
ErrorTypes
Enum describing output error conditions.
static uInt nParameters(Fit2D::Types type)
Return number of parameters for this type of model.
A templated, abstract base class for array-like objects with masks.
uInt nModels() const
Recover number of models.
Fit2D::ErrorTypes fit(const MaskedLattice< T > &data, const Lattice< T > &sigma)
Do the fit.
Fit2D::ErrorTypes fitData(const Vector< Double > &values, const Matrix< Double > &pos, const Vector< Double > &sigma)
Vector< Double > itsSolution
static Double paFromGauss2D(Double pa)
Convert p.a.
Fit2D::ErrorTypes residual(Array< T > &resid, Array< T > &model, const Array< T > &data, Int xOffset=0, int yOffset=0) const
Find the residuals to the fit.
Fit2D(LogIO &logger)
Constructor.
Double chiSquared() const
The chi squared of the fit.
ostream-like interface to creating log messages.
Vector< Double > itsErrors
@ NOGOOD
There were no unmasked points.
LatticeExprNode value(const LatticeExprNode &expr)
This function returns the value of the expression without a mask.
static Vector< Bool > convertMask(const String fixedmask, Fit2D::Types type)
Convert mask from a string to a vector.
Types
Enum describing the different models you can fit.
void setParams(const Vector< Double > ¶ms, uInt which)
@ NOCONVERGE
Did not converge.
static String type(Fit2D::Types type)
Return type as a string.
Vector< Double > itsPixelRange
void setExcludeRange(Double minVal, Double maxVal)
this file contains all the compiler specific defines
@ nErrorTypes
Number of conditions.
NonLinearFitLM< Double > itsFitter
Vector< uInt > itsTypeList
Sum of a collection of Functions which behaves as one Function object.
Bool selectData(Matrix< Double > &pos, Vector< Double > &values, Vector< Double > &weights, const Array< T > &pixels, const Array< Bool > &mask, const Array< T > &sigma)
LatticeExprNode pa(const LatticeExprNode &left, const LatticeExprNode &right)
This function finds 180/pi*atan2(left,right)/2.
Vector< Double > estimate(Fit2D::Types type, const MaskedLattice< T > &data)
Determine an initial estimate for the solution of the specified model type to the given data - no com...
LatticeExprNode mask(const LatticeExprNode &expr)
This function returns the mask of the given expression.
Vector< Double > availableSolution() const
Recover solution for either all model components or a specific one.
A templated, abstract base class for array-like objects.
template <class T, class U> class vector;
uInt numberPoints() const
The number of points used for the last fit.
String errorMessage() const
If function fit failed, you will find a message here saying why it failed.
uInt addModel(Fit2D::Types type, const Vector< Double > ¶meters, const Vector< Bool > ¶meterMask)
Add a model to the list to be simultaneously fit and return its index.
String: the storage and methods of handling collections of characters.
void setIncludeRange(Double minVal, Double maxVal)
Set a pixel selection range.
bool Bool
Define the standard types used by Casacore.
Fit 2-D objects to 2-D Lattices or Arrays.
static Double paToGauss2D(Double pa)
Convert p.a.
void piRange(Double &pa) const
CompoundFunction< AutoDiff< Double > > itsFunction
uInt numberIterations() const
The number of iterations that the fitter finished with.