lsst.afw  14.0-25-g0e8fc950e+7
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Types | List of all members
lsst::afw::image::ApCorrMap Class Reference

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 > lsst::afw::table::io::Persistable

Public Types

typedef Internal::const_iterator Iterator
 Iterator type returned by begin() and end(). More...
 

Public Member Functions

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. More...
 
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. More...
 
void set (std::string const &name, std::shared_ptr< math::BoundedField > field)
 Add or replace an aperture correction. More...
 
virtual bool isPersistable () const
 Whether the map is persistable (true IFF all contained BoundedFields are persistable). More...
 
ApCorrMap & operator*= (double const scale)
 Scale all fields by a constant. More...
 
ApCorrMap & operator/= (double const scale)
 
void writeFits (std::string const &fileName, std::string const &mode="w") const
 Write the object to a regular FITS file. More...
 
void writeFits (fits::MemFileManager &manager, std::string const &mode="w") const
 Write the object to a FITS image in memory. More...
 
void writeFits (fits::Fits &fitsfile) const
 Write the object to an already-open FITS object. More...
 

Static Public Member Functions

static std::shared_ptr< ApCorrMap > readFits (fits::Fits &fitsfile)
 Read an object from an already open FITS object. More...
 
static std::shared_ptr< ApCorrMap > readFits (std::string const &fileName, int hdu=INT_MIN)
 Read an object from a regular FITS file. More...
 
static std::shared_ptr< ApCorrMap > readFits (fits::MemFileManager &manager, int hdu=INT_MIN)
 Read an object from a FITS file in memory. More...
 

Static Public Attributes

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

Protected Types

typedef io::OutputArchiveHandle OutputArchiveHandle
 

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 44 of file ApCorrMap.h.

Member Typedef Documentation

◆ Iterator

typedef Internal::const_iterator lsst::afw::image::ApCorrMap::Iterator

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

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

Definition at line 53 of file ApCorrMap.h.

◆ OutputArchiveHandle

typedef io::OutputArchiveHandle lsst::afw::table::io::Persistable::OutputArchiveHandle
protectedinherited

Definition at line 107 of file Persistable.h.

Member Function Documentation

◆ begin()

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

Definition at line 55 of file ApCorrMap.h.

◆ end()

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

Definition at line 56 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 48 of file ApCorrMap.cc.

◆ isPersistable()

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

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

Reimplemented from lsst::afw::table::io::Persistable.

Definition at line 113 of file ApCorrMap.cc.

◆ operator*=()

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

Scale all fields by a constant.

Definition at line 135 of file ApCorrMap.cc.

◆ operator/=()

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

Definition at line 74 of file ApCorrMap.h.

◆ 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 39 of file ApCorrMap.cc.

◆ readFits() [1/3]

static 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 180 of file Persistable.h.

◆ readFits() [2/3]

static std::shared_ptr<ApCorrMap > lsst::afw::table::io::PersistableFacade< ApCorrMap >::readFits ( std::string const &  fileName,
int  hdu = INT_MIN 
)
inlinestaticinherited

Read an object from a regular FITS file.

Parameters
[in]fileNameName of the file to read.
[in]hduHDU to read, where 0 is the primary. The special value of INT_MIN skips the primary HDU if it is empty.

Definition at line 191 of file Persistable.h.

◆ readFits() [3/3]

static std::shared_ptr<ApCorrMap > lsst::afw::table::io::PersistableFacade< ApCorrMap >::readFits ( fits::MemFileManager &  manager,
int  hdu = INT_MIN 
)
inlinestaticinherited

Read an object from a FITS file in memory.

Parameters
[in]managerManager for the memory to read from.
[in]hduHDU to read, where 0 is the primary. The special value of INT_MIN skips the primary HDU if it is empty.

Definition at line 202 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 56 of file ApCorrMap.cc.

◆ size()

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

Definition at line 58 of file ApCorrMap.h.

◆ writeFits() [1/3]

void lsst::afw::table::io::Persistable::writeFits ( std::string const &  fileName,
std::string const &  mode = "w" 
) const
inherited

Write the object to a regular FITS file.

Parameters
[in]fileNameName of the file to write to.
[in]modeIf "w", any existing file with the given name will be overwritten. If "a", new HDUs will be appended to an existing file.

◆ writeFits() [2/3]

void lsst::afw::table::io::Persistable::writeFits ( fits::MemFileManager &  manager,
std::string const &  mode = "w" 
) const
inherited

Write the object to a FITS image in memory.

Parameters
[in]managerName of the file to write to.
[in]modeIf "w", any existing file with the given name will be overwritten. If "a", new HDUs will be appended to an existing file.

◆ writeFits() [3/3]

void lsst::afw::table::io::Persistable::writeFits ( fits::Fits &  fitsfile) const
inherited

Write the object to an already-open FITS object.

Parameters
[in]fitsfileOpen FITS object to write to.

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 49 of file ApCorrMap.h.


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