LSST Applications
21.0.0-147-g0e635eb1+1acddb5be5,22.0.0+052faf71bd,22.0.0+1ea9a8b2b2,22.0.0+6312710a6c,22.0.0+729191ecac,22.0.0+7589c3a021,22.0.0+9f079a9461,22.0.1-1-g7d6de66+b8044ec9de,22.0.1-1-g87000a6+536b1ee016,22.0.1-1-g8e32f31+6312710a6c,22.0.1-10-gd060f87+016f7cdc03,22.0.1-12-g9c3108e+df145f6f68,22.0.1-16-g314fa6d+c825727ab8,22.0.1-19-g93a5c75+d23f2fb6d8,22.0.1-19-gb93eaa13+aab3ef7709,22.0.1-2-g8ef0a89+b8044ec9de,22.0.1-2-g92698f7+9f079a9461,22.0.1-2-ga9b0f51+052faf71bd,22.0.1-2-gac51dbf+052faf71bd,22.0.1-2-gb66926d+6312710a6c,22.0.1-2-gcb770ba+09e3807989,22.0.1-20-g32debb5+b8044ec9de,22.0.1-23-gc2439a9a+fb0756638e,22.0.1-3-g496fd5d+09117f784f,22.0.1-3-g59f966b+1e6ba2c031,22.0.1-3-g849a1b8+f8b568069f,22.0.1-3-gaaec9c0+c5c846a8b1,22.0.1-32-g5ddfab5d3+60ce4897b0,22.0.1-4-g037fbe1+64e601228d,22.0.1-4-g8623105+b8044ec9de,22.0.1-5-g096abc9+d18c45d440,22.0.1-5-g15c806e+57f5c03693,22.0.1-7-gba73697+57f5c03693,master-g6e05de7fdc+c1283a92b8,master-g72cdda8301+729191ecac,w.2021.39
LSST Data Management Base Package
|
A class to evaluate image statistics. More...
#include <Statistics.h>
Public Types | |
using | Value = std::pair< double, double > |
The type used to report (value, error) for desired statistics. More... | |
Public Member Functions | |
template<typename ImageT , typename MaskT , typename VarianceT > | |
Statistics (ImageT const &img, MaskT const &msk, VarianceT const &var, int const flags, StatisticsControl const &sctrl=StatisticsControl()) | |
Constructor for Statistics object. More... | |
template<typename ImageT , typename MaskT , typename VarianceT , typename WeightT > | |
Statistics (ImageT const &img, MaskT const &msk, VarianceT const &var, WeightT const &weights, int const flags, StatisticsControl const &sctrl=StatisticsControl()) | |
Statistics (Statistics const &)=default | |
Statistics (Statistics &&)=default | |
Statistics & | operator= (Statistics const &)=default |
Statistics & | operator= (Statistics &&)=default |
~Statistics () noexcept=default | |
Value | getResult (Property const prop=NOTHING) const |
Return the value and error in the specified statistic (e.g. More... | |
double | getError (Property const prop=NOTHING) const |
Return the error in the desired property (if specified in the constructor) More... | |
double | getValue (Property const prop=NOTHING) const |
Return the value of the desired property (if specified in the constructor) More... | |
lsst::afw::image::MaskPixel | getOrMask () const noexcept |
template<> | |
Statistics (image::Mask< image::MaskPixel > const &msk, image::Mask< image::MaskPixel > const &msk2, image::Mask< image::MaskPixel > const &var, int const flags, StatisticsControl const &sctrl) | |
Related Functions | |
(Note that these are not member functions.) | |
template<typename Pixel > | |
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) More... | |
template<typename ImageT , typename MaskT , typename VarianceT > | |
Statistics | makeStatistics (ImageT const &img, MaskT const &msk, VarianceT const &var, int const flags, StatisticsControl const &sctrl=StatisticsControl()) |
Handle a straight front-end to the constructor. More... | |
template<typename Pixel > | |
Statistics | makeStatistics (lsst::afw::image::MaskedImage< Pixel > const &mimg, int const flags, StatisticsControl const &sctrl=StatisticsControl()) |
Handle MaskedImages, just pass the getImage() and getMask() values right on through. More... | |
template<typename Pixel > | |
Statistics | makeStatistics (lsst::afw::image::MaskedImage< Pixel > const &mimg, lsst::afw::image::Image< WeightPixel > const &weights, int const flags, StatisticsControl const &sctrl=StatisticsControl()) |
Handle MaskedImages, just pass the getImage() and getMask() values right on through. More... | |
Statistics | makeStatistics (lsst::afw::image::Mask< lsst::afw::image::MaskPixel > const &msk, int const flags, StatisticsControl const &sctrl=StatisticsControl()) |
Specialization to handle Masks. More... | |
template<typename Pixel > | |
Statistics | makeStatistics (lsst::afw::image::Image< Pixel > const &img, int const flags, StatisticsControl const &sctrl=StatisticsControl()) |
The makeStatistics() overload to handle regular (non-masked) Images. More... | |
template<typename EntryT > | |
Statistics | makeStatistics (std::vector< EntryT > const &v, int const flags, StatisticsControl const &sctrl=StatisticsControl()) |
The makeStatistics() overload to handle std::vector<> More... | |
template<typename EntryT > | |
Statistics | makeStatistics (std::vector< EntryT > const &v, std::vector< WeightPixel > const &vweights, int const flags, StatisticsControl const &sctrl=StatisticsControl()) |
The makeStatistics() overload to handle std::vector<> More... | |
template<typename EntryT > | |
Statistics | makeStatistics (lsst::afw::math::MaskedVector< EntryT > const &mv, int const flags, StatisticsControl const &sctrl=StatisticsControl()) |
The makeStatistics() overload to handle lsst::afw::math::MaskedVector<> More... | |
template<typename EntryT > | |
Statistics | makeStatistics (lsst::afw::math::MaskedVector< EntryT > const &mv, std::vector< WeightPixel > const &vweights, int const flags, StatisticsControl const &sctrl=StatisticsControl()) |
The makeStatistics() overload to handle lsst::afw::math::MaskedVector<> More... | |
A class to evaluate image statistics.
The basic strategy is to construct a Statistics object from an Image and a statement of what we want to know. The desired results can then be returned using Statistics methods. A StatisticsControl object is used to pass parameters. The statistics currently implemented are listed in the enum Properties in Statistics.h.
// sets NumSigclip (3.0), and NumIter (3) for clipping lsst::afw::math::StatisticsControl sctrl(3.0, 3); sctrl.setNumSigmaClip(4.0); // reset number of standard deviations for N-sigma clipping sctrl.setNumIter(5); // reset number of iterations for N-sigma clipping sctrl.setAndMask(0x1); // ignore pixels with these mask bits set sctrl.setNanSafe(true); // check for NaNs & Infs, a bit slower (default=true) lsst::afw::math::Statistics statobj = lsst::afw::math::makeStatistics(*img, afwMath::NPOINT | afwMath::MEAN | afwMath::MEANCLIP, sctrl); double const n = statobj.getValue(lsst::afw::math::NPOINT); std::pair<double, double> const mean = statobj.getResult(lsst::afw::math::MEAN); // Returns (value, error) double const meanError = statobj.getError(lsst::afw::math::MEAN); // just the error
makeStatistics
, rather that the constructor directly so that the compiler could deduce the types – cf. std::make_pair()
Definition at line 220 of file Statistics.h.
using lsst::afw::math::Statistics::Value = std::pair<double, double> |
The type used to report (value, error) for desired statistics.
Definition at line 223 of file Statistics.h.
|
explicit |
Constructor for Statistics object.
img | Image whose properties we want |
msk | Mask to control which pixels are included |
var | Variances corresponding to values in Image |
flags | Describe what we want to calculate |
sctrl | Control how things are calculated |
getValue
etc. Definition at line 764 of file Statistics.cc.
|
explicit |
img | Image whose properties we want |
msk | Mask to control which pixels are included |
var | Variances corresponding to values in Image |
weights | Weights to use corresponding to values in Image |
flags | Describe what we want to calculate |
sctrl | Control how things are calculated |
Definition at line 813 of file Statistics.cc.
|
default |
|
default |
|
defaultnoexcept |
lsst::afw::math::Statistics::Statistics | ( | image::Mask< image::MaskPixel > const & | msk, |
image::Mask< image::MaskPixel > const & | msk2, | ||
image::Mask< image::MaskPixel > const & | var, | ||
int const | flags, | ||
StatisticsControl const & | sctrl | ||
) |
Definition at line 1061 of file Statistics.cc.
Return the error in the desired property (if specified in the constructor)
prop | the afw::math::Property to retrieve. If NOTHING (default) and you only asked for one property in the constructor, that property's error is returned |
Definition at line 1049 of file Statistics.cc.
|
inlinenoexcept |
Definition at line 288 of file Statistics.h.
std::pair< double, double > lsst::afw::math::Statistics::getResult | ( | Property const | prop = NOTHING | ) | const |
Return the value and error in the specified statistic (e.g.
MEAN)
prop | the afw::math::Property to retrieve. If NOTHING (default) and you only asked for one property (and maybe its error) in the constructor, that property is returned |
Definition at line 922 of file Statistics.cc.
Return the value of the desired property (if specified in the constructor)
prop | the afw::math::Property to retrieve. If NOTHING (default) and you only asked for one property in the constructor, that property is returned |
Definition at line 1047 of file Statistics.cc.
|
default |
|
default |
|
related |
Handle a straight front-end to the constructor.
Definition at line 371 of file Statistics.h.
|
related |
The makeStatistics() overload to handle regular (non-masked) Images.
img | Image (or Image) whose properties we want |
flags | Describe what we want to calculate |
sctrl | Control calculation |
Definition at line 425 of file Statistics.h.
|
related |
Handle a watered-down front-end to the constructor (no variance)
Definition at line 359 of file Statistics.h.
|
related |
Specialization to handle Masks.
msk | Image (or MaskedImage) whose properties we want |
flags | Describe what we want to calculate |
sctrl | Control how things are calculated |
Definition at line 1104 of file Statistics.cc.
|
related |
Handle MaskedImages, just pass the getImage() and getMask() values right on through.
Definition at line 381 of file Statistics.h.
|
related |
Handle MaskedImages, just pass the getImage() and getMask() values right on through.
Definition at line 396 of file Statistics.h.
|
related |
The makeStatistics() overload to handle lsst::afw::math::MaskedVector<>
mv | MaskedVector |
flags | Describe what we want to calculate |
sctrl | Control calculation |
Definition at line 508 of file Statistics.h.
|
related |
The makeStatistics() overload to handle lsst::afw::math::MaskedVector<>
mv | MaskedVector |
vweights | weights |
flags | Describe what we want to calculate |
sctrl | Control calculation |
Definition at line 525 of file Statistics.h.
|
related |
The makeStatistics() overload to handle std::vector<>
v | Image (or MaskedImage) whose properties we want |
flags | Describe what we want to calculate |
sctrl | Control calculation |
Definition at line 474 of file Statistics.h.
|
related |
The makeStatistics() overload to handle std::vector<>
v | Image (or MaskedImage) whose properties we want |
vweights | Weights |
flags | Describe what we want to calculate |
sctrl | Control calculation |
Definition at line 489 of file Statistics.h.