LSSTApplications  18.0.0+106,18.0.0+50,19.0.0,19.0.0+1,19.0.0+10,19.0.0+11,19.0.0+13,19.0.0+17,19.0.0+2,19.0.0-1-g20d9b18+6,19.0.0-1-g425ff20,19.0.0-1-g5549ca4,19.0.0-1-g580fafe+6,19.0.0-1-g6fe20d0+1,19.0.0-1-g7011481+9,19.0.0-1-g8c57eb9+6,19.0.0-1-gb5175dc+11,19.0.0-1-gdc0e4a7+9,19.0.0-1-ge272bc4+6,19.0.0-1-ge3aa853,19.0.0-10-g448f008b,19.0.0-12-g6990b2c,19.0.0-2-g0d9f9cd+11,19.0.0-2-g3d9e4fb2+11,19.0.0-2-g5037de4,19.0.0-2-gb96a1c4+3,19.0.0-2-gd955cfd+15,19.0.0-3-g2d13df8,19.0.0-3-g6f3c7dc,19.0.0-4-g725f80e+11,19.0.0-4-ga671dab3b+1,19.0.0-4-gad373c5+3,19.0.0-5-ga2acb9c+2,19.0.0-5-gfe96e6c+2,w.2020.01
LSSTDataManagementBasePackage
Public Types | Public Member Functions | Friends | List of all members
lsst::afw::math::StatisticsControl Class Reference

Pass parameters to a Statistics object. More...

#include <Statistics.h>

Public Types

enum  WeightsBoolean { WEIGHTS_FALSE = 0, WEIGHTS_TRUE = 1, WEIGHTS_NONE }
 

Public Member Functions

 StatisticsControl (double numSigmaClip=3.0, int numIter=3, lsst::afw::image::MaskPixel andMask=0x0, bool isNanSafe=true, WeightsBoolean useWeights=WEIGHTS_NONE)
 
double getNumSigmaClip () const noexcept
 
int getNumIter () const noexcept
 
int getAndMask () const noexcept
 
int getNoGoodPixelsMask () const noexcept
 
bool getNanSafe () const noexcept
 
bool getWeighted () const noexcept
 
bool getWeightedIsSet () const noexcept
 
bool getCalcErrorFromInputVariance () const noexcept
 
void setNumSigmaClip (double numSigmaClip)
 
void setNumIter (int numIter)
 
void setAndMask (int andMask)
 
void setNoGoodPixelsMask (int noGoodPixelsMask)
 
void setNanSafe (bool isNanSafe) noexcept
 
void setWeighted (bool useWeights) noexcept
 
void setCalcErrorFromInputVariance (bool calcErrorFromInputVariance) noexcept
 
double getMaskPropagationThreshold (int bit) const
 When pixels with the given bit are rejected, we count what fraction the rejected pixels would have contributed (including the weights, if any) if those pixels had not been rejected, and set that bit in the return value of Statistics::getOrMask() if it exceeds the given threshold. More...
 
void setMaskPropagationThreshold (int bit, double threshold)
 When pixels with the given bit are rejected, we count what fraction the rejected pixels would have contributed (including the weights, if any) if those pixels had not been rejected, and set that bit in the return value of Statistics::getOrMask() if it exceeds the given threshold. More...
 

Friends

class Statistics
 

Detailed Description

Pass parameters to a Statistics object.

A class to pass parameters which control how the stats are calculated.

Definition at line 93 of file Statistics.h.

Member Enumeration Documentation

◆ WeightsBoolean

Enumerator
WEIGHTS_FALSE 
WEIGHTS_TRUE 
WEIGHTS_NONE 

Definition at line 95 of file Statistics.h.

Constructor & Destructor Documentation

◆ StatisticsControl()

lsst::afw::math::StatisticsControl::StatisticsControl ( double  numSigmaClip = 3.0,
int  numIter = 3,
lsst::afw::image::MaskPixel  andMask = 0x0,
bool  isNanSafe = true,
WeightsBoolean  useWeights = WEIGHTS_NONE 
)
inline
Parameters
numSigmaClipnumber of standard deviations to clip at
numIterNumber of iterations
andMaskand-Mask: defines which mask bits cause a value to be ignored
isNanSafeflag NaNs & Infs
useWeightsuse weighted statistics (via a vector or an inverse variance)

Definition at line 97 of file Statistics.h.

105  : _numSigmaClip(numSigmaClip),
106  _numIter(numIter),
107  _andMask(andMask),
108  _noGoodPixelsMask(0x0),
109  _isNanSafe(isNanSafe),
110  _useWeights(useWeights),
111  _calcErrorFromInputVariance(false),
112  _maskPropagationThresholds() {
113  try {
114  _noGoodPixelsMask = lsst::afw::image::Mask<>::getPlaneBitMask("NO_DATA");
116  ; // Mask has no NO_DATA plane defined
117  }
118 
119  assert(_numSigmaClip > 0);
120  assert(_numIter > 0);
121  }
static MaskPixelT getPlaneBitMask(const std::vector< std::string > &names)
Return the bitmask corresponding to a vector of plane names OR&#39;d together.
Definition: Mask.cc:379
Reports invalid arguments.
Definition: Runtime.h:66

Member Function Documentation

◆ getAndMask()

int lsst::afw::math::StatisticsControl::getAndMask ( ) const
inlinenoexcept

Definition at line 135 of file Statistics.h.

135 { return _andMask; }

◆ getCalcErrorFromInputVariance()

bool lsst::afw::math::StatisticsControl::getCalcErrorFromInputVariance ( ) const
inlinenoexcept

Definition at line 140 of file Statistics.h.

140 { return _calcErrorFromInputVariance; }

◆ getMaskPropagationThreshold()

double lsst::afw::math::StatisticsControl::getMaskPropagationThreshold ( int  bit) const

When pixels with the given bit are rejected, we count what fraction the rejected pixels would have contributed (including the weights, if any) if those pixels had not been rejected, and set that bit in the return value of Statistics::getOrMask() if it exceeds the given threshold.

Definition at line 727 of file Statistics.cc.

727  {
728  int oldSize = _maskPropagationThresholds.size();
729  if (oldSize < bit) {
730  return 1.0;
731  }
732  return _maskPropagationThresholds[bit];
733 }
T size(T... args)

◆ getNanSafe()

bool lsst::afw::math::StatisticsControl::getNanSafe ( ) const
inlinenoexcept

Definition at line 137 of file Statistics.h.

137 { return _isNanSafe; }

◆ getNoGoodPixelsMask()

int lsst::afw::math::StatisticsControl::getNoGoodPixelsMask ( ) const
inlinenoexcept

Definition at line 136 of file Statistics.h.

136 { return _noGoodPixelsMask; }

◆ getNumIter()

int lsst::afw::math::StatisticsControl::getNumIter ( ) const
inlinenoexcept

Definition at line 134 of file Statistics.h.

134 { return _numIter; }

◆ getNumSigmaClip()

double lsst::afw::math::StatisticsControl::getNumSigmaClip ( ) const
inlinenoexcept

Definition at line 133 of file Statistics.h.

133 { return _numSigmaClip; }

◆ getWeighted()

bool lsst::afw::math::StatisticsControl::getWeighted ( ) const
inlinenoexcept

Definition at line 138 of file Statistics.h.

138 { return _useWeights == WEIGHTS_TRUE ? true : false; }

◆ getWeightedIsSet()

bool lsst::afw::math::StatisticsControl::getWeightedIsSet ( ) const
inlinenoexcept

Definition at line 139 of file Statistics.h.

139 { return _useWeights != WEIGHTS_NONE ? true : false; }

◆ setAndMask()

void lsst::afw::math::StatisticsControl::setAndMask ( int  andMask)
inline

Definition at line 150 of file Statistics.h.

150 { _andMask = andMask; }

◆ setCalcErrorFromInputVariance()

void lsst::afw::math::StatisticsControl::setCalcErrorFromInputVariance ( bool  calcErrorFromInputVariance)
inlinenoexcept

Definition at line 154 of file Statistics.h.

154  {
155  _calcErrorFromInputVariance = calcErrorFromInputVariance;
156  }

◆ setMaskPropagationThreshold()

void lsst::afw::math::StatisticsControl::setMaskPropagationThreshold ( int  bit,
double  threshold 
)

When pixels with the given bit are rejected, we count what fraction the rejected pixels would have contributed (including the weights, if any) if those pixels had not been rejected, and set that bit in the return value of Statistics::getOrMask() if it exceeds the given threshold.

Definition at line 735 of file Statistics.cc.

735  {
736  int oldSize = _maskPropagationThresholds.size();
737  if (oldSize <= bit) {
738  int newSize = bit + 1;
739  _maskPropagationThresholds.resize(newSize);
740  for (int i = oldSize; i < bit; ++i) {
741  _maskPropagationThresholds[i] = 1.0;
742  }
743  }
744  _maskPropagationThresholds[bit] = threshold;
745 }
T resize(T... args)
T size(T... args)

◆ setNanSafe()

void lsst::afw::math::StatisticsControl::setNanSafe ( bool  isNanSafe)
inlinenoexcept

Definition at line 152 of file Statistics.h.

152 { _isNanSafe = isNanSafe; }

◆ setNoGoodPixelsMask()

void lsst::afw::math::StatisticsControl::setNoGoodPixelsMask ( int  noGoodPixelsMask)
inline

Definition at line 151 of file Statistics.h.

151 { _noGoodPixelsMask = noGoodPixelsMask; }

◆ setNumIter()

void lsst::afw::math::StatisticsControl::setNumIter ( int  numIter)
inline

Definition at line 146 of file Statistics.h.

146  {
147  assert(numIter > 0);
148  _numIter = numIter;
149  }

◆ setNumSigmaClip()

void lsst::afw::math::StatisticsControl::setNumSigmaClip ( double  numSigmaClip)
inline

Definition at line 142 of file Statistics.h.

142  {
143  assert(numSigmaClip > 0);
144  _numSigmaClip = numSigmaClip;
145  }

◆ setWeighted()

void lsst::afw::math::StatisticsControl::setWeighted ( bool  useWeights)
inlinenoexcept

Friends And Related Function Documentation

◆ Statistics

friend class Statistics
friend

Definition at line 159 of file Statistics.h.


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