32 #ifndef LSST_AFW_IMAGE_FILTER_H
33 #define LSST_AFW_IMAGE_FILTER_H
37 #include <unordered_map>
54 double lambdaMax = NAN,
bool force =
false)
55 : _name(
name), _lambdaEff(lambdaEff), _lambdaMin(lambdaMin), _lambdaMax(lambdaMax) {
76 std::
string const&
getName() const noexcept {
return _name; }
100 return !(*
this == rhs);
107 static
void reset() { _initRegistry(); }
122 static void _initRegistry();
128 void _insert(
bool force =
false);
135 static PropertyMap* _propertyMap;
150 bool const force =
false
152 : _id(_lookup(
name, force)), _name(
name) {}
158 : _id(
id), _name(_lookup(
id)) {}
176 bool operator==(
Filter const& rhs) const noexcept;
177 bool operator!=(
Filter const& rhs) const noexcept {
return !(*
this == rhs); }
185 int getId() const noexcept {
return _id; }
210 static void reset() { _initRegistry(); }
251 typedef
std::unordered_map<
std::
string,
std::
string const> AliasMap;
252 typedef
std::unordered_map<
std::
string,
unsigned int const> NameMap;
253 typedef
std::unordered_map<
unsigned int,
std::
string const> IdMap;
258 static
void _initRegistry();
265 static
int _lookup(
std::
string const&
name,
bool const force = false);
269 static
std::
string const& _lookup(
int id);
275 static AliasMap* _aliasMap;
276 static IdMap* _idMap;
277 static NameMap* _nameMap;
ItemVariant const * other
Holds an integer identifier for an LSST filter.
std::string const & getName() const noexcept
Return a Filter's name.
void write(OutputArchiveHandle &handle) const override
Write the object to one or more catalogs.
Filter(std::string const &name, bool const force=false)
Creates a Filter with the given name.
bool equals(typehandling::Storable const &other) const noexcept override
Compare this object to another Storable.
Filter(Filter &&) noexcept=default
std::string getPythonModule() const override
Return the fully-qualified Python module that should be imported to guarantee that its factory is reg...
std::size_t hash_value() const noexcept override
Return a hash of this object.
static std::vector< std::string > getNames()
Return a list of known filters.
static int defineAlias(std::string const &oldName, std::string const &newName, bool force=false)
Define an alias for a filter.
static void reset()
Clear all definitions.
static int define(FilterProperty const &filterProperty, int id=AUTO, bool force=false)
Define a filter name to have the specified id.
FilterProperty const & getFilterProperty() const
Return a Filter's FilterProperty.
std::string const & getCanonicalName() const
Return a filter's canonical name.
Filter(Filter const &)=default
std::vector< std::string > getAliases() const
Return all aliases by which this filter is known.
int getId() const noexcept
Return a Filter's integral id.
Filter(int id=UNKNOWN)
Creates a Filter with the given identifier.
std::shared_ptr< typehandling::Storable > cloneStorable() const override
Create a new Filter that is a copy of this one.
bool isPersistable() const noexcept override
Return true if this particular object can be persisted using afw::table::io.
std::string getPersistenceName() const override
Return the unique name used to persist this object and look up its factory.
Describe the properties of a Filter (e.g.
bool operator!=(FilterProperty const &rhs) const noexcept
Return true iff rhs != this.
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)
static void reset()
Clear all definitions.
double getLambdaMax() const noexcept
Return the filter's maximum wavelength (nm) where the transmission is above 1% of the maximum.
FilterProperty(FilterProperty const &)=default
std::size_t hash_value() const noexcept
Return a hash of this object.
bool operator==(FilterProperty const &rhs) const noexcept
Return true iff two FilterProperties are identical.
static FilterProperty const & lookup(std::string const &name)
Lookup the properties of a filter "name".
FilterProperty(FilterProperty &&) noexcept=default
FilterProperty(std::string const &name, double lambdaEff, double lambdaMin=NAN, double lambdaMax=NAN, bool force=false)
io::OutputArchiveHandle OutputArchiveHandle
Interface supporting iteration over heterogenous containers.
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.
A base class for image defects.
size_t operator()(argument_type const &obj) const noexcept
size_t operator()(argument_type const &obj) const noexcept