lsst.afw gba399f52f3+9b61cfce8e
Loading...
Searching...
No Matches
lsst::afw::image::ApCorrMap Class Referencefinal

A thin wrapper around std::map to allow aperture corrections to be attached to Exposures. More...

#include <ApCorrMap.h>

Inheritance diagram for lsst::afw::image::ApCorrMap:
lsst::afw::table::io::PersistableFacade< ApCorrMap >

Public Types

using Iterator = Internal::const_iterator
 Iterator type returned by begin() and end().

Public Member Functions

 ApCorrMap ()=default
 ApCorrMap (ApCorrMap const &)=default
 ApCorrMap (ApCorrMap &&)=default
ApCorrMap & operator= (ApCorrMap const &)=default
ApCorrMap & operator= (ApCorrMap &&)=default
 ~ApCorrMap () override=default
Iterator begin () const
Iterator end () const
std::size_t size () const
std::shared_ptr< math::BoundedField > const operator[] (std::string const &name) const
 Return the field with the given name, throwing NotFoundError when the name is not present.
std::shared_ptr< math::BoundedField > const get (std::string const &name) const
 Return the field with the given name, returning an empty pointer when the name is not present.
void set (std::string const &name, std::shared_ptr< math::BoundedField > field)
 Add or replace an aperture correction.
bool isPersistable () const noexcept override
 Whether the map is persistable (true IFF all contained BoundedFields are persistable).
ApCorrMap & operator*= (double const scale)
 Scale all fields by a constant.
ApCorrMap & operator/= (double const scale)
std::shared_ptr< typehandling::Storable > cloneStorable () const override
 Create a new ApCorrMap that is a copy of this one.

Static Public Member Functions

static std::shared_ptr< ApCorrMap > readFits (fits::Fits &fitsfile)
 Read an object from an already open FITS object.
static std::shared_ptr< ApCorrMap > dynamicCast (std::shared_ptr< Persistable > const &ptr)
 Dynamically cast a shared_ptr.

Static Public Attributes

static std::size_t const MAX_NAME_LENGTH = 64
 Maximum number of characters for an aperture correction name (required for persistence).

Private Member Functions

std::string getPersistenceName () const override
std::string getPythonModule () const override
void write (OutputArchiveHandle &handle) const override

Detailed Description

A thin wrapper around std::map to allow aperture corrections to be attached to Exposures.

ApCorrMap simply adds error handling accessors, persistence, and a bit of encapsulation to std::map (given the simplified interface, for instance, we could switch to unordered_map or some other underyling container in the future).

Definition at line 45 of file ApCorrMap.h.

Member Typedef Documentation

◆ Iterator

using lsst::afw::image::ApCorrMap::Iterator = Internal::const_iterator

Iterator type returned by begin() and end().

Dereferences to a pair<string,std::shared_ptr<BoundedField>>.

Definition at line 54 of file ApCorrMap.h.

Constructor & Destructor Documentation

◆ ApCorrMap() [1/3]

lsst::afw::image::ApCorrMap::ApCorrMap ( )
default

◆ ApCorrMap() [2/3]

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

◆ ApCorrMap() [3/3]

lsst::afw::image::ApCorrMap::ApCorrMap ( ApCorrMap && )
default

◆ ~ApCorrMap()

lsst::afw::image::ApCorrMap::~ApCorrMap ( )
overridedefault

Member Function Documentation

◆ begin()

Iterator lsst::afw::image::ApCorrMap::begin ( ) const
inline

Definition at line 63 of file ApCorrMap.h.

◆ cloneStorable()

std::shared_ptr< typehandling::Storable > lsst::afw::image::ApCorrMap::cloneStorable ( ) const
override

Create a new ApCorrMap that is a copy of this one.

Definition at line 147 of file ApCorrMap.cc.

◆ dynamicCast()

template std::shared_ptr< math::WarpingControl > lsst::afw::table::io::PersistableFacade< ApCorrMap >::dynamicCast ( std::shared_ptr< Persistable > const & ptr)
staticinherited

Dynamically cast a shared_ptr.

Dynamically cast a shared pointer and raise on failure.

You must provide an explicit template instantiation in the .cc file for each class that inherits from PersistableFacade. Designed to work around RTTI issues on macOS with hidden symbols;

Exceptions
lsst::pex::exceptions::LogicErrorif the cast fails

param[in] ptr The pointer to be cast.

Returns
The cast pointer.
Exceptions
lsst::pex::exceptions::TypeErrorIf the dynamic cast fails.

Definition at line 218 of file Persistable.cc.

◆ end()

Iterator lsst::afw::image::ApCorrMap::end ( ) const
inline

Definition at line 64 of file ApCorrMap.h.

◆ get()

std::shared_ptr< math::BoundedField > const lsst::afw::image::ApCorrMap::get ( std::string const & name) const

Return the field with the given name, returning an empty pointer when the name is not present.

Definition at line 53 of file ApCorrMap.cc.

◆ getPersistenceName()

std::string lsst::afw::image::ApCorrMap::getPersistenceName ( ) const
overrideprivate

Definition at line 123 of file ApCorrMap.cc.

◆ getPythonModule()

std::string lsst::afw::image::ApCorrMap::getPythonModule ( ) const
overrideprivate

Definition at line 125 of file ApCorrMap.cc.

◆ isPersistable()

bool lsst::afw::image::ApCorrMap::isPersistable ( ) const
overridenoexcept

Whether the map is persistable (true IFF all contained BoundedFields are persistable).

Definition at line 116 of file ApCorrMap.cc.

◆ operator*=()

ApCorrMap & lsst::afw::image::ApCorrMap::operator*= ( double const scale)

Scale all fields by a constant.

Definition at line 138 of file ApCorrMap.cc.

◆ operator/=()

ApCorrMap & lsst::afw::image::ApCorrMap::operator/= ( double const scale)
inline

Definition at line 82 of file ApCorrMap.h.

◆ operator=() [1/2]

ApCorrMap & lsst::afw::image::ApCorrMap::operator= ( ApCorrMap && )
default

◆ operator=() [2/2]

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

◆ operator[]()

std::shared_ptr< math::BoundedField > const lsst::afw::image::ApCorrMap::operator[] ( std::string const & name) const

Return the field with the given name, throwing NotFoundError when the name is not present.

Definition at line 44 of file ApCorrMap.cc.

◆ readFits()

std::shared_ptr< ApCorrMap > lsst::afw::table::io::PersistableFacade< ApCorrMap >::readFits ( fits::Fits & fitsfile)
inlinestaticinherited

Read an object from an already open FITS object.

Parameters
[in]fitsfileFITS object to read from, already positioned at the desired HDU.

Definition at line 183 of file Persistable.h.

◆ set()

void lsst::afw::image::ApCorrMap::set ( std::string const & name,
std::shared_ptr< math::BoundedField > field )

Add or replace an aperture correction.

Definition at line 61 of file ApCorrMap.cc.

◆ size()

std::size_t lsst::afw::image::ApCorrMap::size ( ) const
inline

Definition at line 66 of file ApCorrMap.h.

◆ write()

void lsst::afw::image::ApCorrMap::write ( OutputArchiveHandle & handle) const
overrideprivate

Definition at line 127 of file ApCorrMap.cc.

Member Data Documentation

◆ MAX_NAME_LENGTH

std::size_t const lsst::afw::image::ApCorrMap::MAX_NAME_LENGTH = 64
static

Maximum number of characters for an aperture correction name (required for persistence).

Definition at line 50 of file ApCorrMap.h.


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