lsst.afw  16.0-76-g802307b6d+1
Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
lsst::afw::image::Filter Class Referencefinal

Holds an integer identifier for an LSST filter. More...

#include <Filter.h>

Public Member Functions

 Filter (std::string const &name, bool const force=false)
 Creates a Filter with the given name. More...
 
 Filter (int id=UNKNOWN)
 Creates a Filter with the given identifier. More...
 
 Filter (std::shared_ptr< lsst::daf::base::PropertySet const > metadata, bool const force=false)
 Create a Filter from a PropertySet (e.g. More...
 
 Filter (Filter const &)=default
 
 Filter (Filter &&) noexcept=default
 
Filter & operator= (Filter const &)=default
 
Filter & operator= (Filter &&) noexcept=default
 
 ~Filter () noexcept=default
 
bool operator== (Filter const &rhs) const noexcept
 Are two filters identical? More...
 
bool operator!= (Filter const &rhs) const noexcept
 
std::size_t hash_value () const noexcept
 Return a hash of this object. More...
 
int getId () const noexcept
 Return a Filter's integral id. More...
 
std::string const & getName () const noexcept
 Return a Filter's name. More...
 
std::string const & getCanonicalName () const
 Return a filter's canonical name. More...
 
std::vector< std::string > getAliases () const
 Return all aliases by which this filter is known. More...
 
FilterProperty const & getFilterProperty () const
 Return a Filter's FilterProperty. More...
 

Static Public Member Functions

static void reset ()
 Clear all definitions. More...
 
static int define (FilterProperty const &filterProperty, int id=AUTO, bool force=false)
 Define a filter name to have the specified id. More...
 
static int defineAlias (std::string const &oldName, std::string const &newName, bool force=false)
 Define an alias for a filter. More...
 
static std::vector< std::string > getNames ()
 Return a list of known filters. More...
 

Static Public Attributes

static int const AUTO = -1
 
static int const UNKNOWN = -1
 

Detailed Description

Holds an integer identifier for an LSST filter.

Definition at line 141 of file Filter.h.

Constructor & Destructor Documentation

◆ Filter() [1/5]

lsst::afw::image::Filter::Filter ( std::string const &  name,
bool const  force = false 
)
inlineexplicit

Creates a Filter with the given name.

Parameters
nameName of filter
forceAllow us to construct an unknown Filter

Definition at line 149 of file Filter.h.

◆ Filter() [2/5]

lsst::afw::image::Filter::Filter ( int  id = UNKNOWN)
inlineexplicit

Creates a Filter with the given identifier.

Parameters
idId number of desired filter

Definition at line 156 of file Filter.h.

◆ Filter() [3/5]

lsst::afw::image::Filter::Filter ( std::shared_ptr< lsst::daf::base::PropertySet const >  metadata,
bool const  force = false 
)
explicit

Create a Filter from a PropertySet (e.g.

a FITS header)

Parameters
metadataMetadata to process (e.g. a IFITS header)
forceAllow us to construct an unknown Filter

Definition at line 117 of file Filter.cc.

◆ Filter() [4/5]

lsst::afw::image::Filter::Filter ( Filter const &  )
default

◆ Filter() [5/5]

lsst::afw::image::Filter::Filter ( Filter &&  )
defaultnoexcept

◆ ~Filter()

lsst::afw::image::Filter::~Filter ( )
defaultnoexcept

Member Function Documentation

◆ define()

int lsst::afw::image::Filter::define ( FilterProperty const &  filterProperty,
int  id = AUTO,
bool  force = false 
)
static

Define a filter name to have the specified id.

If id == Filter::AUTO a value will be chosen for you.

It is an error to attempt to change a name's id (unless you specify force)

Definition at line 195 of file Filter.cc.

◆ defineAlias()

int lsst::afw::image::Filter::defineAlias ( std::string const &  oldName,
std::string const &  newName,
bool  force = false 
)
static

Define an alias for a filter.

Parameters
oldNameold name for Filter
newNamenew name for Filter
forceforce an alias even if newName is already in use

Definition at line 228 of file Filter.cc.

◆ getAliases()

std::vector< std::string > lsst::afw::image::Filter::getAliases ( ) const

Return all aliases by which this filter is known.

The list excludes the canonical name

Definition at line 141 of file Filter.cc.

◆ getCanonicalName()

std::string const& lsst::afw::image::Filter::getCanonicalName ( ) const
inline

Return a filter's canonical name.

I.e. if this filter's an alias, return the name of the aliased Filter

Definition at line 195 of file Filter.h.

◆ getFilterProperty()

FilterProperty const & lsst::afw::image::Filter::getFilterProperty ( ) const

Return a Filter's FilterProperty.

Definition at line 294 of file Filter.cc.

◆ getId()

int lsst::afw::image::Filter::getId ( ) const
inlinenoexcept

Return a Filter's integral id.

Definition at line 185 of file Filter.h.

◆ getName()

std::string const& lsst::afw::image::Filter::getName ( ) const
inlinenoexcept

Return a Filter's name.

Definition at line 189 of file Filter.h.

◆ getNames()

std::vector< std::string > lsst::afw::image::Filter::getNames ( )
static

Return a list of known filters.

Definition at line 154 of file Filter.cc.

◆ hash_value()

std::size_t lsst::afw::image::Filter::hash_value ( ) const
noexcept

Return a hash of this object.

Definition at line 173 of file Filter.cc.

◆ operator!=()

bool lsst::afw::image::Filter::operator!= ( Filter const &  rhs) const
inlinenoexcept

Definition at line 177 of file Filter.h.

◆ operator=() [1/2]

Filter& lsst::afw::image::Filter::operator= ( Filter const &  )
default

◆ operator=() [2/2]

Filter& lsst::afw::image::Filter::operator= ( Filter &&  )
defaultnoexcept

◆ operator==()

bool lsst::afw::image::Filter::operator== ( Filter const &  rhs) const
noexcept

Are two filters identical?

Definition at line 171 of file Filter.cc.

◆ reset()

static void lsst::afw::image::Filter::reset ( )
inlinestatic

Clear all definitions.

Definition at line 210 of file Filter.h.

Member Data Documentation

◆ AUTO

int const lsst::afw::image::Filter::AUTO = -1
static

Definition at line 143 of file Filter.h.

◆ UNKNOWN

int const lsst::afw::image::Filter::UNKNOWN = -1
static

Definition at line 144 of file Filter.h.


The documentation for this class was generated from the following files: