Loading...
Searching...
No Matches
casacore::LatticeStatsBase Class Reference
lattices package (libcasa_lattices) » LatticeMath_module

More...

`#include <LatticeStatsBase.h>`

## Public Types

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...

## Static Public Member Functions

static Vector< Int > | toStatisticTypes (const String &statistics, const std::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.
static Vector< Int > | toStatisticTypes (const Vector< String > &statistics)
static String | toStatisticName (StatisticsTypes type)
| Convert type to string.
static String | toStatisticName (Int type)
static Int | toStatisticType (const String &statistic)
| Returns -1 if the statistic string is not valid.
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.
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.
static void | stretchMinMax (Float &min, Float &max)
| Stretch a range by 10%.
static std::set< Double > | quartileFracs ()

## Detailed Description

Base class for LatticeStatistics class

### Intended use:

Public interface

### Review Status

Date Reviewed:
  yyyy/mm/dd

### Prerequisite

- Vector
- String

### Etymology

A simple base class for the LatticeStatistics class

### Synopsis

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. The reason for having it as a base class rather than just part of LatticeStatistics is that the latter is templated, and it doesn't make much sense to invoke the static function setStatisticTypes function with a templated type.

### Example

Vector<Int> statsToPlot = LatticeStatsBase::toStatisticTypes("mean,rms,sigma");
casacore::LatticeStatsBase::toStatisticTypes
static Vector< Int > toStatisticTypes(const String &statistics, const std::regex &delimiter)
Helper function to convert a String containing a list of desired statistics to the correct Vector<Int...
casacore::Vector
Definition Vector.h:82

Definition at line 74 of file LatticeStatsBase.h.

## Member Enumeration Documentation

## StatisticsTypes

enum casacore::LatticeStatsBase::StatisticsTypes

This enum StatisticTypes is provided for use with the LatticeStatistics<T>::setPlotting function.

It gives the allowed statistics types that you can ask for.

Enumerator
NPTS | The number of points.
SUM | The sum.
SUMSQ | The sum squared.
MEDIAN | The median - the robust stats does not fit well into storage lattice approach.
MEDABSDEVMED | median of absolute deviation from median
QUARTILE | inter-quartile range
Q1 | The first and third quartiles.
Q3 |
MIN | The minimum.
MAX | The maximum.
MEAN | The mean.
VARIANCE | The variance about the mean.
SIGMA | The standard deviation about the mean.
RMS | The rms.
FLUX | The flux density (can't always compute this - needs the beam).
NSTATS | The total number of available statistics to plot.

NACCUM

The total number of accumulation image items (not for general use: note that the accumulation items MUST come first in this enum) dmehring changed from VARIANCE+1 to SIGMA+1 because the standard deviation should be stored rather than taking the square root of the same value multiple times.

Not to mention the biweight algorithm does not compute the variance, so that the standard deviation must be explicitly stored for it.

Definition at line 82 of file LatticeStatsBase.h.

## Member Function Documentation

## quartileFracs()

std::set< Double > casacore::LatticeStatsBase::quartileFracs | ( |  | ) |

static

## setNxy()

Bool casacore::LatticeStatsBase::setNxy | ( | Vector< Int > & | nxy,
|  | ostream & | os )

static

Check and fill in defaults for a Vector<Int> containing the number of subplots in x and y to be put on a plot.

The Vector<Int> is resized to 2 before assignment. A return value of False indicates invalid arguments.

## setStorageImageShape()

void casacore::LatticeStatsBase::setStorageImageShape | ( | IPosition & | storeImageShape,
|  | const Bool & | last,
|  | const Int & | axisSize,
|  | const Vector< Int > & | displayAxes,
|  | const IPosition & | shape )

static

A storage image is used to accumulate information as a function of the display axes as an image is iterated through.

This function sets the storage image shape to that appropriate to the shape of the display axes and the desired size of the first or last dimension.

References casacore::shape().

## stretchMinMax()

void casacore::LatticeStatsBase::stretchMinMax | ( | Float & | min,
|  | Float & | max )

static

Stretch a range by 10%.

References casacore::max(), and casacore::min().

## toStatisticName() [1/2]

String casacore::LatticeStatsBase::toStatisticName | ( | Int | type | ) |

static

## toStatisticName() [2/2]

String casacore::LatticeStatsBase::toStatisticName | ( | StatisticsTypes | type | ) |

static

Convert type to string.

## toStatisticType()

Int casacore::LatticeStatsBase::toStatisticType | ( | const String & | statistic | ) |

static

Returns -1 if the statistic string is not valid.

## toStatisticTypes() [1/2]

Vector< Int > casacore::LatticeStatsBase::toStatisticTypes | ( | const String & | statistics,
|  | const std::regex & | delimiter )

static

Helper function to convert a String containing a list of desired statistics to the correct Vector<Int> required for the LatticeStatistics<T>::setPlotting function.

This may be usful if your user interface involves strings rather than integers. A new value is added to the output vector (which is resized appropriately) if any of the substrings "npts", "min", "max", "sum", "sumsq", "mean", "sigma", "rms", and "flux" is present. An empty vector results if there are no matches

## toStatisticTypes() [2/2]

Vector< Int > casacore::LatticeStatsBase::toStatisticTypes | ( | const Vector< String > & | statistics | ) |

static

The documentation for this class was generated from the following file:

- lattices/LatticeMath/LatticeStatsBase.h