casacore
|
Compute and display various statistics from a lattice. More...
#include <LatticeStatistics.h>
Classes | |
struct | AlgConf |
Public Types | |
typedef NumericTraits< T >::PrecisionType | AccumType |
typedef std::pair< String, String > | stat_element |
typedef std::list< stat_element > | stat_list |
![]() | |
enum | StatisticsTypes { NPTS, SUM, SUMSQ, MEDIAN, MEDABSDEVMED, QUARTILE, Q1, Q3, MIN, MAX, MEAN, VARIANCE, SIGMA, RMS, FLUX, NSTATS, NACCUM } |
This enum StatisticTypes is provided for use with the LatticeStatistics<T>::setPlotting function. More... | |
Public Member Functions | |
LatticeStatistics (const MaskedLattice< T > &lattice, LogIO &os, Bool showProgress=True, Bool forceDisk=False) | |
Constructor takes the lattice and a LogIO object for logging. More... | |
LatticeStatistics (const MaskedLattice< T > &lattice, Bool showProgress=True, Bool forceDisk=False) | |
Constructor takes the lattice only. More... | |
LatticeStatistics (const LatticeStatistics< T > &other) | |
Copy constructor. More... | |
virtual | ~LatticeStatistics () |
Destructor. More... | |
LatticeStatistics< T > & | operator= (const LatticeStatistics< T > &other) |
Assignment operator. More... | |
Bool | setAxes (const Vector< Int > &cursorAxes) |
Set the cursor axes (0 relative). More... | |
Bool | setInExCludeRange (const Vector< T > &include, const Vector< T > &exclude, Bool setMinMaxToInclude=False) |
You may specify a pixel intensity range as either one for which all pixels in that range are included or one for which all pixels in that range are excluded. More... | |
Bool | setList (const Bool &doList) |
This function allows you to control whether the statistics are written to the output stream if you are also making a plot. More... | |
Bool | display () |
Display the statistics by listing and/or plotting them. More... | |
Bool | getLayerStats (String &stats, Double area, Int zAxis=-1, Int zLayer=-1, Int hAxis=-1, Int hLayer=-1) |
Bool | getLayerStats (stat_list &stats, Double area, Int zAxis=-1, Int zLayer=-1, Int hAxis=-1, Int hLayer=-1) |
Vector< Int > | displayAxes () const |
Return the display axes. More... | |
Bool | getStatistic (Array< AccumType > &stat, LatticeStatsBase::StatisticsTypes type, Bool dropDeg=True) |
Recover the desired Statistic into an array. More... | |
Bool | getConvertedStatistic (Array< T > &stat, LatticeStatsBase::StatisticsTypes type, Bool dropDeg=True) |
Bool | getMinMaxPos (IPosition &minPos, IPosition &maxPos) |
Recover position of min and max. More... | |
Bool | getStats (Vector< AccumType > &, const IPosition &pos, const Bool posInLattice=False) |
This function gets a vector containing all the statistics for a given location. More... | |
void | resetError () |
Reset argument error condition. More... | |
Bool | getFullMinMax (T &dataMin, T &dataMax) |
Get full lattice min and max only. More... | |
String | errorMessage () const |
Recover last error message. More... | |
Bool | setNewLattice (const MaskedLattice< T > &lattice) |
Set a new MaskedLattice object. More... | |
Bool | hasLogger () const |
Did we construct with a logger ? More... | |
void | configureClassical () |
configure object to use Classical Statistics The time, t_x, it takes to compute classical statistics using algorithm x, can be modeled by t_x = n_sets*(a_x + b_x*n_el) where n_sets is the number of independent sets of data to compute stats on, each containing n_el number of elements. More... | |
void | configureClassical (Double aOld, Double bOld, Double aNew, Double bNew) |
void | configureFitToHalf (FitToHalfStatisticsData::CENTER centerType=FitToHalfStatisticsData::CMEAN, FitToHalfStatisticsData::USE_DATA useData=FitToHalfStatisticsData::LE_CENTER, AccumType centerValue=0) |
configure to use fit to half algorithm. More... | |
void | configureHingesFences (Double f) |
configure to use hinges-fences algorithm More... | |
void | configureChauvenet (Double zscore=-1, Int maxIterations=-1) |
configure to use Chauvenet's criterion More... | |
std::map< String, uInt > | getChauvenetNiter () const |
get number of iterations associated with Chauvenet criterion algorithm More... | |
Protected Member Functions | |
virtual Bool | _canDoFlux () const |
Virtual Functions. More... | |
virtual Quantum< AccumType > | _flux (Bool &, AccumType, Double) const |
virtual void | listMinMax (ostringstream &osMin, ostringstream &osMax, Int oWidth, DataType type) |
virtual Bool | listStats (Bool hasBeam, const IPosition &dPos, const Matrix< AccumType > &ord) |
List the statistics to the logger. More... | |
virtual Bool | listLayerStats (const Matrix< AccumType > &ord, ostringstream &rslt, Int zLayer) |
virtual void | getLabels (String &higherOrderLabel, String &xAxisLabel, const IPosition &dPos) const |
*IPosition | locInLattice (const IPosition &storagePosition, Bool relativeToParent=True) const |
Given a location in the storage lattice, convert those locations on the non-statistics axis (the last one) and optionally account for the lattice subsectioning. More... | |
void | setStream (ostream &os, Int oPrec) |
Non-virtual functions. More... | |
IPosition | _storageLatticeShape () const |
get the storage lattice shape More... | |
virtual Bool | _computeFlux (Array< AccumType > &flux, const Array< AccumType > &npts, const Array< AccumType > &sum) |
virtual Bool | _computeFlux (Quantum< AccumType > &flux, AccumType sum, const IPosition &pos, Bool posInLattice) |
void | _latticePosToStoragePos (IPosition &storagePos, const IPosition &latticePos) |
convert a position in the input lattice to the corresponding position in the stats storage lattice. More... | |
Protected Attributes | |
LogIO | os_p |
Vector< Int > | cursorAxes_p |
Vector< Int > | displayAxes_p |
Bool | goodParameterStatus_p |
Bool | haveLogger_p |
Bool | fixedMinMax_p |
Bool | doRobust_p |
doRobust means that when the storage lattice is generated, the robust statistics are generated as well More... | |
Bool | doList_p |
IPosition | minPos_p |
IPosition | maxPos_p |
IPosition | blcParent_p |
String | error_p |
Private Member Functions | |
void | _setDefaultCoeffs () |
virtual void | summStats () |
Summarize the statistics found over the entire lattice. More... | |
virtual void | displayStats (AccumType nPts, AccumType sum, AccumType median, AccumType medAbsDevMed, AccumType quartile, AccumType sumSq, AccumType mean, AccumType var, AccumType rms, AccumType sigma, AccumType dMin, AccumType dMax, AccumType q1, AccumType q3) |
Bool | calculateStatistic (Array< AccumType > &slice, LatticeStatsBase::StatisticsTypes type, Bool dropDeg) |
Calculate statistic from storage lattice and return in an array. More... | |
void | generateRobust () |
Find the median per cursorAxes chunk. More... | |
Bool | generateStorageLattice () |
Create a new storage lattice. More... | |
IPosition | locInStorageLattice (const IPosition &latticePosition, LatticeStatsBase::StatisticsTypes type) const |
Given a location in the lattice and a statistic type, work out where to put it in the storage lattice. More... | |
void | minMax (Bool &none, AccumType &dMin, AccumType &dMax, const Vector< AccumType > &d, const Vector< AccumType > &n) const |
Find min and max of good data in arrays specified by pointers. More... | |
Bool | retrieveStorageStatistic (Array< AccumType > &slice, const LatticeStatsBase::StatisticsTypes type, const Bool dropDeg) |
Retrieve a statistic from the storage lattice and return in an array. More... | |
Bool | retrieveStorageStatistic (Vector< AccumType > &slice, const IPosition &pos, const Bool posInLattice) |
Retrieve a statistic from the storage lattice at the specified location and return in an array. More... | |
IPosition | statsSliceShape () const |
Find the shape of slice from the statistics lattice at one spatial pixel. More... | |
Bool | someGoodPoints () |
See if there were some valid points found in the storage lattice. More... | |
void | stretchMinMax (AccumType &dMin, AccumType &dMax) const |
Stretch min and max by 5%. More... | |
CountedPtr< StatisticsAlgorithm< AccumType, const T *, const Bool * > > | _createStatsAlgorithm () const |
void | _configureDataProviders (LatticeStatsDataProvider< T > &lattDP, MaskedLatticeStatsDataProvider< T > &maskedLattDP) const |
void | _doStatsLoop (uInt nsets, CountedPtr< LattStatsProgress > progressMeter) |
Private Attributes | |
const MaskedLattice< T > * | pInLattice_p |
CountedPtr< TempLattice< AccumType > > | pStoreLattice_p |
Vector< Int > | nxy_p |
Vector< Int > | statsToPlot_p |
Vector< T > | range_p |
Bool | noInclude_p |
Bool | noExclude_p |
Bool | needStorageLattice_p |
Bool | doneSomeGoodPoints_p |
Bool | someGoodPointsValue_p |
Bool | showProgress_p |
Bool | forceDisk_p |
T | minFull_p |
T | maxFull_p |
Bool | doneFullMinMax_p |
AlgConf | _algConf |
std::map< String, uInt > | _chauvIters |
Double | _aOld |
Double | _bOld |
Double | _aNew |
Double | _bNew |
Additional Inherited Members | |
![]() | |
static Vector< Int > | toStatisticTypes (const String &statistics, const Regex &delimiter) |
Helper function to convert a String containing a list of desired statistics to the correct Vector<Int> required for the LatticeStatistics<T>::setPlotting function. More... | |
static Vector< Int > | toStatisticTypes (const Vector< String > &statistics) |
static String | toStatisticName (StatisticsTypes type) |
Convert type to string. More... | |
static String | toStatisticName (Int type) |
static Int | toStatisticType (const String &statistic) |
Returns -1 if the statistic string is not valid. More... | |
static Bool | setNxy (Vector< Int > &nxy, ostream &os) |
Check and fill in defaults for a Vector<Int> containing the number of subplots in x and y to be put on a plot. More... | |
static void | setStorageImageShape (IPosition &storeImageShape, const Bool &last, const Int &axisSize, const Vector< Int > &displayAxes, const IPosition &shape) |
A storage image is used to accumulate information as a function of the display axes as an image is iterated through. More... | |
static void | stretchMinMax (Float &min, Float &max) |
Stretch a range by 10%. More... | |
Compute and display various statistics from a lattice.
Public interface
This is a class designed to display and retrieve statistics from lattices
This class enable you to display and/or retrieve statistics evaluated over specified regions of a lattice. The dimension of the region is arbitrary, but the size of each dimension is always the shape of the corresponding lattice axis. The statistics are displayed as a function of location of the axes not used to evaluate the statistics over. The axes which you evaluate the statistics over are called the cursor axes, the others are called the display axes.
For example, consider a lattice cube (call the axes xyz or [0,1,2]). You could display statistics from xy planes (cursor axes [0,1]) as a function of z (display axes [2]). Or you could retrieve statistics from the z axis (cursor axes [2]) for each [x,y] location (display axes [0,1]).
This class inherits from LatticeStatsBase This base class provides an enum
defining allowed statistics types and a helper function to convert between a String
and a Vector<Int>
describing the desired statistics to plot. An example is shown below.
This class can list, plot and retrieve statistics. When it lists statistics, it always lists all the available statistics. When you plot statistics, you must specify which ones you would like to see.
This class generates a "storage lattice" into which it writes the accumulated statistical sums. It is from this storage lattice that the plotting and retrieval arrays are drawn. The storage lattice is either in core or on disk depending upon its size (if > 10% of memory given by .aipsrc system.resources.memory then it goes into a disk-based PagedArray). If on disk, the storage lattice is deleted when the LatticeStatistics
class object destructs. However, currently, if the process is terminated ungracefully, the storage lattice will be left over.
Tip: This class has a few virtual functions; they are not part of a nice general polymorphic interface; rather they have specialized functionality; The idea of these is that you can derive a class from LatticeStatistics, such as ImageStatistics which provides you with a little more information when displaying/logging the statistics (such as world coordinates) The virtual functions are
getBeamArea
can be used to return the synthesized beam area so that the FLUX statistic can be computed listStats
is used to list the statistics to the logger getLabelsM
find the X-axis label and the title label for the plotting;
Tip: If you ignore return error statuses from the functions that set the state of the class, the internal status of the class is set to bad; This means it will just keep on returning error conditions until you explicitly recover the situation; A message describing the last error condition can be recovered with function errorMessage;
In this example, a PagedImage
is constructed (which isA MaskedLattice) with . We set the cursor axes to be the y and z axes, we specify to list the statistics if we plot them, and we ask to plot the mean, standard deviation, and root mean square of each yz plane as a function of x location on the PGPLOT device "/xs" with 1 subplot per page (there will be only one in this case). After the plotting and listing, we also retrieve the sum of the selected pixels as a function of x location into an array.
The generation of statistical information from a lattice is a basic and necessary capability.
Definition at line 196 of file LatticeStatistics.h.
typedef NumericTraits<T>::PrecisionType casacore::LatticeStatistics< T >::AccumType |
Definition at line 202 of file LatticeStatistics.h.
typedef std::pair<String,String> casacore::LatticeStatistics< T >::stat_element |
Definition at line 294 of file LatticeStatistics.h.
typedef std::list<stat_element> casacore::LatticeStatistics< T >::stat_list |
Definition at line 295 of file LatticeStatistics.h.
casacore::LatticeStatistics< T >::LatticeStatistics | ( | const MaskedLattice< T > & | lattice, |
LogIO & | os, | ||
Bool | showProgress = True , |
||
Bool | forceDisk = False |
||
) |
Constructor takes the lattice and a LogIO
object for logging.
You can specify whether you want to see progress meters or not. You can force the storage lattice to be disk based, otherwise the decision for core or disk is taken for you.
casacore::LatticeStatistics< T >::LatticeStatistics | ( | const MaskedLattice< T > & | lattice, |
Bool | showProgress = True , |
||
Bool | forceDisk = False |
||
) |
Constructor takes the lattice only.
In the absence of a logger you get no messages. This includes error messages and potential listing of the statistics. You can specify whether you want to see progress meters or not. You can force the storage lattice to be disk based, otherwise the decision for core or disk is taken for you.
casacore::LatticeStatistics< T >::LatticeStatistics | ( | const LatticeStatistics< T > & | other | ) |
Copy constructor.
Copy semantics are followed. Therefore any storage lattice that has already been created for other
is copied to *this
|
virtual |
Destructor.
|
inlineprotectedvirtual |
Virtual Functions.
See implementation to figure it all out !
FIXME The indirect dependence of this class on ImageInterface related issues (eg flux density) breaks encapsulation. All the ImageInterface related code should be encapsulated in ImageStatistics. Unfortunately, that requires significantly more time than I have atm. A return value of False means that the object in question cannot compute flux density values. The default implementation returns False.
Reimplemented in casacore::ImageStatistics< T >.
Definition at line 424 of file LatticeStatistics.h.
References casacore::False.
|
protectedvirtual |
Reimplemented in casacore::ImageStatistics< T >.
Referenced by casacore::LatticeStatistics< T >::_storageLatticeShape().
|
protectedvirtual |
Reimplemented in casacore::ImageStatistics< T >.
|
private |
Referenced by casacore::LatticeStatistics< T >::_setDefaultCoeffs().
|
private |
Referenced by casacore::LatticeStatistics< T >::_setDefaultCoeffs().
|
private |
Referenced by casacore::LatticeStatistics< T >::_setDefaultCoeffs().
|
inlineprotectedvirtual |
Reimplemented in casacore::ImageStatistics< T >.
Definition at line 426 of file LatticeStatistics.h.
References casacore::LatticeStatistics< T >::listLayerStats(), casacore::LatticeStatistics< T >::listMinMax(), casacore::LatticeStatistics< T >::listStats(), casacore::LatticeStatistics< T >::locInLattice(), casacore::LatticeStatistics< T >::setStream(), ThrowCc, and casacore::True.
|
protected |
convert a position in the input lattice to the corresponding position in the stats storage lattice.
The number of elements in storagePos will not be changed and only the first N elements will be modified where N = the number of elements in latticePos. storagePos
must therefore have at least as many elements as latticePos
. Returns False if latticePos
is inconsistent with the input lattice.
Referenced by casacore::LatticeStatistics< T >::_storageLatticeShape().
|
inlineprivate |
coefficients from timings run on PagedImages on etacarinae.cv.nrao.edu (dmehring's development machine)
Definition at line 512 of file LatticeStatistics.h.
References casacore::LatticeStatistics< T >::_configureDataProviders(), casacore::LatticeStatistics< T >::_createStatsAlgorithm(), casacore::LatticeStatistics< T >::_doStatsLoop(), casacore::LatticeStatistics< T >::calculateStatistic(), casacore::LatticeStatistics< T >::displayStats(), casacore::LatticeStatistics< T >::generateRobust(), casacore::LatticeStatistics< T >::generateStorageLattice(), casacore::LatticeStatistics< T >::locInStorageLattice(), casacore::mean(), casacore::median(), casacore::LatticeStatistics< T >::minMax(), casacore::LatticeStatistics< T >::retrieveStorageStatistic(), casacore::rms(), casacore::LatticeStatistics< T >::someGoodPoints(), casacore::LatticeStatistics< T >::statsSliceShape(), casacore::LatticeStatistics< T >::stretchMinMax(), and casacore::LatticeStatistics< T >::summStats().
|
inlineprotected |
get the storage lattice shape
Definition at line 471 of file LatticeStatistics.h.
References casacore::LatticeStatistics< T >::_computeFlux(), casacore::LatticeStatistics< T >::_latticePosToStoragePos(), casacore::LatticeStatistics< T >::pStoreLattice_p, and casacore::sum().
|
private |
Calculate statistic from storage lattice and return in an array.
Referenced by casacore::LatticeStatistics< T >::_setDefaultCoeffs().
void casacore::LatticeStatistics< T >::configureChauvenet | ( | Double | zscore = -1 , |
Int | maxIterations = -1 |
||
) |
configure to use Chauvenet's criterion
Referenced by casacore::LatticeStatistics< T >::hasLogger().
void casacore::LatticeStatistics< T >::configureClassical | ( | ) |
configure object to use Classical Statistics The time, t_x, it takes to compute classical statistics using algorithm x, can be modeled by t_x = n_sets*(a_x + b_x*n_el) where n_sets is the number of independent sets of data to compute stats on, each containing n_el number of elements.
a_x is the time it takes to compute stats a a single set of data, and b_x is the time it takes to accumulate a single point. The old algorithm was developed in the early history of the project, I'm guessing by Neil Kileen, while the new algorithm was developed in 2015 by Dave Mehringer as part of the stats framework project. The old algorithm is faster in the regime of large n_sets and small n_el, while the new algorithm is faster in the regime of small n_sets and large n_el. If one always wants to use one of these algorithms, that algorithm's coefficients should be set to 0, while setting the other algorithm's coefficients to positive values. Note that it's the relative, not the absolute, values of these coeffecients that is important The version that takes no parameters uses the default values of the coefficients;
Referenced by casacore::LatticeStatistics< T >::hasLogger().
void casacore::LatticeStatistics< T >::configureClassical | ( | Double | aOld, |
Double | bOld, | ||
Double | aNew, | ||
Double | bNew | ||
) |
void casacore::LatticeStatistics< T >::configureFitToHalf | ( | FitToHalfStatisticsData::CENTER | centerType = FitToHalfStatisticsData::CMEAN , |
FitToHalfStatisticsData::USE_DATA | useData = FitToHalfStatisticsData::LE_CENTER , |
||
AccumType | centerValue = 0 |
||
) |
configure to use fit to half algorithm.
Referenced by casacore::LatticeStatistics< T >::hasLogger().
void casacore::LatticeStatistics< T >::configureHingesFences | ( | Double | f | ) |
configure to use hinges-fences algorithm
Referenced by casacore::LatticeStatistics< T >::hasLogger().
Bool casacore::LatticeStatistics< T >::display | ( | ) |
Display the statistics by listing and/or plotting them.
If you don't call this function then you won't see anything ! A return value of False
indicates an invalid plotting device, or that the internal state of the class is bad.
|
inline |
Return the display axes.
The returned vector will be valid only if setAxes
has been called, or if one of the active "display" or "get*" methods has been called.
Definition at line 302 of file LatticeStatistics.h.
References casacore::LatticeStatistics< T >::displayAxes_p, casacore::False, casacore::LatticeStatistics< T >::getConvertedStatistic(), casacore::LatticeStatistics< T >::getMinMaxPos(), casacore::LatticeStatistics< T >::getStatistic(), casacore::LatticeStatistics< T >::getStats(), and casacore::True.
|
privatevirtual |
Reimplemented in casacore::ImageStatistics< T >.
Referenced by casacore::LatticeStatistics< T >::_setDefaultCoeffs().
|
inline |
Recover last error message.
Definition at line 351 of file LatticeStatistics.h.
References casacore::LatticeStatistics< T >::error_p, and casacore::LatticeStatistics< T >::setNewLattice().
|
private |
Find the median per cursorAxes chunk.
Referenced by casacore::LatticeStatistics< T >::_setDefaultCoeffs().
|
private |
Create a new storage lattice.
Referenced by casacore::LatticeStatistics< T >::_setDefaultCoeffs().
|
inline |
get number of iterations associated with Chauvenet criterion algorithm
Definition at line 400 of file LatticeStatistics.h.
References casacore::LatticeStatistics< T >::_chauvIters.
Bool casacore::LatticeStatistics< T >::getConvertedStatistic | ( | Array< T > & | stat, |
LatticeStatsBase::StatisticsTypes | type, | ||
Bool | dropDeg = True |
||
) |
Referenced by casacore::LatticeStatistics< T >::displayAxes().
Bool casacore::LatticeStatistics< T >::getFullMinMax | ( | T & | dataMin, |
T & | dataMax | ||
) |
Get full lattice min and max only.
Returns False if no unmasked data, else returns True. Honours any include or exclude range if set.
Referenced by casacore::LatticeStatistics< T >::resetError().
|
protectedvirtual |
Reimplemented in casacore::ImageStatistics< T >.
Bool casacore::LatticeStatistics< T >::getLayerStats | ( | String & | stats, |
Double | area, | ||
Int | zAxis = -1 , |
||
Int | zLayer = -1 , |
||
Int | hAxis = -1 , |
||
Int | hLayer = -1 |
||
) |
Bool casacore::LatticeStatistics< T >::getLayerStats | ( | stat_list & | stats, |
Double | area, | ||
Int | zAxis = -1 , |
||
Int | zLayer = -1 , |
||
Int | hAxis = -1 , |
||
Int | hLayer = -1 |
||
) |
Bool casacore::LatticeStatistics< T >::getMinMaxPos | ( | IPosition & | minPos, |
IPosition & | maxPos | ||
) |
Recover position of min and max.
Only works if there are no display axes (i.e. statistics found over entire image), otherwise, the returned values are resized to 0 shape. A return value of False
indicates that the internal state of the class is bad.
Referenced by casacore::LatticeStatistics< T >::displayAxes().
Bool casacore::LatticeStatistics< T >::getStatistic | ( | Array< AccumType > & | stat, |
LatticeStatsBase::StatisticsTypes | type, | ||
Bool | dropDeg = True |
||
) |
Recover the desired Statistic into an array.
If you choose to use the T version, be aware that the values in the AccumType version of the Array may not be representable in the T version (e.g. large values for SumSq). The shape of the array is the shape of the display axes (e.g. if the shape of the lattice is [nx,ny,nz] and you ask for the mean of the y axis the shape of the returned array would be [nx,nz]. A returned array of zero shape indicates that there were no good values. A return value of False
indicates that the internal state of the class is bad.
Referenced by casacore::LatticeStatistics< T >::displayAxes().
Bool casacore::LatticeStatistics< T >::getStats | ( | Vector< AccumType > & | , |
const IPosition & | pos, | ||
const Bool | posInLattice = False |
||
) |
This function gets a vector containing all the statistics for a given location.
If posInLattice=True
then the location is a location in the input lattice. Any positions on the display axes are ignored. Otherwise, you should just give locations for the display axes only. Use can use the enum in class LatticeStatsBase to find out which locations in the vector contain which statistics. A returned vector of zero shape indicates that there were no good values. A return value of False
indicates that the internal state of the class is bad.
Referenced by casacore::LatticeStatistics< T >::displayAxes().
|
inline |
Did we construct with a logger ?
Definition at line 358 of file LatticeStatistics.h.
References casacore::FitToHalfStatisticsData::CMEAN, casacore::LatticeStatistics< T >::configureChauvenet(), casacore::LatticeStatistics< T >::configureClassical(), casacore::LatticeStatistics< T >::configureFitToHalf(), casacore::LatticeStatistics< T >::configureHingesFences(), casacore::LatticeStatistics< T >::haveLogger_p, and casacore::FitToHalfStatisticsData::LE_CENTER.
|
protectedvirtual |
Referenced by casacore::LatticeStatistics< T >::_flux().
|
protectedvirtual |
Reimplemented in casacore::ImageStatistics< T >.
Referenced by casacore::LatticeStatistics< T >::_flux().
|
protectedvirtual |
List the statistics to the logger.
The implementation here is adequate for all lattices. See ImageStatistics for an example of where extra information is provided. hasBeam is the return value of getBeamArea. If it is true, that means that the FLUX statistics will be available in the storage lattice. dPos is the location of the start of the cursor in the storage image for this row. stats(j,i) is the statistics matrix. for the jth point and the ith statistic. The return value is False if something goes wrong ! Have a look at the implementation to see what you really have to do.
Reimplemented in casacore::ImageStatistics< T >.
Referenced by casacore::LatticeStatistics< T >::_flux().
|
protected |
Given a location in the storage lattice, convert those locations on the non-statistics axis (the last one) and optionally account for the lattice subsectioning.
Referenced by casacore::LatticeStatistics< T >::_flux().
|
private |
Given a location in the lattice and a statistic type, work out where to put it in the storage lattice.
Referenced by casacore::LatticeStatistics< T >::_setDefaultCoeffs().
|
private |
Find min and max of good data in arrays specified by pointers.
Referenced by casacore::LatticeStatistics< T >::_setDefaultCoeffs().
LatticeStatistics<T>& casacore::LatticeStatistics< T >::operator= | ( | const LatticeStatistics< T > & | other | ) |
Assignment operator.
Deletes any storage lattice associated with the object being assigned to and copies any storage lattice that has already been created for "other".
|
inline |
Reset argument error condition.
If you specify invalid arguments to one of the above set
functions, an internal flag will be set which will prevent the work functions from doing anything (should you have chosen to ignore the Boolean return values of the set
functions). This function allows you to reset that internal state to good.
Definition at line 344 of file LatticeStatistics.h.
References casacore::LatticeStatistics< T >::getFullMinMax(), casacore::LatticeStatistics< T >::goodParameterStatus_p, and casacore::True.
|
private |
Retrieve a statistic from the storage lattice and return in an array.
Referenced by casacore::LatticeStatistics< T >::_setDefaultCoeffs().
|
private |
Retrieve a statistic from the storage lattice at the specified location and return in an array.
Bool casacore::LatticeStatistics< T >::setAxes | ( | const Vector< Int > & | cursorAxes | ) |
Set the cursor axes (0 relative).
A return value of False
indicates you have asked for an invalid axis. The default state of the class is to set the cursor axes to all axes in the lattice.
Bool casacore::LatticeStatistics< T >::setInExCludeRange | ( | const Vector< T > & | include, |
const Vector< T > & | exclude, | ||
Bool | setMinMaxToInclude = False |
||
) |
You may specify a pixel intensity range as either one for which all pixels in that range are included or one for which all pixels in that range are excluded.
One or the other of include
and exclude
must therefore be a zero length vector if you call this function. If you are setting an include
range, then if you set setMinMaxToInclude=True
, the minimum and maximum values that this class returns will always be the minimum and maximum of the include
range, respectively. A return value of False
indicates that you have given both an include
and an exclude
range. A vector of length 1 for include
and/or exclude
means that the range will be set to (say for include
) -abs(include(0))
to abs(include(0))
. A return value of False
indicates that both an inclusion and exclusion range were given or that the internal state of the class is bad. If you don't call this function, the default state of the class is to include all pixels.
Bool casacore::LatticeStatistics< T >::setList | ( | const Bool & | doList | ) |
This function allows you to control whether the statistics are written to the output stream if you are also making a plot.
A return value of False
indicates that the internal state of the class is bad. If you have created the LatticeStatistics
object without a LogIO
object, you won't see any listings, but no error conditions will be generated. The default state of the class is to not list the output when making a plot.
Bool casacore::LatticeStatistics< T >::setNewLattice | ( | const MaskedLattice< T > & | lattice | ) |
Set a new MaskedLattice object.
A return value of False
indicates the lattice had an invalid type or that the internal state of the class is bad.
Referenced by casacore::LatticeStatistics< T >::errorMessage().
|
protected |
Non-virtual functions.
set stream manipulators
Referenced by casacore::LatticeStatistics< T >::_flux().
|
private |
See if there were some valid points found in the storage lattice.
Referenced by casacore::LatticeStatistics< T >::_setDefaultCoeffs().
|
private |
Find the shape of slice from the statistics lattice at one spatial pixel.
Referenced by casacore::LatticeStatistics< T >::_setDefaultCoeffs().
|
private |
Stretch min and max by 5%.
Referenced by casacore::LatticeStatistics< T >::_setDefaultCoeffs().
|
privatevirtual |
Summarize the statistics found over the entire lattice.
Referenced by casacore::LatticeStatistics< T >::_setDefaultCoeffs().
|
private |
Definition at line 507 of file LatticeStatistics.h.
|
private |
Definition at line 510 of file LatticeStatistics.h.
|
private |
Definition at line 510 of file LatticeStatistics.h.
|
private |
Definition at line 510 of file LatticeStatistics.h.
|
private |
Definition at line 510 of file LatticeStatistics.h.
|
private |
Definition at line 508 of file LatticeStatistics.h.
Referenced by casacore::LatticeStatistics< T >::getChauvenetNiter().
|
protected |
Definition at line 414 of file LatticeStatistics.h.
|
protected |
Definition at line 405 of file LatticeStatistics.h.
|
protected |
Definition at line 405 of file LatticeStatistics.h.
Referenced by casacore::LatticeStatistics< T >::displayAxes().
|
protected |
Definition at line 413 of file LatticeStatistics.h.
|
private |
Definition at line 505 of file LatticeStatistics.h.
|
private |
Definition at line 501 of file LatticeStatistics.h.
|
protected |
doRobust means that when the storage lattice is generated, the robust statistics are generated as well
Definition at line 412 of file LatticeStatistics.h.
|
protected |
Definition at line 415 of file LatticeStatistics.h.
Referenced by casacore::LatticeStatistics< T >::errorMessage().
|
protected |
Definition at line 407 of file LatticeStatistics.h.
|
private |
Definition at line 502 of file LatticeStatistics.h.
|
protected |
Definition at line 406 of file LatticeStatistics.h.
Referenced by casacore::LatticeStatistics< T >::resetError().
|
protected |
Definition at line 407 of file LatticeStatistics.h.
Referenced by casacore::LatticeStatistics< T >::hasLogger().
|
private |
Definition at line 504 of file LatticeStatistics.h.
|
protected |
Definition at line 414 of file LatticeStatistics.h.
|
private |
Definition at line 504 of file LatticeStatistics.h.
|
protected |
Definition at line 414 of file LatticeStatistics.h.
|
private |
Definition at line 501 of file LatticeStatistics.h.
|
private |
Definition at line 499 of file LatticeStatistics.h.
|
private |
Definition at line 499 of file LatticeStatistics.h.
|
private |
Definition at line 497 of file LatticeStatistics.h.
|
protected |
Definition at line 404 of file LatticeStatistics.h.
|
private |
Definition at line 495 of file LatticeStatistics.h.
|
private |
Definition at line 496 of file LatticeStatistics.h.
Referenced by casacore::LatticeStatistics< T >::_storageLatticeShape().
|
private |
Definition at line 498 of file LatticeStatistics.h.
|
private |
Definition at line 502 of file LatticeStatistics.h.
|
private |
Definition at line 501 of file LatticeStatistics.h.
|
private |
Definition at line 497 of file LatticeStatistics.h.