lsst.afw  14.0-60-ga423a1d65+2
Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | List of all members
lsst::afw::image::TransmissionCurve Class Referenceabstract

A spatially-varying transmission curve as a function of wavelength. More...

#include <TransmissionCurve.h>

Inheritance diagram for lsst::afw::image::TransmissionCurve:
lsst::afw::table::io::PersistableFacade< TransmissionCurve > lsst::afw::table::io::Persistable std::enable_shared_from_this< TransmissionCurve >

Public Member Functions

std::shared_ptr< TransmissionCurve const > multipliedBy (TransmissionCurve const &other) const
 Return a new TransmissionCurve that simply multiplies the values of two others. More...
 
std::shared_ptr< TransmissionCurve const > transformedBy (std::shared_ptr< geom::TransformPoint2ToPoint2 > transform) const
 Return a view of a TransmissionCurve in a different coordinate system. More...
 
 TransmissionCurve (TransmissionCurve const &)=delete
 
 TransmissionCurve (TransmissionCurve &&)=delete
 
TransmissionCurve & operator= (TransmissionCurve const &)=delete
 
TransmissionCurve & operator= (TransmissionCurve &&)=delete
 
virtual ~TransmissionCurve ()=default
 
virtual std::pair< double, double > getWavelengthBounds () const =0
 Return the wavelength interval on which this TransmissionCurve varies. More...
 
virtual std::pair< double, double > getThroughputAtBounds () const =0
 Return the throughput value that will be returned for wavelengths below and above getWavelenthBounds().first and .second (respectively). More...
 
virtual void sampleAt (geom::Point2D const &position, ndarray::Array< double const, 1, 1 > const &wavelengths, ndarray::Array< double, 1, 1 > const &out) const =0
 Evaluate the throughput at a position into a provided output array. More...
 
ndarray::Array< double, 1, 1 > sampleAt (geom::Point2D const &position, ndarray::Array< double const, 1, 1 > const &wavelengths) const
 Evaluate the throughput at a position into a new array. More...
 
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...
 
virtual bool isPersistable () const
 Return true if this particular object can be persisted using afw::table::io. More...
 
T shared_from_this (T... args)
 

Static Public Member Functions

static std::shared_ptr< TransmissionCurve const > makeIdentity ()
 Create a new TranmissionCurve that has unit thoughput at all wavelengths everywhere. More...
 
static std::shared_ptr< TransmissionCurve const > makeSpatiallyConstant (ndarray::Array< double const, 1 > const &throughput, ndarray::Array< double const, 1 > const &wavelengths, double throughputAtMin=0.0, double throughputAtMax=0.0)
 Create a new TransmissionCurve with spatially-constant throughput. More...
 
static std::shared_ptr< TransmissionCurve const > makeRadial (ndarray::Array< double const, 2 > const &throughput, ndarray::Array< double const, 1 > const &wavelengths, ndarray::Array< double const, 1 > const &radii, double throughputAtMin=0.0, double throughputAtMax=0.0)
 Create a new TransmissionCurve with throughput varying as function of radius. More...
 
static std::shared_ptr< TransmissionCurve > readFits (fits::Fits &fitsfile)
 Read an object from an already open FITS object. More...
 
static std::shared_ptr< TransmissionCurve > readFits (std::string const &fileName, int hdu=fits::DEFAULT_HDU)
 Read an object from a regular FITS file. More...
 
static std::shared_ptr< TransmissionCurve > readFits (fits::MemFileManager &manager, int hdu=fits::DEFAULT_HDU)
 Read an object from a FITS file in memory. More...
 

Protected Types

typedef io::OutputArchiveHandle OutputArchiveHandle
 

Protected Member Functions

virtual std::shared_ptr< TransmissionCurve const > _transformedByImpl (std::shared_ptr< geom::TransformPoint2ToPoint2 > transform) const
 Polymorphic implementation for transformedBy(). More...
 
virtual std::shared_ptr< TransmissionCurve const > _multipliedByImpl (std::shared_ptr< TransmissionCurve const > other) const
 One-way polymorphic implementation for multipliedBy(). More...
 
 TransmissionCurve ()=default
 
std::string getPythonModule () const override
 Return the fully-qualified Python module that should be imported to guarantee that its factory is registered. More...
 
virtual std::string getPersistenceName () const
 Return the unique name used to persist this object and look up its factory. More...
 
virtual void write (OutputArchiveHandle &handle) const
 Write the object to one or more catalogs. More...
 

Detailed Description

A spatially-varying transmission curve as a function of wavelength.

TransmissionCurve can only be evaluated at discrete (albeit arbitrary) user-provided positions; it does not provide an interface for computing average transmission over regions or computing spatially-varying scalars from integrals over the wavelength dimension.

TransmissionCurves are immutable and are expected to be passed and held by shared_ptr<TransmissionCurve const>. As such they are neither copyable nor movable (because there should be no need to copy or move).

All wavelength values should be in Angstroms.

The flux units and overall normalization of TransmissionCurves is unspecified by the class, but their normalization and units should always be consistent throughout the spatial area over which they are defined (an implementation should not e.g. re-normalize to unit bolometric flux at each position it is evaluated at). Other classes and functions using TransmissionCurves should of course document the flux units and/or normalization expected/provided.

Definition at line 59 of file TransmissionCurve.h.

Member Typedef Documentation

◆ OutputArchiveHandle

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

Definition at line 108 of file Persistable.h.

Constructor & Destructor Documentation

◆ TransmissionCurve() [1/3]

lsst::afw::image::TransmissionCurve::TransmissionCurve ( TransmissionCurve const &  )
delete

◆ TransmissionCurve() [2/3]

lsst::afw::image::TransmissionCurve::TransmissionCurve ( TransmissionCurve &&  )
delete

◆ ~TransmissionCurve()

virtual lsst::afw::image::TransmissionCurve::~TransmissionCurve ( )
virtualdefault

◆ TransmissionCurve() [3/3]

lsst::afw::image::TransmissionCurve::TransmissionCurve ( )
protecteddefault

Member Function Documentation

◆ _multipliedByImpl()

std::shared_ptr< TransmissionCurve const > lsst::afw::image::TransmissionCurve::_multipliedByImpl ( std::shared_ptr< TransmissionCurve const >  other) const
protectedvirtual

One-way polymorphic implementation for multipliedBy().

The default implementation simply returns nullptr, which indicates to multiply() that it should call other->_multiplyImply(shared_from_this()). If that returns nullptr as well, multiply will construct a new TransmisionCurve whose sampleAt method delegates to both operands and then multiplies the results.

Parameters
[in]otherThe other TransmissionCurve to multiply with self.

Definition at line 805 of file TransmissionCurve.cc.

◆ _transformedByImpl()

std::shared_ptr< TransmissionCurve const > lsst::afw::image::TransmissionCurve::_transformedByImpl ( std::shared_ptr< geom::TransformPoint2ToPoint2 >  transform) const
protectedvirtual

Polymorphic implementation for transformedBy().

The default implementation of this method creates a new TransmissionCurve that lazily applies the given transform to points before evaluating the original TransmissionCurve, which should be appropriate for nearly all concrete TransmissionCurve subclases.

Parameters
[in]transformA transform to that maps the coordinate system of the returned transform to that of this.

Definition at line 799 of file TransmissionCurve.cc.

◆ getPersistenceName()

virtual std::string lsst::afw::table::io::Persistable::getPersistenceName ( ) const
protectedvirtualinherited

◆ getPythonModule()

std::string lsst::afw::image::TransmissionCurve::getPythonModule ( ) const
overrideprotectedvirtual

Return the fully-qualified Python module that should be imported to guarantee that its factory is registered.

Must be less than ArchiveIndexSchema::MAX_MODULE_LENGTH characters.

Will be ignored if empty.

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

Definition at line 811 of file TransmissionCurve.cc.

◆ getThroughputAtBounds()

virtual std::pair<double,double> lsst::afw::image::TransmissionCurve::getThroughputAtBounds ( ) const
pure virtual

Return the throughput value that will be returned for wavelengths below and above getWavelenthBounds().first and .second (respectively).

◆ getWavelengthBounds()

virtual std::pair<double,double> lsst::afw::image::TransmissionCurve::getWavelengthBounds ( ) const
pure virtual

Return the wavelength interval on which this TransmissionCurve varies.

Throghputs beyond the min and max values will by set by sampleAt to the values returned by getThroughputAtBounds().

Min and/or max values may be infinite to indicate an analytic curve with no wavelength bounds.

◆ isPersistable()

virtual bool lsst::afw::table::io::Persistable::isPersistable ( ) const
inlinevirtualinherited

◆ makeIdentity()

std::shared_ptr< TransmissionCurve const > lsst::afw::image::TransmissionCurve::makeIdentity ( )
static

Create a new TranmissionCurve that has unit thoughput at all wavelengths everywhere.

Definition at line 719 of file TransmissionCurve.cc.

◆ makeRadial()

std::shared_ptr< TransmissionCurve const > lsst::afw::image::TransmissionCurve::makeRadial ( ndarray::Array< double const, 2 > const &  throughput,
ndarray::Array< double const, 1 > const &  wavelengths,
ndarray::Array< double const, 1 > const &  radii,
double  throughputAtMin = 0.0,
double  throughputAtMax = 0.0 
)
static

Create a new TransmissionCurve with throughput varying as function of radius.

Parameters
[in]throughputan Array of throughput values with shape (wavelengths.size(), radii.size()). Will be copied.
[in]wavelengthsan Array of wavelengths in Angstroms (will be copied). Must be monotonically increasing.
[in]radiian Array of radii (will be copied). Must be monotonically increasing.
[in]throughputAtMinthe throughput value used for wavelengths below wavelengths.front().
[in]throughputAtMaxthe throughput value used for wavelengths above wavelengths.back().

Throughput outside the given wavelength or radius domain is assumed to be constant.

Definition at line 740 of file TransmissionCurve.cc.

◆ makeSpatiallyConstant()

std::shared_ptr< TransmissionCurve const > lsst::afw::image::TransmissionCurve::makeSpatiallyConstant ( ndarray::Array< double const, 1 > const &  throughput,
ndarray::Array< double const, 1 > const &  wavelengths,
double  throughputAtMin = 0.0,
double  throughputAtMax = 0.0 
)
static

Create a new TransmissionCurve with spatially-constant throughput.

Parameters
[in]throughputan Array of throughput values with the same size as the wavelengths Array (will be copied).
[in]wavelengthsan Array of wavelengths in Angstroms (will be copied). Must be monotonically increasing.
[in]throughputAtMinthe throughput value used for wavelengths below wavelengths.front().
[in]throughputAtMaxthe throughput value used for wavelengths above wavelengths.back().

Throughput outside the given wavelength domain is assumed to be constant.

Definition at line 723 of file TransmissionCurve.cc.

◆ multipliedBy()

std::shared_ptr< TransmissionCurve const > lsst::afw::image::TransmissionCurve::multipliedBy ( TransmissionCurve const &  other) const

Return a new TransmissionCurve that simply multiplies the values of two others.

The new TransmissionCurve's "natural sampling" will be defined such that the spcaing is no larger than the spacing of either of the inputs. The minimum and maximum will be set to include the minimum and maximum of both operands except where one operand is exactly zero and hence the value of the other can be ignored.

Note
This is also mapped to mul in Python (overriding operator* in C++ would be problematic due to the use of shared_ptr).

Definition at line 769 of file TransmissionCurve.cc.

◆ operator=() [1/2]

TransmissionCurve& lsst::afw::image::TransmissionCurve::operator= ( TransmissionCurve const &  )
delete

◆ operator=() [2/2]

TransmissionCurve& lsst::afw::image::TransmissionCurve::operator= ( TransmissionCurve &&  )
delete

◆ readFits() [1/3]

static std::shared_ptr<TransmissionCurve > lsst::afw::table::io::PersistableFacade< TransmissionCurve >::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.

◆ readFits() [2/3]

static std::shared_ptr<TransmissionCurve > lsst::afw::table::io::PersistableFacade< TransmissionCurve >::readFits ( std::string const &  fileName,
int  hdu = fits::DEFAULT_HDU 
)
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 afw::fits::DEFAULT_HDU skips the primary HDU if it is empty.

Definition at line 194 of file Persistable.h.

◆ readFits() [3/3]

static std::shared_ptr<TransmissionCurve > lsst::afw::table::io::PersistableFacade< TransmissionCurve >::readFits ( fits::MemFileManager &  manager,
int  hdu = fits::DEFAULT_HDU 
)
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 afw::fits::DEFAULT_HDU skips the primary HDU if it is empty.

Definition at line 205 of file Persistable.h.

◆ sampleAt() [1/2]

virtual void lsst::afw::image::TransmissionCurve::sampleAt ( geom::Point2D const &  position,
ndarray::Array< double const, 1, 1 > const &  wavelengths,
ndarray::Array< double, 1, 1 > const &  out 
) const
pure virtual

Evaluate the throughput at a position into a provided output array.

Parameters
[in]positionSpatial position at which to evaluate.
[in]wavelengthsWavelengths at which to evaluate.
[in,out]outComputed throughput values. Must be pre- allocated to the same size as the wavelengths array.
Exceptions
Throwspex::exceptions::LengthError if the size of the wavelengths and out arrays differ.
Exception Safety
Provides basic exception safety: the out array values may be modified if an exception is thrown.

◆ sampleAt() [2/2]

ndarray::Array< double, 1, 1 > lsst::afw::image::TransmissionCurve::sampleAt ( geom::Point2D const &  position,
ndarray::Array< double const, 1, 1 > const &  wavelengths 
) const

Evaluate the throughput at a position into a new array.

Parameters
[in]positionSpatial position at which to evaluate.
[in]wavelengthsWavelengths at which to evaluate.
Returns
Computed throughput values, in an array with the same size as wavelengths.

Definition at line 790 of file TransmissionCurve.cc.

◆ transformedBy()

std::shared_ptr< TransmissionCurve const > lsst::afw::image::TransmissionCurve::transformedBy ( std::shared_ptr< geom::TransformPoint2ToPoint2 >  transform) const

Return a view of a TransmissionCurve in a different coordinate system.

The returned TransmissionCurve will be equivalent to one whose sampleAt method calls first calls transform.applyInverse on the given point and then calls base.sampleAt on the result.

Definition at line 784 of file TransmissionCurve.cc.

◆ write()

virtual void lsst::afw::table::io::Persistable::write ( OutputArchiveHandle &  handle) const
protectedvirtualinherited

◆ 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.

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