lsst.afw
21.0.0-11-ga6ea59e8e+47cba9fc36
|
Go to the documentation of this file.
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;
309 #endif // LSST_AFW_IMAGE_FILTER_H
Backwards-compatibility support for depersisting the old Calib (FluxMag0/FluxMag0Err) objects.
int getId() const noexcept
Return a Filter's integral id.
Filter(std::string const &name, bool const force=false)
Creates a Filter with the given name.
int stripFilterKeywords(std::shared_ptr< lsst::daf::base::PropertySet > metadata)
Remove Filter-related keywords from the metadata.
static int define(FilterProperty const &filterProperty, int id=AUTO, bool force=false)
Define a filter name to have the specified id.
void write(OutputArchiveHandle &handle) const override
Write the object to one or more catalogs.
Holds an integer identifier for an LSST filter.
Describe the properties of a Filter (e.g.
std::string getPythonModule() const override
Return the fully-qualified Python module that should be imported to guarantee that its factory is reg...
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.
Interface supporting iteration over heterogenous containers.
FilterProperty(FilterProperty const &)=default
FilterProperty(std::string const &name, double lambdaEff, double lambdaMin=NAN, double lambdaMax=NAN, bool force=false)
static int defineAlias(std::string const &oldName, std::string const &newName, bool force=false)
Define an alias for a filter.
double getLambdaEff() const noexcept
Return the filter's effective wavelength (nm)
bool isPersistable() const noexcept override
Return true if this particular object can be persisted using afw::table::io.
static void reset()
Clear all definitions.
double getLambdaMin() const noexcept
Return the filter's minimum wavelength (nm) where the transmission is above 1% of the maximum.
FilterProperty(FilterProperty &&) noexcept=default
std::size_t hash_value() const noexcept
Return a hash of this object.
ItemVariant const * other
static std::vector< std::string > getNames()
Return a list of known filters.
FilterProperty const & getFilterProperty() const
Return a Filter's FilterProperty.
std::size_t hash_value() const noexcept override
Return a hash of this object.
std::string const & getName() const noexcept
Return a filter's name.
size_t operator()(argument_type const &obj) const noexcept
A base class for image defects.
bool equals(typehandling::Storable const &other) const noexcept override
Compare this object to another Storable.
static void reset()
Clear all definitions.
Filter(int id=UNKNOWN)
Creates a Filter with the given identifier.
std::string const & getCanonicalName() const
Return a filter's canonical name.
std::string const & getName() const noexcept
Return a Filter's name.
std::vector< std::string > getAliases() const
Return all aliases by which this filter is known.
Filter(Filter &&) noexcept=default
static FilterProperty const & lookup(std::string const &name)
Lookup the properties of a filter "name".
io::OutputArchiveHandle OutputArchiveHandle
std::shared_ptr< typehandling::Storable > cloneStorable() const override
Create a new Filter that is a copy of this one.
Filter(Filter const &)=default
size_t operator()(argument_type const &obj) const noexcept
std::string getPersistenceName() const override
Return the unique name used to persist this object and look up its factory.
bool operator==(FilterProperty const &rhs) const noexcept
Return true iff two FilterProperties are identical.