23 #if !defined(LSST_DETECTION_THRESHOLD_H)
24 #define LSST_DETECTION_THRESHOLD_H
59 bool const polarity =
true,
60 double const includeMultiplier = 1.0
62 : _value(value), _type(
type), _polarity(polarity), _includeMultiplier(includeMultiplier) {}
81 double getValue(
const double param = -1)
const;
88 template <
typename ImageT>
104 _includeMultiplier = includeMultiplier;
111 double _includeMultiplier;
A Threshold is used to pass a threshold value to detection algorithms.
bool getPolarity() const noexcept
return Threshold's polarity
static std::string getTypeString(ThresholdType const &type)
static ThresholdType parseTypeString(std::string const &typeStr)
void setPolarity(bool const polarity) noexcept
set Threshold's polarity
Threshold(double const value, ThresholdType const type=VALUE, bool const polarity=true, double const includeMultiplier=1.0)
Threshold constructor.
double getIncludeMultiplier() const noexcept
return includeMultiplier
double getValue(const double param=-1) const
return value of threshold, to be interpreted via type
~Threshold() noexcept=default
void setIncludeMultiplier(double const includeMultiplier)
set includeMultiplier
ThresholdType
Types of threshold:
@ VARIANCE
Use number of sigma given variance.
@ PIXEL_STDEV
Use number of sigma given per-pixel s.d.
@ STDEV
Use number of sigma given s.d.
@ BITMASK
Use (pixels & (given mask))
ThresholdType getType() const noexcept
return type of threshold
Threshold createThreshold(const double value, const std::string type="value", const bool polarity=true)
Factory method for creating Threshold objects.
Backwards-compatibility support for depersisting the old Calib (FluxMag0/FluxMag0Err) objects.
A base class for image defects.