lsst.afw gba399f52f3+9b61cfce8e
Loading...
Searching...
No Matches
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 > 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.
std::shared_ptr< TransmissionCurve const > transformedBy (std::shared_ptr< geom::TransformPoint2ToPoint2 > transform) const
 Return a view of a TransmissionCurve in a different coordinate system.
 TransmissionCurve (TransmissionCurve const &)=delete
 TransmissionCurve (TransmissionCurve &&)=delete
TransmissionCurve & operator= (TransmissionCurve const &)=delete
TransmissionCurve & operator= (TransmissionCurve &&)=delete
 ~TransmissionCurve () override=default
virtual std::pair< double, double > getWavelengthBounds () const =0
 Return the wavelength interval on which this TransmissionCurve varies.
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).
virtual void sampleAt (lsst::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.
ndarray::Array< double, 1, 1 > sampleAt (lsst::geom::Point2D const &position, ndarray::Array< double const, 1, 1 > const &wavelengths) const
 Evaluate the throughput at a position into a new array.
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.
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.
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.
static std::shared_ptr< TransmissionCurve > readFits (fits::Fits &fitsfile)
 Read an object from an already open FITS object.
static std::shared_ptr< TransmissionCurve > dynamicCast (std::shared_ptr< Persistable > const &ptr)
 Dynamically cast a shared_ptr.

Protected Member Functions

virtual std::shared_ptr< TransmissionCurve const > _transformedByImpl (std::shared_ptr< geom::TransformPoint2ToPoint2 > transform) const
 Polymorphic implementation for transformedBy().
virtual std::shared_ptr< TransmissionCurve const > _multipliedByImpl (std::shared_ptr< TransmissionCurve const > other) const
 One-way polymorphic implementation for multipliedBy().
 TransmissionCurve ()=default
std::string getPythonModule () const override

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.

Note
TransmissionCurve is an interface to various C++-only implementation classes. Because these classes are not mapped to Python, some references to a TransmissionCurve object may appear in Python as a table::io::Persistable or typehandling::Storable instead. The best way to avoid this at present is to call functions that, in C++, explicitly return a TransmissionCurve.

Definition at line 65 of file TransmissionCurve.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()

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

◆ 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 676 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 671 of file TransmissionCurve.cc.

◆ dynamicCast()

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

◆ getPythonModule()

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

Definition at line 681 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.

◆ 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 609 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 624 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 613 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 645 of file TransmissionCurve.cc.

◆ operator=() [1/2]

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

◆ operator=() [2/2]

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

◆ readFits()

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.

◆ sampleAt() [1/2]

ndarray::Array< double, 1, 1 > lsst::afw::image::TransmissionCurve::sampleAt ( lsst::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 664 of file TransmissionCurve.cc.

◆ sampleAt() [2/2]

virtual void lsst::afw::image::TransmissionCurve::sampleAt ( lsst::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.

◆ 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 659 of file TransmissionCurve.cc.


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