#include <ImageProfileFit.h>
Collaboration diagram for casa::ImageProfileFit:

Part of API
Definition at line 102 of file ImageProfileFit.h.
Public Member Functions | |
| ImageProfileFit () | |
| Constructor. | |
| ~ImageProfileFit () | |
| Destructor. | |
| ImageProfileFit (const ImageProfileFit &other) | |
| Copy constructor. | |
| ImageProfileFit & | operator= (const ImageProfileFit &other) |
| Assignment operator. | |
| Bool | estimate (uInt nMax=0) |
| Makes an estimate from the set data. | |
| uInt | addElements (const RecordInterface &estimate) |
| Decode the Glish record holding SpectralElements and add them to the fitter. | |
| Bool | getList (RecordInterface &rec, Bool xAbsOut, const String &xUnitOut, const String &dopplerOut) |
| Gets the internal SpectralElements (either estimate or fit depending on what function you called last) into a record. | |
| SpectralList | getList () const |
| Gets the internal SpectralElements (either estimate or fit depending on what function you called last) into a SpectralList Only returns False if the field is already defined. | |
| void | reset () |
| Reset the internal list of SpectralElements to null. | |
| uInt | nElements () |
| Return number of SpectralElements set. | |
| void | setData (const ImageInterface< Float > &image, const ImageRegion ®ion, uInt profileAxis, Bool average=True) |
| Set data via an image. | |
| void | setData (const ImageInterface< Float > &image, const ImageInterface< Float > &sigma, const ImageRegion ®ion, uInt profileAxis, Bool average=True) |
| void | setData (const ImageInterface< Float > &image, uInt profileAxis, Bool average=True) |
| void | setData (const ImageInterface< Float > &image, const ImageInterface< Float > &sigma, uInt profileAxis, Bool average=True) |
| void | setData (const CoordinateSystem &cSys, uInt ProfileAxis, const Quantum< Vector< Float > > &x, const Quantum< Vector< Float > > &y, const Vector< Float > &sigma, Bool isAbs, const String &doppler) |
| Set the data directly, and provide a coordinate system and specify the profile axis in the coordinate system. | |
| void | setData (const CoordinateSystem &cSys, uInt ProfileAxis, const Quantum< Vector< Float > > &x, const Quantum< Vector< Float > > &y, const Vector< Bool > &mask, const Vector< Float > &sigma, Bool isAbs, const String &doppler) |
| Bool | fit (Int order=-1) |
| Do the fit of the averaged profile. | |
| void | fit (Bool fillRecord, RecordInterface &rec, Bool xAbsRec, const String &xUnitRec, const String &dopplerRec, ImageInterface< Float > *pFit, ImageInterface< Float > *pResid, Int order=-1) |
| Fit all profiles with shapes + optional polynomial in the region and write out images. | |
| void | residual (Vector< Float > &resid, const Vector< Float > &x) const |
| Find the residuals (fit or estimate) of the averaged profile. | |
| void | residual (Vector< Float > &resid) const |
| void | model (Vector< Float > &model, const Vector< Float > &x) const |
| Find the model (fit or estimate) of the averaged profile. | |
| void | model (Vector< Float > &model) const |
Private Member Functions | |
| void | collapse (Vector< Float > &profile, Vector< Bool > &mask, uInt profileAxis, const MaskedLattice< Float > &lat) const |
| SpectralElement | convertSpectralElement (const SpectralElement &elIn, Bool xAbsIn, Bool xAbsOut, Bool oneRelIn, Bool oneRelOut, const String &xUnitIn, const String &xUnitOut, const String &dopplerIn, const String &dopplerOut, const String &yUnitIn, const String &yUnitOut) |
| Convert SE. | |
| void | convertGaussianElementX (SpectralElement &el, CoordinateSystem &cSys, uInt profileAxis, Bool absIn, Bool absOut, const String &unitIn, const String &unitOut, const String &dopplerIn, const String &dopplerOut, Bool oneRelIn, Bool oneRelOut) |
| Convert Gaussian model x-units when data source is an image. | |
| SpectralList | filterList (const SpectralList &listIn) const |
| Bool | getElements (RecordInterface &rec, Bool xAbsOut, const String &xUnitOut, const String &dopplerOut, const SpectralList &list) |
| void | setData (const ImageInterface< Float > *&pSigma, const ImageInterface< Float > &image, const Slicer &sl, Bool average) |
Private Attributes | |
| ImageInterface< Float > * | itsImagePtr |
| Images holding data and weights. | |
| ImageInterface< Float > * | itsSigmaImagePtr |
| Bool | itsFitDone |
| Quantum< Vector< Float > > | itsX |
| Holds the abcissa, ordinate and mask. | |
| Quantum< Vector< Float > > | itsY |
| Vector< Bool > | itsMask |
| Vector< Float > | itsSigma |
| SpectralFit * | itsSpectralFitPtr |
| The fitters. | |
| SpectralFit | itsSpectralFitter |
| CoordinateSystem | itsCoords |
| The coordinate system if the data source was an image itsProfileAxis specified the profile axis in the image Will be -1 if data source was just vectors. | |
| Int | itsProfileAxis |
| String | itsDoppler |
| If the data source was an image, these give the doppler type (if any) and x-unit IF an estimate was specified by the user via function addElements. | |
| Bool | itsXAbs |
| Bool | itsFitRegion |
| casa::ImageProfileFit::ImageProfileFit | ( | ) | [explicit] |
Constructor.
| casa::ImageProfileFit::~ImageProfileFit | ( | ) |
Destructor.
| casa::ImageProfileFit::ImageProfileFit | ( | const ImageProfileFit & | other | ) |
Copy constructor.
Uses copy semantics.
| ImageProfileFit& casa::ImageProfileFit::operator= | ( | const ImageProfileFit & | other | ) |
Assignment operator.
Uses copy semantics.
| void casa::ImageProfileFit::setData | ( | const ImageInterface< Float > & | image, | |
| const ImageRegion & | region, | |||
| uInt | profileAxis, | |||
| Bool | average = True | |||
| ) |
Set data via an image.
profileAxis specifies the profile pixel axis. You can either average the data over all other axes in the image (average=True) or fit all profiles in the image.
| void casa::ImageProfileFit::setData | ( | const ImageInterface< Float > & | image, | |
| const ImageInterface< Float > & | sigma, | |||
| const ImageRegion & | region, | |||
| uInt | profileAxis, | |||
| Bool | average = True | |||
| ) |
| void casa::ImageProfileFit::setData | ( | const ImageInterface< Float > & | image, | |
| uInt | profileAxis, | |||
| Bool | average = True | |||
| ) |
| void casa::ImageProfileFit::setData | ( | const ImageInterface< Float > & | image, | |
| const ImageInterface< Float > & | sigma, | |||
| uInt | profileAxis, | |||
| Bool | average = True | |||
| ) |
| void casa::ImageProfileFit::setData | ( | const CoordinateSystem & | cSys, | |
| uInt | ProfileAxis, | |||
| const Quantum< Vector< Float > > & | x, | |||
| const Quantum< Vector< Float > > & | y, | |||
| const Vector< Float > & | sigma, | |||
| Bool | isAbs, | |||
| const String & | doppler | |||
| ) |
Set the data directly, and provide a coordinate system and specify the profile axis in the coordinate system.
The x-units can be 'pix'. If absolute they must be 0-rel pixels. isAbs specifies whether the coordinates are absolute or relative to the reference pixel. If the weights vector, sigma is of zero length, it is treated as all unity.
| void casa::ImageProfileFit::setData | ( | const CoordinateSystem & | cSys, | |
| uInt | ProfileAxis, | |||
| const Quantum< Vector< Float > > & | x, | |||
| const Quantum< Vector< Float > > & | y, | |||
| const Vector< Bool > & | mask, | |||
| const Vector< Float > & | sigma, | |||
| Bool | isAbs, | |||
| const String & | doppler | |||
| ) |
Makes an estimate from the set data.
This means it generates SpectralElements holding the estimate, and replaces all elements you might have put in place with function addElement. Returns False if it can't find any elements.
| uInt casa::ImageProfileFit::addElements | ( | const RecordInterface & | estimate | ) |
Decode the Glish record holding SpectralElements and add them to the fitter.
Absolute pixel coordinate units are assumed to be 1-rel on input. Return the number of the element added.
| Bool casa::ImageProfileFit::getList | ( | RecordInterface & | rec, | |
| Bool | xAbsOut, | |||
| const String & | xUnitOut, | |||
| const String & | dopplerOut | |||
| ) |
Gets the internal SpectralElements (either estimate or fit depending on what function you called last) into a record.
Only returns False if the field is already defined. Absolute pixel coordinate units are 1-rel on output.
| SpectralList casa::ImageProfileFit::getList | ( | ) | const |
Gets the internal SpectralElements (either estimate or fit depending on what function you called last) into a SpectralList Only returns False if the field is already defined.
Absolute pixel coordinate units are 1-rel on output.
| void casa::ImageProfileFit::reset | ( | ) |
Reset the internal list of SpectralElements to null.
| uInt casa::ImageProfileFit::nElements | ( | ) |
Return number of SpectralElements set.
Do the fit of the averaged profile.
Specify the order of the baseline you would also like to fit for.
| void casa::ImageProfileFit::fit | ( | Bool | fillRecord, | |
| RecordInterface & | rec, | |||
| Bool | xAbsRec, | |||
| const String & | xUnitRec, | |||
| const String & | dopplerRec, | |||
| ImageInterface< Float > * | pFit, | |||
| ImageInterface< Float > * | pResid, | |||
| Int | order = -1 | |||
| ) |
Fit all profiles with shapes + optional polynomial in the region and write out images.
If fillRecord is True, the output record is filled with the the parameters of every fit. This can get VERY large so use with care. If the output images have a writable mask, the input mask is transferred to the output.
Find the residuals (fit or estimate) of the averaged profile.
Find the model (fit or estimate) of the averaged profile.
| void casa::ImageProfileFit::collapse | ( | Vector< Float > & | profile, | |
| Vector< Bool > & | mask, | |||
| uInt | profileAxis, | |||
| const MaskedLattice< Float > & | lat | |||
| ) | const [private] |
| SpectralElement casa::ImageProfileFit::convertSpectralElement | ( | const SpectralElement & | elIn, | |
| Bool | xAbsIn, | |||
| Bool | xAbsOut, | |||
| Bool | oneRelIn, | |||
| Bool | oneRelOut, | |||
| const String & | xUnitIn, | |||
| const String & | xUnitOut, | |||
| const String & | dopplerIn, | |||
| const String & | dopplerOut, | |||
| const String & | yUnitIn, | |||
| const String & | yUnitOut | |||
| ) | [private] |
Convert SE.
| void casa::ImageProfileFit::convertGaussianElementX | ( | SpectralElement & | el, | |
| CoordinateSystem & | cSys, | |||
| uInt | profileAxis, | |||
| Bool | absIn, | |||
| Bool | absOut, | |||
| const String & | unitIn, | |||
| const String & | unitOut, | |||
| const String & | dopplerIn, | |||
| const String & | dopplerOut, | |||
| Bool | oneRelIn, | |||
| Bool | oneRelOut | |||
| ) | [private] |
Convert Gaussian model x-units when data source is an image.
| SpectralList casa::ImageProfileFit::filterList | ( | const SpectralList & | listIn | ) | const [private] |
| Bool casa::ImageProfileFit::getElements | ( | RecordInterface & | rec, | |
| Bool | xAbsOut, | |||
| const String & | xUnitOut, | |||
| const String & | dopplerOut, | |||
| const SpectralList & | list | |||
| ) | [private] |
| void casa::ImageProfileFit::setData | ( | const ImageInterface< Float > *& | pSigma, | |
| const ImageInterface< Float > & | image, | |||
| const Slicer & | sl, | |||
| Bool | average | |||
| ) | [private] |
ImageInterface<Float>* casa::ImageProfileFit::itsImagePtr [private] |
Images holding data and weights.
Will be set only if fitting all profiles in region
Definition at line 230 of file ImageProfileFit.h.
Definition at line 231 of file ImageProfileFit.h.
Bool casa::ImageProfileFit::itsFitDone [private] |
Definition at line 233 of file ImageProfileFit.h.
Quantum<Vector<Float> > casa::ImageProfileFit::itsX [private] |
Holds the abcissa, ordinate and mask.
x-units will be pixels if data source is an image, else as specified in setData
Definition at line 238 of file ImageProfileFit.h.
Quantum<Vector<Float> > casa::ImageProfileFit::itsY [private] |
Definition at line 238 of file ImageProfileFit.h.
Vector<Bool> casa::ImageProfileFit::itsMask [private] |
Definition at line 239 of file ImageProfileFit.h.
Vector<Float> casa::ImageProfileFit::itsSigma [private] |
Definition at line 240 of file ImageProfileFit.h.
The fitters.
The first one does not have a polynomial in it The second one may.
Definition at line 244 of file ImageProfileFit.h.
Definition at line 245 of file ImageProfileFit.h.
The coordinate system if the data source was an image itsProfileAxis specified the profile axis in the image Will be -1 if data source was just vectors.
Definition at line 251 of file ImageProfileFit.h.
Int casa::ImageProfileFit::itsProfileAxis [private] |
Definition at line 252 of file ImageProfileFit.h.
String casa::ImageProfileFit::itsDoppler [private] |
If the data source was an image, these give the doppler type (if any) and x-unit IF an estimate was specified by the user via function addElements.
They are used in function getElements so that the output record has the same units.
Definition at line 259 of file ImageProfileFit.h.
Bool casa::ImageProfileFit::itsXAbs [private] |
Definition at line 260 of file ImageProfileFit.h.
Bool casa::ImageProfileFit::itsFitRegion [private] |
Definition at line 261 of file ImageProfileFit.h.
1.5.1