lsst.afw
19.0.0-23-g9b026a6e0
|
Go to the documentation of this file.
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) {
50 (boost::format(
"Unsupported Threshold type: %s") % typeStr).str());
63 (boost::format(
"Unsopported Threshold type: %d") %
type).str());
72 (boost::format(
"St. dev. must be > 0: %g") % param).str());
74 return _value * param;
82 (boost::format(
"Variance must be > 0: %g") % param).str());
87 (boost::format(
"Unsupported type: %d") % _type).str());
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;
Backwards-compatibility support for depersisting the old Calib (FluxMag0/FluxMag0Err) objects.
@ PIXEL_STDEV
Use number of sigma given per-pixel s.d.
double getValue(Property const prop=NOTHING) const
Return the value of the desired property (if specified in the constructor)
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)
@ STDEV
Use number of sigma given s.d.
static std::string getTypeString(ThresholdType const &type)
#define INSTANTIATE(TYPE)
@ STDEVCLIP
estimate sample N-sigma clipped stdev (N set in StatisticsControl, default=3)
@ VARIANCE
Use number of sigma given variance.
A Threshold is used to pass a threshold value to detection algorithms.
@ BITMASK
Use (pixels & (given mask))
Threshold createThreshold(const double value, const std::string type="value", const bool polarity=true)
Factory method for creating Threshold objects.
A base class for image defects.
#define LSST_EXCEPT(type,...)
double getValue(const double param=-1) const
return value of threshold, to be interpreted via type
#define LOGL_DEBUG(logger, message...)
static ThresholdType parseTypeString(std::string const &typeStr)
ThresholdType
Types of threshold: