25 #include <boost/format.hpp> 38 if (typeStr.
compare(
"bitmask") == 0) {
40 }
else if (typeStr.
compare(
"value") == 0) {
42 }
else if (typeStr.
compare(
"stdev") == 0) {
44 }
else if (typeStr.
compare(
"variance") == 0) {
46 }
else if (typeStr.
compare(
"pixel_stdev") == 0) {
57 }
else if (type ==
STDEV) {
74 return _value * param;
91 template <
typename ImageT>
98 LOGL_DEBUG(
"afw.detection.threshold",
"St. Dev = %g", sd);
116 #define INSTANTIATE(TYPE) \ 117 template double Threshold::getValue(image::TYPE<unsigned short> const&) const; \ 118 template double Threshold::getValue(image::TYPE<int> const&) const; \ 119 template double Threshold::getValue(image::TYPE<float> const&) const; \ 120 template double Threshold::getValue(image::TYPE<double> const&) const; \ 121 template double Threshold::getValue(image::TYPE<std::uint64_t> const&) const; Threshold(double const value, ThresholdType const type=VALUE, bool const polarity=true, double const includeMultiplier=1.0)
Threshold constructor.
static std::string getTypeString(ThresholdType const &type)
Use (pixels & (given mask))
A Threshold is used to pass a threshold value to detection algorithms.
#define LOGL_DEBUG(logger, message...)
Log a debug-level message using a varargs/printf style interface.
A class to evaluate image statistics.
LSST DM logging module built on log4cxx.
Use number of sigma given s.d.
estimate sample N-sigma clipped stdev (N set in StatisticsControl, default=3)
A base class for image defects.
double getValue(const double param=-1) const
return value of threshold, to be interpreted via type
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)
def format(config, name=None, writeSourceLine=True, prefix="", verbose=False)
Threshold createThreshold(const double value, const std::string type="value", const bool polarity=true)
Factory method for creating Threshold objects.
double getValue(Property const prop=NOTHING) const
Return the value of the desired property (if specified in the constructor)
#define LSST_EXCEPT(type,...)
Create an exception with a given type.
ThresholdType
Types of threshold:
Use number of sigma given variance.
Reports invalid arguments.
#define INSTANTIATE(TYPE)
static ThresholdType parseTypeString(std::string const &typeStr)
Backwards-compatibility support for depersisting the old Calib (FluxMag0/FluxMag0Err) objects...
Use number of sigma given per-pixel s.d.