casa
$Rev:20696$
|
Abstract base class for moment calculator classes. More...
#include <MomentCalculator.h>
Public Member Functions | |
virtual | ~MomentCalcBase () |
virtual uInt | nFailedFits () const |
Returns the number of failed fits if doing fitting. | |
Protected Member Functions | |
void | accumSums (typename NumericTraits< T >::PrecisionType &s0, typename NumericTraits< T >::PrecisionType &s0Sq, typename NumericTraits< T >::PrecisionType &s1, typename NumericTraits< T >::PrecisionType &s2, Int &iMin, Int &iMax, T &dMin, T &dMax, const Int i, const T datum, const Double coord) const |
Accumulate statistical sums from a vector. | |
uInt | allNoise (T &dMean, const Vector< T > &data, const Vector< Bool > &mask, const T peakSNR, const T stdDeviation) const |
Determine if the spectrum is pure noise. | |
void | constructorCheck (Vector< T > &calcMoments, Vector< Bool > &calcMomentsMask, const Vector< Int > &selectMoments, const uInt nLatticeOut) const |
Check validity of constructor inputs. | |
void | costlyMoments (MomentsBase< T > &iMom, Bool &doMedianI, Bool &doMedianV, Bool &doAbsDev) const |
Find out from the selectMoments array whether we want to compute the more expensive moments. | |
PGPlotter & | device (MomentsBase< T > &iMom) const |
Return reference plotting device from ImageMoments or MSMoments object. | |
Bool | doAuto (const MomentsBase< T > &iMom) const |
Return automatic/interactive switch from the ImageMoments or MSMoments object. | |
void | doCoordCalc (Bool &doCoordProfile, Bool &doCoordRandom, const MomentsBase< T > &iMom) const |
Return the Bool saying whether we need to compute coordinates or not for the requested moments. | |
Bool | doFit (const MomentsBase< T > &iMom) const |
Return the Bool from the ImageMoments or MSMoments object saying whether we are going to fit Gaussians to the profiles or not. | |
void | drawHorizontal (const T &y, PGPlotter &plotter) const |
Draw a horizontal line across the full x range of the plot. | |
void | drawLine (const Vector< T > &x, const Vector< T > &y, PGPlotter &plotter) const |
Draw a spectrum on the current panel with the box already drawn on. | |
Bool | drawSpectrum (const Vector< T > &x, const Vector< T > &y, const Vector< Bool > &mask, const Bool fixedYLimits, const T yMinAuto, const T yMaxAuto, const String xLabel, const String yLabel, const String title, const Bool advancePanel, PGPlotter &plotter) const |
Draw and label a spectrum on the current or next panel. | |
void | drawMeanSigma (const T dMean, const T dSigma, PGPlotter &plotter) const |
Draw on lines marking the mean and +/- sigma. | |
void | drawVertical (const T x, const T yMin, const T yMax, PGPlotter &plotter) const |
Draw a vertical line of the given length at a given abcissa. | |
Bool | findNextDatum (uInt &iFound, const uInt &n, const Vector< Bool > &mask, const uInt &iStart, const Bool &findGood) const |
Find the next masked or unmasked point in a vector. | |
Bool | fitGaussian (uInt &nFailed, T &peak, T &pos, T &width, T &level, const Vector< T > &x, const Vector< T > &y, const Vector< Bool > &mask, const T peakGuess, const T posGuess, const T widthGuess, const T levelGuess) const |
Fit a Gaussian to x and y arrays given guesses for the gaussian parameters. | |
Bool | fixedYLimits (const MomentsBase< T > &iMom) const |
Return the fixed Y-plotting limits switch from the ImageMoments or MSMoments object. | |
Bool | getAutoGaussianFit (uInt &nFailed, Vector< T > &gaussPars, const Vector< T > &x, const Vector< T > &y, const Vector< Bool > &mask, const T peakSNR, const T stdDeviation, PGPlotter &plotter, const Bool fixedYLimits, const T yMinAuto, const T yMaxAuto, const String xLabel, const String yLabel, const String title) const |
Automatically fit a Gaussian to a spectrum, including finding the starting guesses. | |
Bool | getAutoGaussianGuess (T &peakGuess, T &posGuess, T &widthGuess, T &levelGuess, const Vector< T > &x, const Vector< T > &y, const Vector< Bool > &mask) const |
Automatically work out a guess for the Gaussian parameters Returns False if all pixels masked. | |
void | getButton (Bool &reject, Bool &redo, PGPlotter &plotter) const |
Read the cursor button. | |
Bool | getInterGaussianFit (uInt &nFailed, Vector< T > &gaussPars, LogIO &os, const Vector< T > &x, const Vector< T > &y, const Vector< Bool > &mask, const Bool fixedYLimits, const T yMinAuto, const T yMaxAuto, const String xLabel, const String yLabel, const String title, PGPlotter &plotter) const |
Interactively define a guess for a Gaussian fit, and then do the fit. | |
void | getInterGaussianGuess (T &peakGuess, T &posGuess, T &widthGuess, Vector< Int > &window, Bool &reject, LogIO &os, const Int nPts, PGPlotter &plotter) const |
Interactively define a guess for the Gaussian parameters. | |
Bool | getLoc (T &x, Bool &allSubsequent, Bool &ditch, Bool &redo, const Bool final, PGPlotter &plotter) const |
Read the cursor and return its coordinates if not off the plot. | |
Double | getMomentCoord (MomentsBase< T > &iMom, Vector< Double > &pixelIn, Vector< Double > &worldOut, const Double momentPixel) const |
Compute the world coordinate for the given moment axis pixel. | |
void | lineSegments (uInt &nSeg, Vector< uInt > &start, Vector< uInt > &nPts, const Vector< Bool > &mask) const |
Examine a mask and determine how many segments of unmasked points it consists of. | |
void | makeAbcissa (Vector< T > &x, const Int &n) const |
Resize an abcissa vector for plotting. | |
Int & | momentAxis (MomentsBase< T > &iMom) const |
Return the moment axis from the ImageMoments or MSMoments object. | |
String | momentAxisName (const CoordinateSystem &, const MomentsBase< T > &iMom) const |
Return the name of the moment/profile axis. | |
uInt | nMaxMoments () const |
Return the number of moments that the ImageMoments or MSMoments class can calculate. | |
T & | peakSNR (MomentsBase< T > &iMom) const |
Return the peak SNR for determination of all noise spectra from the ImageMoments or MSMoments object. | |
void | selectRange (Vector< T > &pixelRange, Bool &doInclude, Bool &doExlude, MomentsBase< T > &iMom) const |
Return the selected pixel intensity range from the ImageMoments or MSMoments object and the Bools describing whether it is inclusion or exclusion. | |
Vector< Int > | selectMoments (MomentsBase< T > &iMom) const |
The MomentCalculators compute a vector of all possible moments. | |
void | setCalcMoments (MomentsBase< T > &iMom, Vector< T > &calcMoments, Vector< Bool > &calcMomentsMask, Vector< Double > &pixelIn, Vector< Double > &worldOut, Bool doCoord, Double integratedScaleFactor, T dMedian, T vMedian, Int nPts, typename NumericTraits< T >::PrecisionType s0, typename NumericTraits< T >::PrecisionType s1, typename NumericTraits< T >::PrecisionType s2, typename NumericTraits< T >::PrecisionType s0Sq, typename NumericTraits< T >::PrecisionType sumAbsDev, T dMin, T dMax, Int iMin, Int iMax) const |
Fill the ouput moments array. | |
void | setPosLabel (String &title, const IPosition &pos) const |
Fill a string with the position of the cursor. | |
void | setCoordinateSystem (CoordinateSystem &cSys, MomentsBase< T > &iMom) |
Install CoordinateSystem and SpectralCoordinate in protected data members. | |
void | setUpCoords (MomentsBase< T > &iMom, Vector< Double > &pixelIn, Vector< Double > &worldOut, Vector< Double > &sepWorldCoord, LogIO &os, Double &integratedScaleFactor, const CoordinateSystem &cSys, Bool doCoordProfile, Bool doCoordRandom) const |
Set up separable moment axis coordinate vector and conversion vectors if not separable. | |
void | showGaussFit (const T peak, const T pos, const T width, const T level, const Vector< T > &x, const Vector< T > &y, const Vector< Bool > &mask, PGPlotter &plotter) const |
Plot the Gaussian fit. | |
Bool | stats (T &dMin, T &dMax, uInt &minPos, uInt &maxPos, T &mean, const Vector< T > &profile, const Vector< Bool > &mask) const |
Find some statistics from teh masked vector. | |
T & | stdDeviation (MomentsBase< T > &iMom) const |
Return standard deviation of image from ImageMoments or MSMoments object. | |
void | yAutoMinMax (T &yMin, T &yMax, MomentsBase< T > &iMom) const |
Return the auto y min and max from the ImageMoments or MSMoments object. | |
virtual void | init (uInt nOutPixelsPerCollapse) |
Check if #pixels is indeed 1. | |
Static Protected Member Functions | |
static Float | convertT (const T value) |
Convert from T to Float for plotting. | |
static T | convertF (const Float value) |
Convert from Float (from plotting) to a T | |
Protected Attributes | |
CoordinateSystem | cSys_p |
A number of private data members are kept here in the base class as they are common to the derived classes. | |
Vector< T > | calcMoments_p |
This vector is a container for all the possible moments that can be calculated. | |
Vector< Bool > | calcMomentsMask_p |
Vector< Int > | selectMoments_p |
This vector tells us which elements of the calcMoments_p vector we wish to select. | |
Bool | doMedianI_p |
Although the general philosophy of these classes is to compute all the posisble moments and then select the ones we want, some of them are too expensive to calculate unless they are really wanted. | |
Bool | doMedianV_p |
Bool | doAbsDev_p |
Vector< Double > | pixelIn_p |
These vectors are used to transform coordinates between pixel and world. | |
Vector< Double > | worldOut_p |
Bool | doCoordProfile_p |
All computations involving Coordinate conversions are relatively expensive These Bools signifies whether we need coordinate calculations or not for the full profile, and for some occaisional calculations. | |
Bool | doCoordRandom_p |
Vector< Double > | sepWorldCoord_p |
This vector houses the world coordinate values for the profile if it was from a separable axis. | |
PGPlotter | plotter_p |
This gives the plotter name. | |
Bool | fixedYLimits_p |
This Bool tells us whether we want to see all profiles plotted with the Y range or whether they are to be scaled individually. | |
T | yMinAuto_p |
When we are plotting, if we have asked to all profiles with the same Y min and max, these are the values to use. | |
T | yMaxAuto_p |
Vector< T > | abcissa_p |
This vector is used to hold the abcissa values when plotting profiles. | |
String | momAxisType_p |
This string tells us the name of the moment axis (VELO or FREQ etc) | |
uInt | nFailed_p |
This is the number of Gaussian fits that failed. | |
Double | integratedScaleFactor_p |
This scale factor is the increment along the moment axis applied so that units for the Integrated moment are like Jy/beam.km/s (or whatever is needed for the moment axis units) For non-linear velocities (e.g. |
Abstract base class for moment calculator classes.
Public interface
This class, its concrete derived classes, and the classes LineCollapser, ImageMoments, MSMoments, and LatticeApply are connected as follows. LatticeApply offers functions so that the application programmer does not need to worry about how to optimally iterate through a Lattice; it deals with tiling and to a lesser extent memory. LatticeApply functions are used by offering a class object to them that has a member function with a name and signature specified by an abstract base class that LatticeApply uses and the offered class inherits from. Specifically, in this case, MomentCalcBase inherits from LineCollapser and LatticeApply uses objects and methods of this class (but does not inherit from it). This defines the functions collapse
and multiProcess
which operate on a vector extracted from a Lattice. The former returns one number, the latter a vector of numbers from that profile. MomentCalcBase is a base class for for moment calculation and the multiProcess
functions are used to compute moments (e.g., mean, sum, sum squared, intensity weighted velocity etc).
It is actually the concrete classes derived from MomentCalcBase (call them, as a group, the MomentCalculator classes) that implement the multiProcess
functions. These derived classes allow different algorithms to be written with which moments of the vector can be computed.
Now, so far, we have a LatticeApply function which iterates through Lattices, extracts vectors, and offers them up to functions implemented in the derived MomentCalculator classes to compute the moments. As well as that, we need some class to actually construct the MomentCalculator classes and to feed them to LatticeApply. This is the role of the ImageMoments or MSMoments classes. They are a high level class which takes control information from users specifying which moments they would like to calculate and how. They also provide the ancilliary masking lattice to the MomentCalculator constructors. The actual computational work is done by the MomentCalculator classes. So MomentsBase, MomentCalcBase and their derived MomentCalculator classes are really one unit; none of them are useful without the others. The separation of functionality is caused by having the LatticeApply class that knows all about optimally iterating through Lattices.
The coupling between these classes is done partly by the "friendship". MomentsBase and its inheritances grant friendship to MomentCalcBase so that the latter has access to the private data and private functions of the formers. MomentCalcBase then operates as an interface between its derived MomentCalculator classes and ImageMoments or MSMoments. It retrieves private data from these classes, and also activates private functions in these classes, on behalf of the MomentCalculator classes. The rest of the coupling is done via the constructors of the derived MomentCalculator classes.
Finally, MomentCalcBase also has a number of protected functions that are common to its derived classes (e.g. plotting, fitting, accumulating sums etc). It also has protected data that is common to all the MomentCalculator classes. This protected data is accessed directly by name rather than with interface functions as there is too much of it. Of course, since MomentCalcBase is an abstract base class, it is up to the MomentCalculator classes to give the MomentCalcBase protected data objects values.
For discussion about different moments and algorithms to compute them see the discussion in MomentsBase , ImageMoments , MSMoments and also in the derived classes documentation.
Since MomentCalcBase is an abstract class, we defer code examples to the derived classes.
We were desirous of writing functions to optimally iterate through Lattices so that the application programmer did not have to know anything about tiling or memory if possible. These are the LatticeApply functions. To incorporate MomentsBase and its inheritances into this scheme required some of it to be shifted into MomentCalcBase and its derived classes.
Tip: Note that there are is assignment operator or copy constructor; Do not use the ones the system would generate either;
Definition at line 147 of file MomentCalculator.h.
virtual casa::MomentCalcBase< T >::~MomentCalcBase | ( | ) | [virtual] |
void casa::MomentCalcBase< T >::accumSums | ( | typename NumericTraits< T >::PrecisionType & | s0, |
typename NumericTraits< T >::PrecisionType & | s0Sq, | ||
typename NumericTraits< T >::PrecisionType & | s1, | ||
typename NumericTraits< T >::PrecisionType & | s2, | ||
Int & | iMin, | ||
Int & | iMax, | ||
T & | dMin, | ||
T & | dMax, | ||
const Int | i, | ||
const T | datum, | ||
const Double | coord | ||
) | const [inline, protected] |
Accumulate statistical sums from a vector.
Accumulate statistical sums from this datum
Input: i Index datum Pixel value coord Coordinate value on moment axis Input/output: iMin,max index of dMin and dMax dMin,dMax minimum and maximum value Output: s0 sum (I) s0Sq sum (I*I) s1 sum (I*v) s2 sum (I*v*v)
Definition at line 1093 of file MomentCalculator.h.
uInt casa::MomentCalcBase< T >::allNoise | ( | T & | dMean, |
const Vector< T > & | data, | ||
const Vector< Bool > & | mask, | ||
const T | peakSNR, | ||
const T | stdDeviation | ||
) | const [protected] |
Determine if the spectrum is pure noise.
void casa::MomentCalcBase< T >::constructorCheck | ( | Vector< T > & | calcMoments, |
Vector< Bool > & | calcMomentsMask, | ||
const Vector< Int > & | selectMoments, | ||
const uInt | nLatticeOut | ||
) | const [protected] |
Check validity of constructor inputs.
T casa::MomentCalcBase< T >::convertF | ( | const Float | value | ) | [inline, static, protected] |
Convert from Float
(from plotting) to a T
Definition at line 1142 of file MomentCalculator.h.
References casa::MomentsBase< T >::convertF().
Float casa::MomentCalcBase< T >::convertT | ( | const T | value | ) | [inline, static, protected] |
Convert from T
to Float
for plotting.
Definition at line 1136 of file MomentCalculator.h.
References casa::MomentsBase< T >::convertT().
void casa::MomentCalcBase< T >::costlyMoments | ( | MomentsBase< T > & | iMom, |
Bool & | doMedianI, | ||
Bool & | doMedianV, | ||
Bool & | doAbsDev | ||
) | const [protected] |
Find out from the selectMoments array whether we want to compute the more expensive moments.
PGPlotter& casa::MomentCalcBase< T >::device | ( | MomentsBase< T > & | iMom | ) | const [protected] |
Return reference plotting device from ImageMoments or MSMoments object.
Bool casa::MomentCalcBase< T >::doAuto | ( | const MomentsBase< T > & | iMom | ) | const [protected] |
Return automatic/interactive switch from the ImageMoments or MSMoments object.
void casa::MomentCalcBase< T >::doCoordCalc | ( | Bool & | doCoordProfile, |
Bool & | doCoordRandom, | ||
const MomentsBase< T > & | iMom | ||
) | const [protected] |
Return the Bool saying whether we need to compute coordinates or not for the requested moments.
Bool casa::MomentCalcBase< T >::doFit | ( | const MomentsBase< T > & | iMom | ) | const [protected] |
Return the Bool from the ImageMoments or MSMoments object saying whether we are going to fit Gaussians to the profiles or not.
void casa::MomentCalcBase< T >::drawHorizontal | ( | const T & | y, |
PGPlotter & | plotter | ||
) | const [protected] |
Draw a horizontal line across the full x range of the plot.
void casa::MomentCalcBase< T >::drawLine | ( | const Vector< T > & | x, |
const Vector< T > & | y, | ||
PGPlotter & | plotter | ||
) | const [protected] |
Draw a spectrum on the current panel with the box already drawn on.
void casa::MomentCalcBase< T >::drawMeanSigma | ( | const T | dMean, |
const T | dSigma, | ||
PGPlotter & | plotter | ||
) | const [protected] |
Draw on lines marking the mean and +/- sigma.
Bool casa::MomentCalcBase< T >::drawSpectrum | ( | const Vector< T > & | x, |
const Vector< T > & | y, | ||
const Vector< Bool > & | mask, | ||
const Bool | fixedYLimits, | ||
const T | yMinAuto, | ||
const T | yMaxAuto, | ||
const String | xLabel, | ||
const String | yLabel, | ||
const String | title, | ||
const Bool | advancePanel, | ||
PGPlotter & | plotter | ||
) | const [protected] |
Draw and label a spectrum on the current or next panel.
void casa::MomentCalcBase< T >::drawVertical | ( | const T | x, |
const T | yMin, | ||
const T | yMax, | ||
PGPlotter & | plotter | ||
) | const [protected] |
Draw a vertical line of the given length at a given abcissa.
Bool casa::MomentCalcBase< T >::findNextDatum | ( | uInt & | iFound, |
const uInt & | n, | ||
const Vector< Bool > & | mask, | ||
const uInt & | iStart, | ||
const Bool & | findGood | ||
) | const [protected] |
Find the next masked or unmasked point in a vector.
Bool casa::MomentCalcBase< T >::fitGaussian | ( | uInt & | nFailed, |
T & | peak, | ||
T & | pos, | ||
T & | width, | ||
T & | level, | ||
const Vector< T > & | x, | ||
const Vector< T > & | y, | ||
const Vector< Bool > & | mask, | ||
const T | peakGuess, | ||
const T | posGuess, | ||
const T | widthGuess, | ||
const T | levelGuess | ||
) | const [protected] |
Fit a Gaussian to x and y arrays given guesses for the gaussian parameters.
Bool casa::MomentCalcBase< T >::fixedYLimits | ( | const MomentsBase< T > & | iMom | ) | const [protected] |
Return the fixed Y-plotting limits switch from the ImageMoments or MSMoments object.
Bool casa::MomentCalcBase< T >::getAutoGaussianFit | ( | uInt & | nFailed, |
Vector< T > & | gaussPars, | ||
const Vector< T > & | x, | ||
const Vector< T > & | y, | ||
const Vector< Bool > & | mask, | ||
const T | peakSNR, | ||
const T | stdDeviation, | ||
PGPlotter & | plotter, | ||
const Bool | fixedYLimits, | ||
const T | yMinAuto, | ||
const T | yMaxAuto, | ||
const String | xLabel, | ||
const String | yLabel, | ||
const String | title | ||
) | const [protected] |
Automatically fit a Gaussian to a spectrum, including finding the starting guesses.
Bool casa::MomentCalcBase< T >::getAutoGaussianGuess | ( | T & | peakGuess, |
T & | posGuess, | ||
T & | widthGuess, | ||
T & | levelGuess, | ||
const Vector< T > & | x, | ||
const Vector< T > & | y, | ||
const Vector< Bool > & | mask | ||
) | const [protected] |
Automatically work out a guess for the Gaussian parameters Returns False if all pixels masked.
void casa::MomentCalcBase< T >::getButton | ( | Bool & | reject, |
Bool & | redo, | ||
PGPlotter & | plotter | ||
) | const [protected] |
Read the cursor button.
Bool casa::MomentCalcBase< T >::getInterGaussianFit | ( | uInt & | nFailed, |
Vector< T > & | gaussPars, | ||
LogIO & | os, | ||
const Vector< T > & | x, | ||
const Vector< T > & | y, | ||
const Vector< Bool > & | mask, | ||
const Bool | fixedYLimits, | ||
const T | yMinAuto, | ||
const T | yMaxAuto, | ||
const String | xLabel, | ||
const String | yLabel, | ||
const String | title, | ||
PGPlotter & | plotter | ||
) | const [protected] |
Interactively define a guess for a Gaussian fit, and then do the fit.
Do this repeatedly until the user is content.
void casa::MomentCalcBase< T >::getInterGaussianGuess | ( | T & | peakGuess, |
T & | posGuess, | ||
T & | widthGuess, | ||
Vector< Int > & | window, | ||
Bool & | reject, | ||
LogIO & | os, | ||
const Int | nPts, | ||
PGPlotter & | plotter | ||
) | const [protected] |
Interactively define a guess for the Gaussian parameters.
Bool casa::MomentCalcBase< T >::getLoc | ( | T & | x, |
Bool & | allSubsequent, | ||
Bool & | ditch, | ||
Bool & | redo, | ||
const Bool | final, | ||
PGPlotter & | plotter | ||
) | const [protected] |
Read the cursor and return its coordinates if not off the plot.
Also interpret which button was pressed
Double casa::MomentCalcBase< T >::getMomentCoord | ( | MomentsBase< T > & | iMom, |
Vector< Double > & | pixelIn, | ||
Vector< Double > & | worldOut, | ||
const Double | momentPixel | ||
) | const [inline, protected] |
Compute the world coordinate for the given moment axis pixel.
Find the value of the world coordinate on the moment axis for the given moment axis pixel value.
Input momentPixel is the index in the profile extracted from the data Input/output pixelIn Pixels to convert. Must all be filled in except for pixelIn(momentPixel). worldOut Vector to hold result
Should really return a Fallible as I don't check and see if the coordinate transformation fails or not
Should really check the result is True, but for speed ...
Definition at line 1149 of file MomentCalculator.h.
virtual void casa::MomentCalcBase< T >::init | ( | uInt | nOutPixelsPerCollapse | ) | [protected, virtual] |
Check if #pixels is indeed 1.
Implements casa::LineCollapser< T, T >.
void casa::MomentCalcBase< T >::lineSegments | ( | uInt & | nSeg, |
Vector< uInt > & | start, | ||
Vector< uInt > & | nPts, | ||
const Vector< Bool > & | mask | ||
) | const [protected] |
Examine a mask and determine how many segments of unmasked points it consists of.
void casa::MomentCalcBase< T >::makeAbcissa | ( | Vector< T > & | x, |
const Int & | n | ||
) | const [protected] |
Resize an abcissa vector for plotting.
Int& casa::MomentCalcBase< T >::momentAxis | ( | MomentsBase< T > & | iMom | ) | const [protected] |
Return the moment axis from the ImageMoments or MSMoments object.
String casa::MomentCalcBase< T >::momentAxisName | ( | const CoordinateSystem & | , |
const MomentsBase< T > & | iMom | ||
) | const [protected] |
Return the name of the moment/profile axis.
uInt casa::MomentCalcBase< T >::nFailedFits | ( | ) | const [inline, virtual] |
Returns the number of failed fits if doing fitting.
Definition at line 1085 of file MomentCalculator.h.
uInt casa::MomentCalcBase< T >::nMaxMoments | ( | ) | const [protected] |
Return the number of moments that the ImageMoments or MSMoments class can calculate.
T& casa::MomentCalcBase< T >::peakSNR | ( | MomentsBase< T > & | iMom | ) | const [protected] |
Return the peak SNR for determination of all noise spectra from the ImageMoments or MSMoments object.
Vector<Int> casa::MomentCalcBase< T >::selectMoments | ( | MomentsBase< T > & | iMom | ) | const [protected] |
The MomentCalculators compute a vector of all possible moments.
This function returns a vector which selects the desired moments from that "all moment" vector.
void casa::MomentCalcBase< T >::selectRange | ( | Vector< T > & | pixelRange, |
Bool & | doInclude, | ||
Bool & | doExlude, | ||
MomentsBase< T > & | iMom | ||
) | const [protected] |
Return the selected pixel intensity range from the ImageMoments or MSMoments object and the Bools describing whether it is inclusion or exclusion.
void casa::MomentCalcBase< T >::setCalcMoments | ( | MomentsBase< T > & | iMom, |
Vector< T > & | calcMoments, | ||
Vector< Bool > & | calcMomentsMask, | ||
Vector< Double > & | pixelIn, | ||
Vector< Double > & | worldOut, | ||
Bool | doCoord, | ||
Double | integratedScaleFactor, | ||
T | dMedian, | ||
T | vMedian, | ||
Int | nPts, | ||
typename NumericTraits< T >::PrecisionType | s0, | ||
typename NumericTraits< T >::PrecisionType | s1, | ||
typename NumericTraits< T >::PrecisionType | s2, | ||
typename NumericTraits< T >::PrecisionType | s0Sq, | ||
typename NumericTraits< T >::PrecisionType | sumAbsDev, | ||
T | dMin, | ||
T | dMax, | ||
Int | iMin, | ||
Int | iMax | ||
) | const [protected] |
Fill the ouput moments array.
void casa::MomentCalcBase< T >::setCoordinateSystem | ( | CoordinateSystem & | cSys, |
MomentsBase< T > & | iMom | ||
) | [protected] |
Install CoordinateSystem and SpectralCoordinate in protected data members.
void casa::MomentCalcBase< T >::setPosLabel | ( | String & | title, |
const IPosition & | pos | ||
) | const [protected] |
Fill a string with the position of the cursor.
void casa::MomentCalcBase< T >::setUpCoords | ( | MomentsBase< T > & | iMom, |
Vector< Double > & | pixelIn, | ||
Vector< Double > & | worldOut, | ||
Vector< Double > & | sepWorldCoord, | ||
LogIO & | os, | ||
Double & | integratedScaleFactor, | ||
const CoordinateSystem & | cSys, | ||
Bool | doCoordProfile, | ||
Bool | doCoordRandom | ||
) | const [protected] |
Set up separable moment axis coordinate vector and conversion vectors if not separable.
void casa::MomentCalcBase< T >::showGaussFit | ( | const T | peak, |
const T | pos, | ||
const T | width, | ||
const T | level, | ||
const Vector< T > & | x, | ||
const Vector< T > & | y, | ||
const Vector< Bool > & | mask, | ||
PGPlotter & | plotter | ||
) | const [protected] |
Plot the Gaussian fit.
Bool casa::MomentCalcBase< T >::stats | ( | T & | dMin, |
T & | dMax, | ||
uInt & | minPos, | ||
uInt & | maxPos, | ||
T & | mean, | ||
const Vector< T > & | profile, | ||
const Vector< Bool > & | mask | ||
) | const [protected] |
Find some statistics from teh masked vector.
Returns False if no unmasked points.
T& casa::MomentCalcBase< T >::stdDeviation | ( | MomentsBase< T > & | iMom | ) | const [protected] |
Return standard deviation of image from ImageMoments or MSMoments object.
void casa::MomentCalcBase< T >::yAutoMinMax | ( | T & | yMin, |
T & | yMax, | ||
MomentsBase< T > & | iMom | ||
) | const [protected] |
Return the auto y min and max from the ImageMoments or MSMoments object.
Vector<T> casa::MomentCalcBase< T >::abcissa_p [protected] |
This vector is used to hold the abcissa values when plotting profiles.
Definition at line 208 of file MomentCalculator.h.
Vector<T> casa::MomentCalcBase< T >::calcMoments_p [protected] |
This vector is a container for all the possible moments that can be calculated.
They are in the order given by the MomentsBase enum MomentTypes
Definition at line 167 of file MomentCalculator.h.
Vector<Bool> casa::MomentCalcBase< T >::calcMomentsMask_p [protected] |
Definition at line 168 of file MomentCalculator.h.
CoordinateSystem casa::MomentCalcBase< T >::cSys_p [protected] |
A number of private data members are kept here in the base class as they are common to the derived classes.
Since this class is abstract, they have to be filled by the derived classes.
Definition at line 162 of file MomentCalculator.h.
Bool casa::MomentCalcBase< T >::doAbsDev_p [protected] |
Definition at line 180 of file MomentCalculator.h.
Bool casa::MomentCalcBase< T >::doCoordProfile_p [protected] |
All computations involving Coordinate conversions are relatively expensive These Bools signifies whether we need coordinate calculations or not for the full profile, and for some occaisional calculations.
Definition at line 188 of file MomentCalculator.h.
Bool casa::MomentCalcBase< T >::doCoordRandom_p [protected] |
Definition at line 188 of file MomentCalculator.h.
Bool casa::MomentCalcBase< T >::doMedianI_p [protected] |
Although the general philosophy of these classes is to compute all the posisble moments and then select the ones we want, some of them are too expensive to calculate unless they are really wanted.
These are the median moments and those that require a second pass. These control Bools tell us whether we really want to compute the expensive ones.
Definition at line 180 of file MomentCalculator.h.
Bool casa::MomentCalcBase< T >::doMedianV_p [protected] |
Definition at line 180 of file MomentCalculator.h.
Bool casa::MomentCalcBase< T >::fixedYLimits_p [protected] |
This Bool tells us whether we want to see all profiles plotted with the Y range or whether they are to be scaled individually.
Definition at line 201 of file MomentCalculator.h.
Double casa::MomentCalcBase< T >::integratedScaleFactor_p [protected] |
This scale factor is the increment along the moment axis applied so that units for the Integrated moment are like Jy/beam.km/s (or whatever is needed for the moment axis units) For non-linear velocities (e.g.
optical) this is approximate only and is computed at the reference pixel
Definition at line 221 of file MomentCalculator.h.
String casa::MomentCalcBase< T >::momAxisType_p [protected] |
This string tells us the name of the moment axis (VELO or FREQ etc)
Definition at line 211 of file MomentCalculator.h.
uInt casa::MomentCalcBase< T >::nFailed_p [protected] |
This is the number of Gaussian fits that failed.
Definition at line 214 of file MomentCalculator.h.
Vector<Double> casa::MomentCalcBase< T >::pixelIn_p [protected] |
These vectors are used to transform coordinates between pixel and world.
Definition at line 183 of file MomentCalculator.h.
PGPlotter casa::MomentCalcBase< T >::plotter_p [protected] |
This gives the plotter name.
If no plotting, it won't be attached
Definition at line 197 of file MomentCalculator.h.
Vector<Int> casa::MomentCalcBase< T >::selectMoments_p [protected] |
This vector tells us which elements of the calcMoments_p vector we wish to select.
Definition at line 172 of file MomentCalculator.h.
Vector<Double> casa::MomentCalcBase< T >::sepWorldCoord_p [protected] |
This vector houses the world coordinate values for the profile if it was from a separable axis.
This means this vector can be pre computed just once, instead of working out the coordinates for each profile (expensive). It should only be filled if doCoordCalc_p is True
Definition at line 194 of file MomentCalculator.h.
Vector<Double> casa::MomentCalcBase< T >::worldOut_p [protected] |
Definition at line 183 of file MomentCalculator.h.
T casa::MomentCalcBase< T >::yMaxAuto_p [protected] |
Definition at line 205 of file MomentCalculator.h.
T casa::MomentCalcBase< T >::yMinAuto_p [protected] |
When we are plotting, if we have asked to all profiles with the same Y min and max, these are the values to use.
Definition at line 205 of file MomentCalculator.h.