28 #ifndef LATTICES_FIT2D_H
29 #define LATTICES_FIT2D_H
41 template<
class T>
class Lattice;
42 template<
class T>
class MaskedLattice;
327 if (includeIt==0)
return True;
330 if (value >= range(0) && value <= range(1))
return True;
331 }
else if (value < range(0) || value > range(1)) {
340 #ifndef CASACORE_NO_AUTO_TEMPLATES
341 #include <casacore/lattices/LatticeMath/Fit2D2.tcc>
342 #endif //# CASACORE_NO_AUTO_TEMPLATES
void piRange(Double &pa) const
Fit2D & operator=(const Fit2D &other)
Assignment operator.
There were no unmasked points.
LatticeExprNode mask(const LatticeExprNode &expr)
This function returns the mask of the given expression.
Vector< Double > availableErrors() const
The errors.
Vector< Double > itsSolution
Bool includeIt(Double value, const Vector< Double > &range, Int includeIt) const
Fit2D::ErrorTypes fit(const MaskedLattice< T > &data, const Lattice< T > &sigma)
Do the fit.
String errorMessage() const
If function fit failed, you will find a message here saying why it failed.
A templated, abstract base class for array-like objects with masks.
Vector< Double > getParams(uInt which) const
ErrorTypes
Enum describing output error conditions.
ostream-like interface to creating log messages.
Fit2D(LogIO &logger)
Constructor.
static Double paFromGauss2D(Double pa)
Convert p.a.
Vector< Double > availableSolution() const
Recover solution for either all model components or a specific one.
uInt numberPoints() const
The number of points used for the last fit.
static String type(Fit2D::Types type)
Return type as a string.
Double chiSquared() const
The chi squared of the fit.
A templated, abstract base class for array-like objects.
LatticeExprNode pa(const LatticeExprNode &left, const LatticeExprNode &right)
This function finds 180/pi*atan2(left,right)/2.
Fit2D::ErrorTypes fitData(const Vector< Double > &values, const Matrix< Double > &pos, const Vector< Double > &sigma)
static Vector< Bool > convertMask(const String fixedmask, Fit2D::Types type)
Convert mask from a string to a vector.
void setParams(const Vector< Double > ¶ms, uInt which)
NonLinearFitLM< Double > itsFitter
void setExcludeRange(Double minVal, Double maxVal)
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.
Types
Enum describing the different models you can fit.
Vector< Double > itsErrors
bool Bool
Define the standard types used by Casacore.
Vector< Double > itsPixelRange
Bool selectData(Matrix< Double > &pos, Vector< Double > &values, Vector< Double > &weights, const Array< T > &pixels, const Array< Bool > &mask, const Array< T > &sigma)
Fit 2-D objects to 2-D Lattices or Arrays.
uInt numberIterations() const
The number of iterations that the fitter finished with.
static Double paToGauss2D(Double pa)
Convert p.a.
Vector< uInt > itsTypeList
String: the storage and methods of handling collections of characters.
void setIncludeRange(Double minVal, Double maxVal)
Set a pixel selection range.
CompoundFunction< AutoDiff< Double > > itsFunction
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...
Sum of a collection of Functions which behaves as one Function object.
LatticeExprNode value(const LatticeExprNode &expr)
This function returns the value of the expression without a mask.
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.
static uInt nParameters(Fit2D::Types type)
Return number of parameters for this type of model.
uInt nModels() const
Recover number of models.