LSSTApplications  10.0-2-g4f67435,11.0.rc2+1,11.0.rc2+12,11.0.rc2+3,11.0.rc2+4,11.0.rc2+5,11.0.rc2+6,11.0.rc2+7,11.0.rc2+8
LSSTDataManagementBasePackage
Public Types | Public Member Functions | Private Types | Private Attributes | Friends | List of all members
lsst.afw.math::StatisticsControl Class Reference

Pass parameters to a Statistics objectA class to pass parameters which control how the stats are calculated. More...

#include <Statistics.h>

Public Types

typedef boost::shared_ptr
< StatisticsControl
Ptr
 
typedef boost::shared_ptr
< StatisticsControl > const 
ConstPtr
 

Public Member Functions

 StatisticsControl (double numSigmaClip=3.0, int numIter=3, lsst::afw::image::MaskPixel andMask=0x0, bool isNanSafe=true, int useWeights=WEIGHTS_NONE)
 
double getNumSigmaClip () const
 
int getNumIter () const
 
int getAndMask () const
 
int getNoGoodPixelsMask () const
 
bool getNanSafe () const
 
bool getWeighted () const
 
bool getWeightedIsSet () const
 
bool getCalcErrorFromInputVariance () const
 
void setNumSigmaClip (double numSigmaClip)
 
void setNumIter (int numIter)
 
void setAndMask (int andMask)
 
void setNoGoodPixelsMask (int noGoodPixelsMask)
 
void setNanSafe (bool isNanSafe)
 
void setWeighted (bool useWeights)
 
void setCalcErrorFromInputVariance (bool calcErrorFromInputVariance)
 
double getMaskPropagationThreshold (int bit) const
 
void setMaskPropagationThreshold (int bit, double threshold)
 

Private Types

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

Private Attributes

double _numSigmaClip
 
int _numIter
 
int _andMask
 
int _noGoodPixelsMask
 
bool _isNanSafe
 
WeightsBoolean _useWeights
 
bool _calcErrorFromInputVariance
 
std::vector< double > _maskPropagationThresholds
 

Friends

class Statistics
 

Detailed Description

Pass parameters to a Statistics object

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

Examples:
imageStatistics.cc.

Definition at line 92 of file Statistics.h.

Member Typedef Documentation

Definition at line 97 of file Statistics.h.

Definition at line 96 of file Statistics.h.

Member Enumeration Documentation

Constructor & Destructor Documentation

lsst.afw.math::StatisticsControl::StatisticsControl ( double  numSigmaClip = 3.0,
int  numIter = 3,
lsst::afw::image::MaskPixel  andMask = 0x0,
bool  isNanSafe = true,
int  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 99 of file Statistics.h.

105  :
106  _numSigmaClip(numSigmaClip),
107  _numIter(numIter),
108  _andMask(andMask),
110  _isNanSafe(isNanSafe),
111  _useWeights(useWeights == 0 ? WEIGHTS_FALSE : (useWeights == 1) ? WEIGHTS_TRUE : WEIGHTS_NONE),
114  {
115  try {
117  } catch(lsst::pex::exceptions::InvalidParameterError) {
118  ; // Mask has no NO_DATA plane defined
119  }
120 
121  assert(_numSigmaClip > 0);
122  assert(_numIter > 0);
123  }
int const x0
Definition: saturated.cc:45
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:860
std::vector< double > _maskPropagationThresholds
Definition: Statistics.h:165

Member Function Documentation

int lsst.afw.math::StatisticsControl::getAndMask ( ) const
inline

Definition at line 137 of file Statistics.h.

137 { return _andMask; }
bool lsst.afw.math::StatisticsControl::getCalcErrorFromInputVariance ( ) const
inline

Definition at line 142 of file Statistics.h.

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 691 of file Statistics.cc.

691  {
692  int oldSize = _maskPropagationThresholds.size();
693  if (oldSize < bit) {
694  return 1.0;
695  }
696  return _maskPropagationThresholds[bit];
697 }
std::vector< double > _maskPropagationThresholds
Definition: Statistics.h:165
bool lsst.afw.math::StatisticsControl::getNanSafe ( ) const
inline

Definition at line 139 of file Statistics.h.

139 { return _isNanSafe; }
int lsst.afw.math::StatisticsControl::getNoGoodPixelsMask ( ) const
inline

Definition at line 138 of file Statistics.h.

int lsst.afw.math::StatisticsControl::getNumIter ( ) const
inline

Definition at line 136 of file Statistics.h.

136 { return _numIter; }
double lsst.afw.math::StatisticsControl::getNumSigmaClip ( ) const
inline

Definition at line 135 of file Statistics.h.

135 { return _numSigmaClip; }
bool lsst.afw.math::StatisticsControl::getWeighted ( ) const
inline

Definition at line 140 of file Statistics.h.

bool lsst.afw.math::StatisticsControl::getWeightedIsSet ( ) const
inline

Definition at line 141 of file Statistics.h.

void lsst.afw.math::StatisticsControl::setAndMask ( int  andMask)
inline
Examples:
imageStatistics.cc.

Definition at line 146 of file Statistics.h.

146 { _andMask = andMask; }
void lsst.afw.math::StatisticsControl::setCalcErrorFromInputVariance ( bool  calcErrorFromInputVariance)
inline

Definition at line 150 of file Statistics.h.

150  {
151  _calcErrorFromInputVariance = calcErrorFromInputVariance;
152  }
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 699 of file Statistics.cc.

699  {
700  int oldSize = _maskPropagationThresholds.size();
701  if (oldSize <= bit) {
702  int newSize = bit + 1;
703  _maskPropagationThresholds.resize(newSize);
704  for (int i = oldSize; i < bit; ++i) {
706  }
707  }
708  _maskPropagationThresholds[bit] = threshold;
709 }
std::vector< double > _maskPropagationThresholds
Definition: Statistics.h:165
void lsst.afw.math::StatisticsControl::setNanSafe ( bool  isNanSafe)
inline
Examples:
imageStatistics.cc.

Definition at line 148 of file Statistics.h.

148 { _isNanSafe = isNanSafe; }
void lsst.afw.math::StatisticsControl::setNoGoodPixelsMask ( int  noGoodPixelsMask)
inline

Definition at line 147 of file Statistics.h.

147 { _noGoodPixelsMask = noGoodPixelsMask; }
void lsst.afw.math::StatisticsControl::setNumIter ( int  numIter)
inline
Examples:
imageStatistics.cc.

Definition at line 145 of file Statistics.h.

145 { assert(numIter > 0); _numIter = numIter; }
void lsst.afw.math::StatisticsControl::setNumSigmaClip ( double  numSigmaClip)
inline
Examples:
imageStatistics.cc.

Definition at line 144 of file Statistics.h.

144 { assert(numSigmaClip > 0); _numSigmaClip = numSigmaClip; }
void lsst.afw.math::StatisticsControl::setWeighted ( bool  useWeights)
inline

Friends And Related Function Documentation

friend class Statistics
friend

Definition at line 156 of file Statistics.h.

Member Data Documentation

int lsst.afw.math::StatisticsControl::_andMask
private

Definition at line 160 of file Statistics.h.

bool lsst.afw.math::StatisticsControl::_calcErrorFromInputVariance
private

Definition at line 164 of file Statistics.h.

bool lsst.afw.math::StatisticsControl::_isNanSafe
private

Definition at line 162 of file Statistics.h.

std::vector<double> lsst.afw.math::StatisticsControl::_maskPropagationThresholds
private

Definition at line 165 of file Statistics.h.

int lsst.afw.math::StatisticsControl::_noGoodPixelsMask
private

Definition at line 161 of file Statistics.h.

int lsst.afw.math::StatisticsControl::_numIter
private

Definition at line 159 of file Statistics.h.

double lsst.afw.math::StatisticsControl::_numSigmaClip
private

Definition at line 158 of file Statistics.h.

WeightsBoolean lsst.afw.math::StatisticsControl::_useWeights
private

Definition at line 163 of file Statistics.h.


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