28 #ifndef IMAGES_IMAGEPROFILEFITTER_H
29 #define IMAGES_IMAGEPROFILEFITTER_H
41 class ProfileFitResults;
143 ThrowIf(mgp == 0,
"Number of good points has to be > 0");
236 return std::vector<casacore::Coordinate::Type>(0);
258 std::shared_ptr<const casacore::SubImage<casacore::Float> >
_subImage;
263 std::shared_ptr<casacore::TempImage<casacore::Float> >
_sigma;
308 std::shared_ptr<casacore::ProgressMeter> progressMeter,
casacore::Bool checkMinPts,
311 const std::set<casacore::uInt> goodPlanes
319 const std::vector<casacore::IPosition>& goodPos,
void setModel(const casacore::String &model)
Solution images.
A Vector of integers, for indexing into Array<T> objects.
void setGoodPlanes(const std::set< casacore::uInt > &planes)
set the planes along the fit axis that are considered good for performing the fits.
void setCenterErrName(const casacore::String &s)
gaussian center error image name
casacore::String getClass() const
casacore::String _residual
casacore::Array< std::shared_ptr< ProfileFitResults > > _fitters
casacore::PtrHolder< std::pair< casacore::Double, casacore::Double > > _goodFWHMRange
casacore::String _centerName
casacore::Double _abscissaDivisor
casacore::uInt _nPLPCoeffs
const casacore::Array< std::shared_ptr< ProfileFitResults > > & getFitters() const
LatticeExprNode mask(const LatticeExprNode &expr)
This function returns the mask of the given expression.
void _fitProfiles(const casacore::Bool showProgress)
Fit all profiles in image.
Fit spectral components to a casacore::Vector of data from an image.
void _flagFitterIfNecessary(ImageFit1D< casacore::Float > &fitter) const
casacore::Bool _inVelocitySpace() const;
std::set< casacore::uInt > _goodPlanes
planes along _fitAxis to use in fits, empty => use all planes originally used to support continuum su...
casacore::uInt _nGaussSinglets
void _finishConstruction()
virtual Type type()
Return the type enum.
void setGoodAmpRange(const casacore::Double min, const casacore::Double max)
set the range over which PFC amplitude solutions are valid
void _loopOverFits(SPCIIF fitData, casacore::Bool showProgress, std::shared_ptr< casacore::ProgressMeter > progressMeter, casacore::Bool checkMinPts, const casacore::Array< casacore::Bool > &fitMask, ImageFit1D< casacore::Float >::AbcissaType abcissaType, const casacore::IPosition &fitterShape, const casacore::IPosition &sliceShape, const std::set< casacore::uInt > goodPlanes)
casacore::Record fit(casacore::Bool doDetailedResults=true)
Do the fit.
void setAbscissaDivisor(casacore::Double d)
casacore::Record _results
casacore::String _abscissaDivisorForDisplay
std::vector< casacore::Coordinate::Type > _getNecessaryCoordinates() const
Represents the minimum set of coordinates necessary for the task to function.
void setGoodFWHMRange(const casacore::Double min, const casacore::Double max)
set the range over which PFC FWHM solutions are valid
A 2-D Specialization of the Array class.
ImageProfileFitter(const SPCIIF image, const casacore::String ®ion, const casacore::Record *const ®ionPtr, const casacore::String &box, const casacore::String &chans, const casacore::String &stokes, const casacore::String &mask, const casacore::Int axis, const casacore::uInt ngauss, casacore::Bool overwrite=false)
Top level interface for one-dimensional profile fits.
casacore::uInt _nLorentzSinglets
casacore::Bool _hasLogfileSupport() const
by default, derived classes are configured to have no log file support.
Hold and delete pointers not deleted by object destructors.
casacore::String _plpName
void _checkNGaussAndPolyOrder() const
casacore::Bool _isSpectralIndex
void setFWHMName(const casacore::String &s)
gaussian fwhm image name
casacore::uInt _nGaussMultiplets
casacore::Bool _overwrite
casacore::PtrHolder< std::pair< casacore::Double, casacore::Double > > _goodCenterRange
casacore::uInt _minGoodPoints
casacore::String _ampErrName
CasacRegionManager::StokesControl _getStokesControl() const
casacore::uInt _nAttempted
casacore::uInt _nSucceeded
std::shared_ptr< const casacore::SubImage< casacore::Float > > _subImage
subimage contains the region of the original image on which the fit is performed. ...
casacore::Record getResults() const
get the fit results.
A templated, abstract base class for array-like objects.
casacore::Double getWorldValue(casacore::Double pixelVal, const casacore::IPosition &imPos, const casacore::String &units, casacore::Bool velocity, casacore::Bool wavelength, casacore::Int tabularIndex=-1, casacore::MFrequency::Types type=casacore::MFrequency::DEFAULT) const
Converts a pixel value into a world value either in velocity, wavelength, or frequency units...
void setCenterName(const casacore::String &s)
gaussian center image name
static const casacore::String _class
void _setAbscissaDivisorIfNecessary(const casacore::Vector< casacore::Double > &abscissaValues)
casacore::Bool _storeFits
casacore::Bool _logResults
Abstract base class that describes a spectral profile that can be parameterized by a peak value (ampl...
void setLTPErrName(const casacore::String &s)
set the name of the logarithmic transformed polynomial image.
void setMinGoodPoints(const casacore::uInt mgp)
set minimum number of good points required to attempt a fit
casacore::String _fwhmErrName
std::shared_ptr< const casacore::ImageInterface< casacore::Float > > SPCIIF
casacore::String _integralName
A hierarchical collection of named fields of various types.
bool Bool
Define the standard types used by Casacore.
casacore::PtrHolder< std::pair< casacore::Double, casacore::Double > > _goodAmpRange
void setGoodCenterRange(const casacore::Double min, const casacore::Double max)
set the range over which PFC center solutions are valid
void setDoMultiFit(const casacore::Bool m)
set whether to do a pixel by pixel fit.
#define ThrowIf(c, m)
Throw an AipsError exception if the condition is true.
void setPLPName(const casacore::String &s)
set the name of the power logarithmic polynomial image.
~ImageProfileFitter()
destructor
void setIntegralErrName(const casacore::String &s)
gaussian integral error image name
void setLTPName(const casacore::String &s)
set the name of the logarithmic transformed polynomial image.
casacore::Bool _createResid
void _updateModelAndResidual(casacore::Bool fitOK, const ImageFit1D< casacore::Float > &fitter, const casacore::IPosition &sliceShape, const casacore::IPosition &curPos, casacore::Lattice< casacore::Bool > *const &pFitMask, casacore::Lattice< casacore::Bool > *const &pResidMask) const
casacore::Bool _supportsMultipleRegions() const
std::shared_ptr< casacore::ImageInterface< casacore::Float > > SPIIF
A set of SpectralElements.
casacore::String _ltpName
casacore::String _centerErrName
casacore::String _fwhmName
casacore::uInt _nProfiles
casacore::String _ampName
SPIIF getResidual() const
void _fitallprofiles()
moved from ImageAnalysis
void setPLPErrName(const casacore::String &s)
set the name of the power logarithmic polynomial image.
casacore::String _integralErrName
void setAmpErrName(const casacore::String &s)
gaussian amplitude error image name
void setOutputSigmaImage(const casacore::String &s)
String: the storage and methods of handling collections of characters.
void createResidualImage(casacore::Bool b)
for backward compatibility with ia.continuumsub.
casacore::Bool _setFitterElements(ImageFit1D< casacore::Float > &fitter, SpectralList &newEstimates, const casacore::PtrHolder< const PolynomialSpectralElement > &polyEl, const std::vector< casacore::IPosition > &goodPos, const casacore::IPosition &fitterShape, const casacore::IPosition &curPos, casacore::uInt nOrigComps) const
casacore::uInt _nConverged
void setIntegralName(const casacore::String &s)
gaussian integral image name
casacore::uInt _nUnknowns() const
only implemented for the simplest cases so far
std::shared_ptr< casacore::TempImage< casacore::Float > > _sigma
casacore::uInt _nLTPCoeffs
void setFWHMErrName(const casacore::String &s)
gaussian fwhm error image name
Types
Types of known MFrequencies Warning: The order defines the order in the translation matrix FromTo in...
casacore::String _sigmaName
void setPolyOrder(casacore::Int p)
set the order of a polynomial to be simultaneously fit.
casacore::Matrix< casacore::String > _worldCoords
casacore::String _plpErrName
void setAmpName(const casacore::String &s)
gaussian amplitude image name
void setResidual(const casacore::String &residual)
residual image name
casacore::String _ltpErrName
casacore::Bool _isPCFSolutionOK(const PCFSpectralElement *const &pcf) const
void setSigma(const casacore::Array< casacore::Float > &sigma)
set standard deviation image
std::vector< OutputDestinationChecker::OutputStruct > _getOutputStruct()
casacore::Bool _haveWarnedAboutGuessingGaussians
SpectralList _nonPolyEstimates
void setLogResults(const casacore::Bool logResults)
set if results should be written to the logger