LSSTApplications  18.0.0+106,18.0.0+50,19.0.0,19.0.0+1,19.0.0+10,19.0.0+11,19.0.0+13,19.0.0+17,19.0.0+2,19.0.0-1-g20d9b18+6,19.0.0-1-g425ff20,19.0.0-1-g5549ca4,19.0.0-1-g580fafe+6,19.0.0-1-g6fe20d0+1,19.0.0-1-g7011481+9,19.0.0-1-g8c57eb9+6,19.0.0-1-gb5175dc+11,19.0.0-1-gdc0e4a7+9,19.0.0-1-ge272bc4+6,19.0.0-1-ge3aa853,19.0.0-10-g448f008b,19.0.0-12-g6990b2c,19.0.0-2-g0d9f9cd+11,19.0.0-2-g3d9e4fb2+11,19.0.0-2-g5037de4,19.0.0-2-gb96a1c4+3,19.0.0-2-gd955cfd+15,19.0.0-3-g2d13df8,19.0.0-3-g6f3c7dc,19.0.0-4-g725f80e+11,19.0.0-4-ga671dab3b+1,19.0.0-4-gad373c5+3,19.0.0-5-ga2acb9c+2,19.0.0-5-gfe96e6c+2,w.2020.01
LSSTDataManagementBasePackage
Public Member Functions | Static Public Member Functions | List of all members
lsst::afw::image::FilterProperty Class Referencefinal

Describe the properties of a Filter (e.g. More...

#include <Filter.h>

Public Member Functions

 FilterProperty (std::string const &name, double lambdaEff, double lambdaMin=NAN, double lambdaMax=NAN, bool force=false)
 
 FilterProperty (std::string const &name, lsst::daf::base::PropertySet const &prop=lsst::daf::base::PropertySet(), bool force=false)
 
 FilterProperty (FilterProperty const &)=default
 
 FilterProperty (FilterProperty &&) noexcept=default
 
FilterPropertyoperator= (FilterProperty const &)=default
 
FilterPropertyoperator= (FilterProperty &&) noexcept=default
 
 ~FilterProperty () noexcept=default
 
std::string const & getName () const noexcept
 Return a filter's name. More...
 
double getLambdaEff () const noexcept
 Return the filter's effective wavelength (nm) More...
 
double getLambdaMin () const noexcept
 Return the filter's minimum wavelength (nm) where the transmission is above 1% of the maximum. More...
 
double getLambdaMax () const noexcept
 Return the filter's maximum wavelength (nm) where the transmission is above 1% of the maximum. More...
 
bool operator== (FilterProperty const &rhs) const noexcept
 Return true iff two FilterProperties are identical. More...
 
bool operator!= (FilterProperty const &rhs) const noexcept
 Return true iff rhs != this. More...
 
std::size_t hash_value () const noexcept
 Return a hash of this object. More...
 

Static Public Member Functions

static void reset ()
 Clear all definitions. More...
 
static FilterProperty const & lookup (std::string const &name)
 Lookup the properties of a filter "name". More...
 

Detailed Description

Describe the properties of a Filter (e.g.

effective wavelength)

Definition at line 51 of file Filter.h.

Constructor & Destructor Documentation

◆ FilterProperty() [1/4]

lsst::afw::image::FilterProperty::FilterProperty ( std::string const &  name,
double  lambdaEff,
double  lambdaMin = NAN,
double  lambdaMax = NAN,
bool  force = false 
)
inlineexplicit

Definition at line 53 of file Filter.h.

55  : _name(name), _lambdaEff(lambdaEff), _lambdaMin(lambdaMin), _lambdaMax(lambdaMax) {
56  _insert(force);
57  }

◆ FilterProperty() [2/4]

lsst::afw::image::FilterProperty::FilterProperty ( std::string const &  name,
lsst::daf::base::PropertySet const &  prop = lsst::daf::base::PropertySet(),
bool  force = false 
)
explicit
Parameters
namename of filter
propvalues describing the Filter
forceAllow this name to replace a previous one

Definition at line 52 of file Filter.cc.

53  : _name(name), _lambdaEff(NAN), _lambdaMin(NAN), _lambdaMax(NAN) {
54  if (prop.exists("lambdaEff")) {
55  _lambdaEff = prop.getAsDouble("lambdaEff");
56  }
57  if (prop.exists("lambdaMin")) {
58  _lambdaMin = prop.getAsDouble("lambdaMin");
59  }
60  if (prop.exists("lambdaMax")) {
61  _lambdaMax = prop.getAsDouble("lambdaMax");
62  }
63  _insert(force);
64 }
table::Key< std::string > name
Definition: Filter.cc:188

◆ FilterProperty() [3/4]

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

◆ FilterProperty() [4/4]

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

◆ ~FilterProperty()

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

Member Function Documentation

◆ getLambdaEff()

double lsst::afw::image::FilterProperty::getLambdaEff ( ) const
inlinenoexcept

Return the filter's effective wavelength (nm)

Definition at line 80 of file Filter.h.

80 { return _lambdaEff; }

◆ getLambdaMax()

double lsst::afw::image::FilterProperty::getLambdaMax ( ) const
inlinenoexcept

Return the filter's maximum wavelength (nm) where the transmission is above 1% of the maximum.

Definition at line 88 of file Filter.h.

88 { return _lambdaMax; }

◆ getLambdaMin()

double lsst::afw::image::FilterProperty::getLambdaMin ( ) const
inlinenoexcept

Return the filter's minimum wavelength (nm) where the transmission is above 1% of the maximum.

Definition at line 84 of file Filter.h.

84 { return _lambdaMin; }

◆ getName()

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

Return a filter's name.

Definition at line 76 of file Filter.h.

76 { return _name; }

◆ hash_value()

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

Return a hash of this object.

Definition at line 91 of file Filter.cc.

91 { return std::hash<double>()(_lambdaEff); };

◆ lookup()

FilterProperty const & lsst::afw::image::FilterProperty::lookup ( std::string const &  name)
static

Lookup the properties of a filter "name".

Parameters
namename of desired filter

Definition at line 101 of file Filter.cc.

101  {
102  if (!_propertyMap) {
103  _initRegistry();
104  }
105 
106  PropertyMap::iterator keyVal = _propertyMap->find(name);
107 
108  if (keyVal == _propertyMap->end()) {
109  throw LSST_EXCEPT(pexEx::NotFoundError, "Unable to find filter " + name);
110  }
111 
112  return keyVal->second;
113 }
T end(T... args)
Reports attempts to access elements using an invalid key.
Definition: Runtime.h:151
table::Key< std::string > name
Definition: Filter.cc:188
T find(T... args)
#define LSST_EXCEPT(type,...)
Create an exception with a given type.
Definition: Exception.h:48

◆ operator!=()

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

Return true iff rhs != this.

Parameters
rhsObject to compare with this

Definition at line 98 of file Filter.h.

99  {
100  return !(*this == rhs);
101  }

◆ operator=() [1/2]

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

◆ operator=() [2/2]

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

◆ operator==()

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

Return true iff two FilterProperties are identical.

Parameters
rhsObject to compare with this

Definition at line 87 of file Filter.cc.

87  {
88  return (_lambdaEff == rhs._lambdaEff);
89 }

◆ reset()

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

Clear all definitions.

Definition at line 107 of file Filter.h.

107 { _initRegistry(); }

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