32 #ifndef LSST_AFW_IMAGE_FILTER_H
33 #define LSST_AFW_IMAGE_FILTER_H
37 #include <unordered_map>
52 [deprecated(
"Removed with no replacement (but see lsst::afw::image::TransmissionCurve). Will be "
56 double lambdaMax = NAN,
bool force =
false)
57 : _name(
name), _lambdaEff(lambdaEff), _lambdaMin(lambdaMin), _lambdaMax(lambdaMax) {
78 std::
string const&
getName() const noexcept {
return _name; }
102 return !(*
this == rhs);
109 static
void reset() { _initRegistry(); }
124 static void _initRegistry();
130 void _insert(
bool force =
false);
137 static PropertyMap* _propertyMap;
143 class[[deprecated(
"Replaced with FilterLabel. Will be removed after v22.")]] Filter
final
144 :
public typehandling::Storable {
146 static int const AUTO;
147 static int const UNKNOWN;
153 bool const force =
false
155 : _id(_lookup(
name, force)), _name(
name) {}
159 explicit Filter(
int id = UNKNOWN
161 : _id(
id), _name(_lookup(
id)) {}
170 Filter(Filter
const&) =
default;
171 Filter(Filter &&) noexcept = default;
172 Filter& operator=(Filter const&) = default;
173 Filter& operator=(Filter&&) noexcept = default;
174 ~Filter() noexcept = default;
179 bool operator==(Filter const& rhs) const noexcept;
180 bool operator!=(Filter const& rhs) const noexcept {
return !(*
this == rhs); }
188 int getId() const noexcept {
return _id; }
198 std::string const& getCanonicalName()
const {
return _lookup(_id); }
213 static void reset() { _initRegistry(); }
221 static int define(
FilterProperty const& filterProperty,
int id = AUTO,
bool force =
false);
244 bool equals(typehandling::Storable
const&
other)
const noexcept
override;
246 bool isPersistable() const noexcept override;
251 void write(OutputArchiveHandle & handle) const override;
255 typedef
std::unordered_map<
std::
string,
unsigned int const>
NameMap;
256 typedef
std::unordered_map<
unsigned int,
std::
string const>
IdMap;
261 static
void _initRegistry();
268 static
int _lookup(
std::
string const&
name,
bool const force = false);
272 static
std::
string const& _lookup(
int id);
279 static
IdMap* _idMap;
ItemVariant const * other
int stripFilterKeywords(std::shared_ptr< lsst::daf::base::PropertySet > metadata)
Remove Filter-related keywords from the metadata.
Backwards-compatibility support for depersisting the old Calib (FluxMag0/FluxMag0Err) objects.
bool operator==(FilterProperty const &rhs) const noexcept
Return true iff two FilterProperties are identical.
std::string getPythonModule() const override
class[[deprecated("Removed with no replacement (but see lsst::afw::image::TransmissionCurve). Will be " "removed after v22.")]] FilterProperty final
Describe the properties of a Filter (e.g.
std::string getPersistenceName() const override
void write(OutputArchiveHandle &handle) const override
std::size_t hash_value() const noexcept
Return a hash of this object.
double getLambdaMin() const noexcept
Return the filter's minimum wavelength (nm) where the transmission is above 1% of the maximum.
std::string const & getName() const noexcept
Return a filter's name.
double getLambdaEff() const noexcept
Return the filter's effective wavelength (nm)
double getLambdaMax() const noexcept
Return the filter's maximum wavelength (nm) where the transmission is above 1% of the maximum.
bool operator!=(FilterProperty const &rhs) const noexcept
Return true iff rhs != this.
FilterProperty(FilterProperty const &)=default
A base class for image defects.
size_t operator()(argument_type const &obj) const noexcept
size_t operator()(argument_type const &obj) const noexcept