LSSTApplications
20.0.0
LSSTDataManagementBasePackage
|
Go to the documentation of this file.
35 #ifndef LSST_IP_DIFFIM_IMAGESTATISTICS_H
36 #define LSST_IP_DIFFIM_IMAGESTATISTICS_H
58 template <
typename PixelT>
65 _xsum(0.), _x2sum(0.), _npix(0), _bpMask(0) {
69 mi != detBadMaskPlanes.
end(); ++mi){
75 "Cannot update bad bit mask with %s", (*mi).c_str());
84 void reset() { _xsum = _x2sum = 0.; _npix = 0;}
96 y1 =
image.getHeight();
98 x1 =
image.getWidth();
107 for (
int y = y0;
y != y1; ++
y) {
110 if (!((*ptr).mask() & _bpMask)) {
111 double const ivar = 1. / (*ptr).variance();
113 _xsum += (*ptr).image() * sqrt(ivar);
114 _x2sum += (*ptr).image() * (*ptr).image() * ivar;
122 "Nan/Inf in ImageStatistics.apply");
135 return (_npix > 1) ? (_x2sum/_npix - _xsum/_npix * _xsum/_npix) * _npix/(_npix-1.) :
Backwards-compatibility support for depersisting the old Calib (FluxMag0/FluxMag0Err) objects.
lsst::afw::image::MaskPixel getBpMask()
An iterator to the MaskedImage.
lsst::afw::image::MaskedImage< PixelT >::x_iterator x_iterator
Class to calculate difference image statistics.
ImageStatistics(lsst::daf::base::PropertySet const &ps)
bool evaluateQuality(lsst::daf::base::PropertySet const &ps)
double getVariance() const
static MaskPixelT getPlaneBitMask(const std::vector< std::string > &names)
Return the bitmask corresponding to a vector of plane names OR'd together.
void setBpMask(lsst::afw::image::MaskPixel bpMask)
void apply(lsst::afw::image::MaskedImage< PixelT > const &image, int core)
virtual ~ImageStatistics()
A base class for image defects.
void apply(lsst::afw::image::MaskedImage< PixelT > const &image)
#define LSST_EXCEPT(type,...)
Create an exception with a given type.
double getAsDouble(std::string const &name) const
Get the last value for any arithmetic property name (possibly hierarchical).
std::shared_ptr< ImageStatistics > Ptr
#define LOGL_DEBUG(logger, message...)
Class for storing generic metadata.
Provides consistent interface for LSST exceptions.
virtual char const * what(void) const noexcept
Return a character string summarizing this exception.
LSST DM logging module built on log4cxx.
std::vector< T > getArray(std::string const &name) const
Get the vector of values for a property name (possibly hierarchical).