LSST Applications
21.0.0-172-gfb10e10a+18fedfabac,22.0.0+297cba6710,22.0.0+80564b0ff1,22.0.0+8d77f4f51a,22.0.0+a28f4c53b1,22.0.0+dcf3732eb2,22.0.1-1-g7d6de66+2a20fdde0d,22.0.1-1-g8e32f31+297cba6710,22.0.1-1-geca5380+7fa3b7d9b6,22.0.1-12-g44dc1dc+2a20fdde0d,22.0.1-15-g6a90155+515f58c32b,22.0.1-16-g9282f48+790f5f2caa,22.0.1-2-g92698f7+dcf3732eb2,22.0.1-2-ga9b0f51+7fa3b7d9b6,22.0.1-2-gd1925c9+bf4f0e694f,22.0.1-24-g1ad7a390+a9625a72a8,22.0.1-25-g5bf6245+3ad8ecd50b,22.0.1-25-gb120d7b+8b5510f75f,22.0.1-27-g97737f7+2a20fdde0d,22.0.1-32-gf62ce7b1+aa4237961e,22.0.1-4-g0b3f228+2a20fdde0d,22.0.1-4-g243d05b+871c1b8305,22.0.1-4-g3a563be+32dcf1063f,22.0.1-4-g44f2e3d+9e4ab0f4fa,22.0.1-42-gca6935d93+ba5e5ca3eb,22.0.1-5-g15c806e+85460ae5f3,22.0.1-5-g58711c4+611d128589,22.0.1-5-g75bb458+99c117b92f,22.0.1-6-g1c63a23+7fa3b7d9b6,22.0.1-6-g50866e6+84ff5a128b,22.0.1-6-g8d3140d+720564cf76,22.0.1-6-gd805d02+cc5644f571,22.0.1-8-ge5750ce+85460ae5f3,master-g6e05de7fdc+babf819c66,master-g99da0e417a+8d77f4f51a,w.2021.48
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.