51 double const IQ_TO_STDEV = 0.741301109252802;
57 bool operator()(T)
const {
60 template <
typename Ta,
typename Tb>
61 bool operator()(Ta, Tb)
const {
64 template <
typename Ta,
typename Tb,
typename Tc>
65 bool operator()(Ta, Tb, Tc)
const {
74 bool operator()(T)
const {
77 template <
typename Ta,
typename Tb>
78 bool operator()(Ta, Tb)
const {
81 template <
typename Ta,
typename Tb,
typename Tc>
82 bool operator()(Ta, Tb, Tc)
const {
91 bool operator()(T val)
const {
97 class CheckValueLtMin {
99 template <
typename Tval,
typename Tmin>
100 bool operator()(Tval val, Tmin
min)
const {
101 return (static_cast<Tmin>(val) < min);
106 class CheckValueGtMax {
108 template <
typename Tval,
typename Tmax>
109 bool operator()(Tval val, Tmax
max)
const {
110 return (static_cast<Tmax>(val) > max);
115 class CheckClipRange {
117 template <
typename Tval,
typename Tcen,
typename Tmax>
118 bool operator()(Tval val, Tcen center, Tmax cliplimit)
const {
119 Tmax tmp =
fabs(val - center);
120 return (tmp <= cliplimit);
125 typedef CheckFinite ChkFin;
126 typedef CheckValueLtMin ChkMin;
127 typedef CheckValueGtMax ChkMax;
128 typedef CheckClipRange ChkClip;
129 typedef AlwaysTrue AlwaysT;
130 typedef AlwaysFalse AlwaysF;
135 inline double varianceError(
double const variance,
int const n) {
136 return 2 * (n - 1) * variance * variance / static_cast<double>(n * n);
163 template <
typename IsFinite,
typename HasValueLtMin,
typename HasValueGtMax,
typename InClipRange,
164 bool useWeights,
typename ImageT,
typename MaskT,
typename VarianceT,
typename WeightT>
165 StandardReturn processPixels(ImageT
const &img, MaskT
const &msk, VarianceT
const &var,
166 WeightT
const &weights,
int const,
int const nCrude,
int const stride,
167 double const meanCrude,
double const cliplimit,
168 bool const weightsAreMultiplicative,
int const andMask,
169 bool const calcErrorFromInputVariance,
179 double min = (nCrude) ? meanCrude : MAX_DOUBLE;
180 double max = (nCrude) ? meanCrude : -MAX_DOUBLE;
186 for (
int iY = 0; iY < img.getHeight(); iY += stride) {
187 typename MaskT::x_iterator mptr = msk.row_begin(iY);
188 typename VarianceT::x_iterator vptr = var.row_begin(iY);
189 typename WeightT::x_iterator wptr = weights.row_begin(iY);
191 for (
typename ImageT::x_iterator ptr = img.row_begin(iY),
end = ptr + img.getWidth(); ptr !=
end;
192 ++ptr, ++mptr, ++vptr, ++wptr) {
193 if (IsFinite()(*ptr) && !(*mptr & andMask) &&
194 InClipRange()(*ptr, meanCrude, cliplimit)) {
196 double const delta = (*ptr - meanCrude);
199 double weight = *wptr;
200 if (weightsAreMultiplicative) {
210 sumw2 += weight * weight;
211 sumx += weight * delta;
212 sumx2 += weight * delta * delta;
214 if (calcErrorFromInputVariance) {
215 double const var = *vptr;
216 sumvw2 += var * weight * weight;
220 sumx2 += delta * delta;
222 if (calcErrorFromInputVariance) {
223 double const var = *vptr;
228 allPixelOrMask |= *mptr;
230 if (HasValueLtMin()(*ptr,
min)) {
233 if (HasValueGtMax()(*ptr,
max)) {
238 for (
int bit = 0, nBits = maskPropagationThresholds.
size(); bit < nBits; ++bit) {
244 if (!weightsAreMultiplicative) {
248 weight = 1.0 / weight;
251 rejectedWeightsByBit[bit] += weight;
268 for (
int bit = 0, nBits = maskPropagationThresholds.
size(); bit < nBits; ++bit) {
269 double hypotheticalTotalWeight = sumw + rejectedWeightsByBit[bit];
270 rejectedWeightsByBit[bit] /= hypotheticalTotalWeight;
271 if (rejectedWeightsByBit[bit] > maskPropagationThresholds[bit]) {
272 allPixelOrMask |= (1 << bit);
280 variance = sumx2 / sumw -
::pow(mean, 2);
281 variance *= sumw * sumw / (sumw * sumw - sumw2);
284 if (calcErrorFromInputVariance) {
285 meanVar = sumvw2 / (sumw * sumw);
287 meanVar = variance * sumw2 / (sumw * sumw);
290 double varVar = varianceError(variance, n);
292 sumx += sumw * meanCrude;
295 return StandardReturn(n, sumx, Statistics::Value(mean, meanVar), Statistics::Value(variance, varVar), min,
296 max, allPixelOrMask);
299 template <
typename IsFinite,
typename HasValueLtMin,
typename HasValueGtMax,
typename InClipRange,
300 bool useWeights,
typename ImageT,
typename MaskT,
typename VarianceT,
typename WeightT>
301 StandardReturn processPixels(ImageT
const &img, MaskT
const &msk, VarianceT
const &var,
302 WeightT
const &weights,
int const flags,
int const nCrude,
int const stride,
303 double const meanCrude,
double const cliplimit,
304 bool const weightsAreMultiplicative,
int const andMask,
305 bool const calcErrorFromInputVariance,
bool doGetWeighted,
308 return processPixels<IsFinite, HasValueLtMin, HasValueGtMax, InClipRange, true>(
309 img, msk, var, weights, flags, nCrude, 1, meanCrude, cliplimit, weightsAreMultiplicative,
310 andMask, calcErrorFromInputVariance, maskPropagationThresholds);
312 return processPixels<IsFinite, HasValueLtMin, HasValueGtMax, InClipRange, false>(
313 img, msk, var, weights, flags, nCrude, 1, meanCrude, cliplimit, weightsAreMultiplicative,
314 andMask, calcErrorFromInputVariance, maskPropagationThresholds);
318 template <
typename IsFinite,
typename HasValueLtMin,
typename HasValueGtMax,
typename InClipRange,
319 bool useWeights,
typename ImageT,
typename MaskT,
typename VarianceT,
typename WeightT>
320 StandardReturn processPixels(ImageT
const &img, MaskT
const &msk, VarianceT
const &var,
321 WeightT
const &weights,
int const flags,
int const nCrude,
int const stride,
322 double const meanCrude,
double const cliplimit,
323 bool const weightsAreMultiplicative,
int const andMask,
324 bool const calcErrorFromInputVariance,
bool doCheckFinite,
bool doGetWeighted,
327 return processPixels<CheckFinite, HasValueLtMin, HasValueGtMax, InClipRange, useWeights>(
328 img, msk, var, weights, flags, nCrude, 1, meanCrude, cliplimit, weightsAreMultiplicative,
329 andMask, calcErrorFromInputVariance, doGetWeighted, maskPropagationThresholds);
331 return processPixels<AlwaysTrue, HasValueLtMin, HasValueGtMax, InClipRange, useWeights>(
332 img, msk, var, weights, flags, nCrude, 1, meanCrude, cliplimit, weightsAreMultiplicative,
333 andMask, calcErrorFromInputVariance, doGetWeighted, maskPropagationThresholds);
354 template <
typename ImageT,
typename MaskT,
typename VarianceT,
typename WeightT>
355 StandardReturn getStandard(ImageT
const &img, MaskT
const &msk, VarianceT
const &var, WeightT
const &weights,
356 int const flags,
bool const weightsAreMultiplicative,
int const andMask,
357 bool const calcErrorFromInputVariance,
bool doCheckFinite,
bool doGetWeighted,
362 double meanCrude = 0.0;
365 int const nPix = img.getWidth() * img.getHeight();
373 double cliplimit = -1;
374 StandardReturn values = processPixels<ChkFin, AlwaysF, AlwaysF, AlwaysT, true>(
375 img, msk, var, weights, flags, nCrude, strideCrude, meanCrude, cliplimit,
376 weightsAreMultiplicative, andMask, calcErrorFromInputVariance, doCheckFinite, doGetWeighted,
377 maskPropagationThresholds);
378 nCrude = std::get<0>(values);
379 double sumCrude = std::get<1>(values);
383 meanCrude = sumCrude / nCrude;
390 if (flags & (
MIN |
MAX)) {
391 return processPixels<ChkFin, ChkMin, ChkMax, AlwaysT, true>(
392 img, msk, var, weights, flags, nCrude, 1, meanCrude, cliplimit, weightsAreMultiplicative,
393 andMask, calcErrorFromInputVariance,
true, doGetWeighted, maskPropagationThresholds);
395 return processPixels<ChkFin, AlwaysF, AlwaysF, AlwaysT, true>(
396 img, msk, var, weights, flags, nCrude, 1, meanCrude, cliplimit, weightsAreMultiplicative,
397 andMask, calcErrorFromInputVariance, doCheckFinite, doGetWeighted, maskPropagationThresholds);
419 template <
typename ImageT,
typename MaskT,
typename VarianceT,
typename WeightT>
420 StandardReturn getStandard(ImageT
const &img, MaskT
const &msk, VarianceT
const &var, WeightT
const &weights,
423 bool const weightsAreMultiplicative,
int const andMask,
424 bool const calcErrorFromInputVariance,
bool doCheckFinite,
bool doGetWeighted,
426 double const center = clipinfo.first;
427 double const cliplimit = clipinfo.second;
430 return StandardReturn(0, NaN, Statistics::Value(NaN, NaN), Statistics::Value(NaN, NaN), NaN, NaN,
436 int const stride = 1;
439 if (flags & (
MIN |
MAX)) {
440 return processPixels<ChkFin, ChkMin, ChkMax, ChkClip, true>(
441 img, msk, var, weights, flags, nCrude, stride, center, cliplimit, weightsAreMultiplicative,
442 andMask, calcErrorFromInputVariance,
true, doGetWeighted, maskPropagationThresholds);
444 return processPixels<ChkFin, AlwaysF, AlwaysF, ChkClip, true>(
445 img, msk, var, weights, flags, nCrude, stride, center, cliplimit, weightsAreMultiplicative,
446 andMask, calcErrorFromInputVariance, doCheckFinite, doGetWeighted, maskPropagationThresholds);
457 template <
typename Pixel>
459 assert(fraction >= 0.0 && fraction <= 1.0);
461 int const n = img.
size();
464 double const idx = fraction * (n - 1);
472 int const q1 =
static_cast<int>(idx);
473 int const q2 = q1 + 1;
477 if (fraction > 0.5) {
485 double val1 =
static_cast<double>(*mid1);
486 double val2 =
static_cast<double>(*mid2);
487 double w1 = (
static_cast<double>(q2) - idx);
488 double w2 = (idx -
static_cast<double>(q1));
489 return w1 * val1 + w2 * val2;
505 template <
typename Pixel>
507 int const n = img.
size();
510 double const idx50 = 0.50 * (n - 1);
511 double const idx25 = 0.25 * (n - 1);
512 double const idx75 = 0.75 * (n - 1);
519 int const q50a =
static_cast<int>(idx50);
520 int const q50b = q50a + 1;
521 int const q25a =
static_cast<int>(idx25);
522 int const q25b = q25a + 1;
523 int const q75a =
static_cast<int>(idx75);
524 int const q75b = q75a + 1;
544 double val50a =
static_cast<double>(*mid50a);
545 double val50b =
static_cast<double>(*mid50b);
546 double w50a = (
static_cast<double>(q50b) - idx50);
547 double w50b = (idx50 -
static_cast<double>(q50a));
548 double median = w50a * val50a + w50b * val50b;
550 double val25a =
static_cast<double>(*mid25a);
551 double val25b =
static_cast<double>(*mid25b);
552 double w25a = (
static_cast<double>(q25b) - idx25);
553 double w25b = (idx25 -
static_cast<double>(q25a));
554 double q1 = w25a * val25a + w25b * val25b;
556 double val75a =
static_cast<double>(*mid75a);
557 double val75b =
static_cast<double>(*mid75b);
558 double w75a = (
static_cast<double>(q75b) - idx75);
559 double w75b = (idx75 -
static_cast<double>(q75a));
560 double q3 = w75a * val75a + w75b * val75b;
562 return MedianQuartileReturn(median, q1, q3);
564 return MedianQuartileReturn(img[0], img[0], img[0]);
566 return MedianQuartileReturn(NaN, NaN, NaN);
577 template <
typename IsFinite,
typename ImageT,
typename MaskT,
typename VarianceT>
579 VarianceT
const &,
int const andMask) {
584 for (
int i_y = 0; i_y < img.getHeight(); ++i_y) {
585 typename MaskT::x_iterator mptr = msk.row_begin(i_y);
586 for (
typename ImageT::x_iterator ptr = img.row_begin(i_y),
end = img.row_end(i_y); ptr !=
end;
588 if (IsFinite()(*ptr) && !(*mptr & andMask)) {
589 imgcp->push_back(*ptr);
599 double StatisticsControl::getMaskPropagationThreshold(
int bit)
const {
600 int oldSize = _maskPropagationThresholds.size();
604 return _maskPropagationThresholds[bit];
607 void StatisticsControl::setMaskPropagationThreshold(
int bit,
double threshold) {
608 int oldSize = _maskPropagationThresholds.size();
609 if (oldSize <= bit) {
610 int newSize = bit + 1;
611 _maskPropagationThresholds.resize(newSize);
612 for (
int i = oldSize; i < bit; ++i) {
613 _maskPropagationThresholds[i] = 1.0;
616 _maskPropagationThresholds[bit] = threshold;
621 if (statisticsProperty.
size() == 0) {
622 statisticsProperty[
"NOTHING"] =
NOTHING;
623 statisticsProperty[
"ERRORS"] =
ERRORS;
624 statisticsProperty[
"NPOINT"] =
NPOINT;
625 statisticsProperty[
"MEAN"] =
MEAN;
626 statisticsProperty[
"STDEV"] =
STDEV;
627 statisticsProperty[
"VARIANCE"] =
VARIANCE;
628 statisticsProperty[
"MEDIAN"] =
MEDIAN;
629 statisticsProperty[
"IQRANGE"] =
IQRANGE;
630 statisticsProperty[
"MEANCLIP"] =
MEANCLIP;
631 statisticsProperty[
"STDEVCLIP"] =
STDEVCLIP;
633 statisticsProperty[
"MIN"] =
MIN;
634 statisticsProperty[
"MAX"] =
MAX;
635 statisticsProperty[
"SUM"] =
SUM;
636 statisticsProperty[
"MEANSQUARE"] =
MEANSQUARE;
637 statisticsProperty[
"ORMASK"] =
ORMASK;
638 statisticsProperty[
"NCLIPPED"] =
NCLIPPED;
639 statisticsProperty[
"NMASKED"] =
NMASKED;
641 return statisticsProperty[property];
644 template <
typename ImageT,
typename MaskT,
typename VarianceT>
645 Statistics::Statistics(ImageT
const &img, MaskT
const &msk, VarianceT
const &var,
int const flags,
654 _varianceclip(NaN, NaN),
660 _weightsAreMultiplicative(false) {
661 doStatistics(img, msk, var, var, _flags, _sctrl);
665 template <
typename T>
666 bool isEmpty(T
const &t) {
670 template <
typename T>
676 template <
typename ImageT1,
typename ImageT2>
677 void checkDimensions(ImageT1
const &image1, ImageT2
const &image2) {
678 if (image1.getDimensions() != image2.getDimensions()) {
680 (boost::format(
"Image sizes don't match: %s vs %s") % image1.getDimensions() %
681 image2.getDimensions())
687 template <
typename ImageT,
typename PixelT>
689 template <
typename ImageT,
typename PixelT>
693 template <
typename ImageT,
typename MaskT,
typename VarianceT,
typename WeightT>
703 _varianceclip(NaN, NaN),
709 _weightsAreMultiplicative(true) {
710 if (!isEmpty(weights)) {
713 "You must use the weights if you provide them");
718 doStatistics(img, msk, var, weights, _flags, _sctrl);
721 template <
typename ImageT,
typename MaskT,
typename VarianceT,
typename WeightT>
722 void Statistics::doStatistics(ImageT
const &img, MaskT
const &msk, VarianceT
const &var,
724 int const num = img.getWidth() * img.getHeight();
729 checkDimensions(img, msk);
730 checkDimensions(img, var);
732 checkDimensions(img, weights);
739 StandardReturn standard =
740 getStandard(img, msk, var, weights, flags, _weightsAreMultiplicative, _sctrl.
getAndMask(),
742 _sctrl._maskPropagationThresholds);
744 _n = std::get<0>(standard);
745 _sum = std::get<1>(standard);
746 _mean = std::get<2>(standard);
747 _variance = std::get<3>(standard);
748 _min = std::get<4>(standard);
749 _max = std::get<5>(standard);
750 _allPixelOrMask = std::get<6>(standard);
764 imgcp = makeVectorCopy<ChkFin>(img, msk, var, _sctrl.
getAndMask());
766 imgcp = makeVectorCopy<AlwaysT>(img, msk, var, _sctrl.
getAndMask());
771 _median =
Value(percentile(*imgcp, 0.5), NaN);
773 MedianQuartileReturn mq = medianAndQuartiles(*imgcp);
774 _median =
Value(std::get<0>(mq), NaN);
775 _iqrange = std::get<2>(mq) - std::get<1>(mq);
779 for (
int i_i = 0; i_i < _sctrl.
getNumIter(); ++i_i) {
780 double const center = ((i_i > 0) ? _meanclip : _median).first;
781 double const hwidth = (i_i > 0 && _n > 1)
786 StandardReturn clipped = getStandard(
787 img, msk, var, weights, flags, clipinfo, _weightsAreMultiplicative,
789 _sctrl.
getWeighted(), _sctrl._maskPropagationThresholds);
791 int const nClip = std::get<0>(clipped);
792 _nClipped = _n - nClip;
793 _meanclip = std::get<2>(clipped);
794 double const varClip = std::get<3>(clipped).
first;
796 _varianceclip =
Value(varClip, varianceError(varClip, nClip));
807 if (!(prop & _flags)) {
809 (boost::format(
"You didn't ask me to calculate %d") % prop).str());
815 ret.first =
static_cast<double>(_n);
822 ret.first =
static_cast<double>(_nClipped);
823 if (_flags & ERRORS) {
829 ret.first =
static_cast<double>(_nMasked);
830 if (_flags & ERRORS) {
836 ret.first =
static_cast<double>(_sum);
837 if (_flags & ERRORS) {
844 ret.first = _mean.first;
845 if (_flags & ERRORS) {
846 ret.second = ::sqrt(_mean.second);
850 ret.first = _meanclip.first;
851 if (_flags & ERRORS) {
852 ret.second = ::sqrt(_meanclip.second);
858 ret.first = _variance.first;
859 if (_flags & ERRORS) {
860 ret.second = ::sqrt(_variance.second);
864 ret.first =
sqrt(_variance.first);
865 if (_flags & ERRORS) {
866 ret.second = 0.5 * ::sqrt(_variance.second) / ret.first;
870 ret.first = _varianceclip.first;
871 if (_flags & ERRORS) {
872 ret.second = ret.second;
876 ret.first =
sqrt(_varianceclip.first);
877 if (_flags & ERRORS) {
878 ret.second = 0.5 * ::sqrt(_varianceclip.second) / ret.first;
883 ret.first = (_n - 1) / static_cast<double>(_n) * _variance.first + ::pow(_mean.first, 2);
884 if (_flags & ERRORS) {
885 ret.second = ::sqrt(2 * ::
pow(ret.first / _n, 2));
892 if (_flags & ERRORS) {
898 if (_flags & ERRORS) {
903 ret.first = _median.first;
904 if (_flags & ERRORS) {
909 ret.first = _iqrange;
910 if (_flags & ERRORS) {
922 "getValue() may only be called without a parameter" 923 " if you asked for only one statistic");
951 _varianceclip(NaN, NaN),
958 "Statistics<Mask> only supports NPOINT and SUM");
972 for (
int y = 0; y != msk.
getHeight(); ++y) {
987 return Statistics(msk, msk, msk, flags, sctrl);
998 #define STAT Statistics 1002 #define INSTANTIATE_MASKEDIMAGE_STATISTICS(TYPE) \ 1003 template STAT::Statistics(image::Image<TYPE> const &img, image::Mask<image::MaskPixel> const &msk, \ 1004 image::Image<VPixel> const &var, int const flags, \ 1005 StatisticsControl const &sctrl); \ 1006 template STAT::Statistics(image::Image<TYPE> const &img, image::Mask<image::MaskPixel> const &msk, \ 1007 image::Image<VPixel> const &var, image::Image<VPixel> const &weights, \ 1008 int const flags, StatisticsControl const &sctrl); \ 1009 template STAT::Statistics(image::Image<TYPE> const &img, image::Mask<image::MaskPixel> const &msk, \ 1010 image::Image<VPixel> const &var, ImageImposter<VPixel> const &weights, \ 1011 int const flags, StatisticsControl const &sctrl) 1013 #define INSTANTIATE_MASKEDIMAGE_STATISTICS_NO_MASK(TYPE) \ 1014 template STAT::Statistics(image::Image<TYPE> const &img, MaskImposter<image::MaskPixel> const &msk, \ 1015 image::Image<VPixel> const &var, int const flags, \ 1016 StatisticsControl const &sctrl); \ 1017 template STAT::Statistics(image::Image<TYPE> const &img, MaskImposter<image::MaskPixel> const &msk, \ 1018 image::Image<VPixel> const &var, image::Image<VPixel> const &weights, \ 1019 int const flags, StatisticsControl const &sctrl) 1021 #define INSTANTIATE_MASKEDIMAGE_STATISTICS_NO_VAR(TYPE) \ 1022 template STAT::Statistics(image::Image<TYPE> const &img, image::Mask<image::MaskPixel> const &msk, \ 1023 MaskImposter<VPixel> const &var, int const flags, \ 1024 StatisticsControl const &sctrl); \ 1025 template STAT::Statistics(image::Image<TYPE> const &img, image::Mask<image::MaskPixel> const &msk, \ 1026 MaskImposter<VPixel> const &var, image::Image<VPixel> const &weights, \ 1027 int const flags, StatisticsControl const &sctrl); \ 1028 template STAT::Statistics(image::Image<TYPE> const &img, image::Mask<image::MaskPixel> const &msk, \ 1029 MaskImposter<VPixel> const &var, ImageImposter<VPixel> const &weights, \ 1030 int const flags, StatisticsControl const &sctrl) 1032 #define INSTANTIATE_REGULARIMAGE_STATISTICS(TYPE) \ 1033 template STAT::Statistics(image::Image<TYPE> const &img, MaskImposter<image::MaskPixel> const &msk, \ 1034 MaskImposter<VPixel> const &var, int const flags, \ 1035 StatisticsControl const &sctrl) 1037 #define INSTANTIATE_VECTOR_STATISTICS(TYPE) \ 1038 template STAT::Statistics(ImageImposter<TYPE> const &img, MaskImposter<image::MaskPixel> const &msk, \ 1039 MaskImposter<VPixel> const &var, int const flags, \ 1040 StatisticsControl const &sctrl); \ 1041 template STAT::Statistics(ImageImposter<TYPE> const &img, MaskImposter<image::MaskPixel> const &msk, \ 1042 MaskImposter<VPixel> const &var, ImageImposter<VPixel> const &weights, \ 1043 int const flags, StatisticsControl const &sctrl) 1045 #define INSTANTIATE_IMAGE_STATISTICS(T) \ 1046 INSTANTIATE_MASKEDIMAGE_STATISTICS(T); \ 1047 INSTANTIATE_MASKEDIMAGE_STATISTICS_NO_VAR(T); \ 1048 INSTANTIATE_MASKEDIMAGE_STATISTICS_NO_MASK(T); \ 1049 INSTANTIATE_REGULARIMAGE_STATISTICS(T); \ 1050 INSTANTIATE_VECTOR_STATISTICS(T) 1052 INSTANTIATE_IMAGE_STATISTICS(
double);
1053 INSTANTIATE_IMAGE_STATISTICS(
float);
1054 INSTANTIATE_IMAGE_STATISTICS(
int);
Value getResult(Property const prop=NOTHING) const
Return the value and error in the specified statistic (e.g.
get the or-mask of all pixels used.
double getError(Property const prop=NOTHING) const
Return the error in the desired property (if specified in the constructor)
int getHeight() const
Return the number of rows in the image.
estimate sample standard deviation
find mean value of square of pixel values
We don't want anything.
bool getCalcErrorFromInputVariance() const
Include errors of requested quantities.
x_iterator row_begin(int y) const
Return an x_iterator to the start of the y'th row.
A class to evaluate image statistics.
Statistics(ImageT const &img, MaskT const &msk, VarianceT const &var, int const flags, StatisticsControl const &sctrl=StatisticsControl())
Constructor for Statistics object.
estimate sample N-sigma clipped stdev (N set in StatisticsControl, default=3)
std::pair< double, double > Value
The type used to report (value, error) for desired statistics.
Property stringToStatisticsProperty(std::string const property)
Conversion function to switch a string to a Property (see Statistics.h)
Pass parameters to a Statistics object.
estimate sample N-sigma clipped mean (N set in StatisticsControl, default=3)
A base class for image defects.
Represent a 2-dimensional array of bitmask pixels.
estimate sample N-sigma clipped variance (N set in StatisticsControl, default=3)
A Mask wrapper to provide an infinite_iterator for Mask::row_begin().
bool getWeightedIsSet() const
void setWeighted(bool useWeights)
double getValue(Property const prop=NOTHING) const
Return the value of the desired property (if specified in the constructor)
#define LSST_EXCEPT(type,...)
estimate sample inter-quartile range
int getWidth() const
Return the number of columns in the image.
x_iterator row_end(int y) const
Return an x_iterator to the end of the y'th row.
find sum of pixels in the image
double getNumSigmaClip() const
float VariancePixel
default type for MaskedImage variance images
Property
control what is calculated
A class to represent a 2-dimensional array of pixels.
Statistics makeStatistics(lsst::afw::image::Image< Pixel > const &img, lsst::afw::image::Mask< image::MaskPixel > const &msk, int const flags, StatisticsControl const &sctrl=StatisticsControl())
Handle a watered-down front-end to the constructor (no variance)