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;
329 if (includeIt==0)
return True;
332 if (value >= range(0) && value <= range(1))
return True;
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
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.
uInt numberIterations() const
The number of iterations that the fitter finished with.
Vector< Double > itsSolution
Fit2D::ErrorTypes fit(const MaskedLattice< T > &data, const Lattice< T > &sigma)
Do the fit.
Bool includeIt(Double value, const Vector< Double > &range, Int includeIt) const
A templated, abstract base class for array-like objects with masks.
ErrorTypes
Enum describing output error conditions.
uInt nModels() const
Recover number of models.
ostream-like interface to creating log messages.
Fit2D(LogIO &logger)
Constructor.
Double chiSquared() const
The chi squared of the fit.
static Double paFromGauss2D(Double pa)
Convert p.a.
static String type(Fit2D::Types type)
Return type as a string.
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.
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)
Types
Enum describing the different models you can fit.
Vector< Double > itsErrors
bool Bool
Define the standard types used by Casacore.
Vector< Double > availableSolution() const
Recover solution for either all model components or a specific one.
Vector< Double > itsPixelRange
String errorMessage() const
If function fit failed, you will find a message here saying why it failed.
Bool selectData(Matrix< Double > &pos, Vector< Double > &values, Vector< Double > &weights, const Array< T > &pixels, const Array< Bool > &mask, const Array< T > &sigma)
template <class T, class U> class vector;
Fit 2-D objects to 2-D Lattices or Arrays.
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.
this file contains all the compiler specific defines
uInt numberPoints() const
The number of points used for the last fit.
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.
Vector< Double > availableErrors() const
The errors.
Vector< Double > getParams(uInt which) const
static uInt nParameters(Fit2D::Types type)
Return number of parameters for this type of model.