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;
318 if (includeIt==0)
return True;
321 if (value >= range(0) && value <= range(1))
return True;
322 }
else if (value < range(0) || value > range(1)) {
Bool selectData(Matrix< Double > &pos, Vector< Double > &values, Vector< Double > &weights, const Array< Float > &pixels, const Array< Bool > &mask, const Array< Float > &sigma)
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
Vector< Double > estimate(Fit2D::Types type, const MaskedLattice< Float > &data)
Determine an initial estimate for the solution of the specified model type to the given data - no com...
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.
Fit2D::ErrorTypes fit(const MaskedLattice< Float > &data, const Lattice< Float > &sigma)
Do the fit.
static Double paFromGauss2D(Double pa)
Convert p.a.
static String type(Fit2D::Types type)
Return type as a string.
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
Fit2D::ErrorTypes residual(Array< Float > &resid, Array< Float > &model, const Array< Float > &data, Int xOffset=0, int yOffset=0) const
Find the residuals to the fit.
void setExcludeRange(Double minVal, Double maxVal)
Types
Enum describing the different models you can fit.
Vector< Float > itsPixelRange
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.
String errorMessage() const
If function fit failed, you will find a message here saying why it failed.
Bool includeIt(Float value, const Vector< Float > &range, Int includeIt) const
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
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.