LSST Applications g063fba187b+eddd1b24d7,g0f08755f38+4a855ab515,g1653933729+a8ce1bb630,g168dd56ebc+a8ce1bb630,g1a2382251a+062a45aee3,g1dcb35cd9c+45d3fa5522,g20f6ffc8e0+4a855ab515,g217e2c1bcf+f55e51b560,g28da252d5a+7d8e536cc7,g2bbee38e9b+2d92fc7d83,g2bc492864f+2d92fc7d83,g3156d2b45e+6e55a43351,g32e5bea42b+625186cc6b,g347aa1857d+2d92fc7d83,g35bb328faa+a8ce1bb630,g3a166c0a6a+2d92fc7d83,g3e281a1b8c+c5dd892a6c,g3e8969e208+a8ce1bb630,g414038480c+5927e1bc1e,g41af890bb2+1af189bab1,g7af13505b9+7b6a50a2f8,g80478fca09+6174b7f182,g82479be7b0+5b71efbaf0,g858d7b2824+4a855ab515,g9125e01d80+a8ce1bb630,ga5288a1d22+61618a97c4,gb58c049af0+d64f4d3760,gc28159a63d+2d92fc7d83,gc5452a3dca+f4add4ffd5,gcab2d0539d+d9f5af7f69,gcf0d15dbbd+6c7e0a19ec,gda6a2b7d83+6c7e0a19ec,gdaeeff99f8+1711a396fd,ge79ae78c31+2d92fc7d83,gef2f8181fd+55fff6f525,gf0baf85859+c1f95f4921,gfa517265be+4a855ab515,gfa999e8aa5+17cd334064,w.2024.51
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. | |
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. | |
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. | |
double | getError (Property const prop=NOTHING) const |
Return the error in the desired property (if specified in the constructor) | |
double | getValue (Property const prop=NOTHING) const |
Return the value of the desired property (if specified in the constructor) | |
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 Symbols | |
(Note that these are not member symbols.) | |
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) | |
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. | |
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. | |
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. | |
Statistics | makeStatistics (lsst::afw::image::Mask< lsst::afw::image::MaskPixel > const &msk, int const flags, StatisticsControl const &sctrl=StatisticsControl()) |
Specialization to handle Masks. | |
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. | |
template<typename EntryT > | |
Statistics | makeStatistics (std::vector< EntryT > const &v, int const flags, StatisticsControl const &sctrl=StatisticsControl()) |
The makeStatistics() overload to handle std::vector<> | |
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<> | |
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<> | |
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<> | |
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 222 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 225 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 788 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 837 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 1093 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 1081 of file Statistics.cc.
|
inlinenoexcept |
Definition at line 290 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 954 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 1079 of file Statistics.cc.
|
default |
|
default |
|
related |
Handle a straight front-end to the constructor.
Definition at line 373 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 427 of file Statistics.h.
|
related |
Handle a watered-down front-end to the constructor (no variance)
Definition at line 361 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 1136 of file Statistics.cc.
|
related |
Handle MaskedImages, just pass the getImage() and getMask() values right on through.
Definition at line 383 of file Statistics.h.
|
related |
Handle MaskedImages, just pass the getImage() and getMask() values right on through.
Definition at line 398 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 510 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 527 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 476 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 491 of file Statistics.h.