LSST Applications  21.0.0-172-gfb10e10a+18fedfabac,22.0.0+297cba6710,22.0.0+80564b0ff1,22.0.0+8d77f4f51a,22.0.0+a28f4c53b1,22.0.0+dcf3732eb2,22.0.1-1-g7d6de66+2a20fdde0d,22.0.1-1-g8e32f31+297cba6710,22.0.1-1-geca5380+7fa3b7d9b6,22.0.1-12-g44dc1dc+2a20fdde0d,22.0.1-15-g6a90155+515f58c32b,22.0.1-16-g9282f48+790f5f2caa,22.0.1-2-g92698f7+dcf3732eb2,22.0.1-2-ga9b0f51+7fa3b7d9b6,22.0.1-2-gd1925c9+bf4f0e694f,22.0.1-24-g1ad7a390+a9625a72a8,22.0.1-25-g5bf6245+3ad8ecd50b,22.0.1-25-gb120d7b+8b5510f75f,22.0.1-27-g97737f7+2a20fdde0d,22.0.1-32-gf62ce7b1+aa4237961e,22.0.1-4-g0b3f228+2a20fdde0d,22.0.1-4-g243d05b+871c1b8305,22.0.1-4-g3a563be+32dcf1063f,22.0.1-4-g44f2e3d+9e4ab0f4fa,22.0.1-42-gca6935d93+ba5e5ca3eb,22.0.1-5-g15c806e+85460ae5f3,22.0.1-5-g58711c4+611d128589,22.0.1-5-g75bb458+99c117b92f,22.0.1-6-g1c63a23+7fa3b7d9b6,22.0.1-6-g50866e6+84ff5a128b,22.0.1-6-g8d3140d+720564cf76,22.0.1-6-gd805d02+cc5644f571,22.0.1-8-ge5750ce+85460ae5f3,master-g6e05de7fdc+babf819c66,master-g99da0e417a+8d77f4f51a,w.2021.48
LSST Data Management Base Package
Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Static Protected Member Functions | Related 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::typehandling::Storable std::enable_shared_from_this< TransmissionCurve > lsst::afw::table::io::Persistable

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
 
TransmissionCurveoperator= (TransmissionCurve const &)=delete
 
TransmissionCurveoperator= (TransmissionCurve &&)=delete
 
 ~TransmissionCurve () override=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 (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. More...
 
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. More...
 
virtual std::shared_ptr< StorablecloneStorable () const
 Create a new object that is a copy of this one (optional operation). More...
 
virtual std::string toString () const
 Create a string representation of this object (optional operation). More...
 
virtual std::size_t hash_value () const
 Return a hash of this object (optional operation). More...
 
virtual bool equals (Storable const &other) const noexcept
 Compare this object to another Storable. 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 noexcept
 Return true if this particular object can be persisted using afw::table::io. More...
 
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< TransmissionCurvereadFits (fits::Fits &fitsfile)
 Read an object from an already open FITS object. More...
 
static std::shared_ptr< TransmissionCurvereadFits (std::string const &fileName, int hdu=fits::DEFAULT_HDU)
 Read an object from a regular FITS file. More...
 
static std::shared_ptr< TransmissionCurvereadFits (fits::MemFileManager &manager, int hdu=fits::DEFAULT_HDU)
 Read an object from a FITS file in memory. More...
 
static std::shared_ptr< TransmissionCurvedynamicCast (std::shared_ptr< Persistable > const &ptr)
 Dynamically cast a shared_ptr. More...
 

Protected Types

using OutputArchiveHandle = io::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...
 

Static Protected Member Functions

template<class T >
static bool singleClassEquals (T const &lhs, Storable const &rhs)
 Test if a Storable is of a particular class and equal to another object. More...
 

Related Functions

(Note that these are not member functions.)

std::ostreamoperator<< (std::ostream &os, Storable const &storable)
 Output operator for Storable. 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.

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.

Member Typedef Documentation

◆ OutputArchiveHandle

using lsst::afw::table::io::Persistable::OutputArchiveHandle = io::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()

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.

677  {
678  return nullptr;
679 }

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

672  {
673  return std::make_shared<TransformedTransmissionCurve>(shared_from_this(), std::move(transform));
674 }
table::Key< int > transform
T move(T... args)

◆ cloneStorable()

std::shared_ptr< Storable > lsst::afw::typehandling::Storable::cloneStorable ( ) const
virtualinherited

Create a new object that is a copy of this one (optional operation).

This operation is required for Storables that are stored in GenericMap by value, but not for those stored by shared pointer.

Exceptions
UnsupportedOperationExceptionThrown if this object is not cloneable.
Note
If this class supports a clone operation, the two should behave identically except for the formal return type.
When called on Python classes, this method delegates to __deepcopy__ if it exists.

Reimplemented in lsst::afw::typehandling::StorableHelper< Base >, lsst::afw::image::VisitInfo, lsst::afw::image::PhotoCalib, lsst::afw::image::FilterLabel, lsst::afw::image::CoaddInputs, lsst::afw::image::ApCorrMap, lsst::afw::geom::SkyWcs, lsst::afw::geom::polygon::Polygon, and lsst::afw::detection::Psf.

Definition at line 36 of file Storable.cc.

36  {
37  throw LSST_EXCEPT(UnsupportedOperationException, "Cloning is not supported.");
38 }
#define LSST_EXCEPT(type,...)
Create an exception with a given type.
Definition: Exception.h:48

◆ dynamicCast()

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.

18  {
19  auto result = std::dynamic_pointer_cast<T>(ptr);
20  if (!result) {
21  throw LSST_EXCEPT(pex::exceptions::TypeError, "Dynamic pointer cast failed");
22  }
23  return result;
24 }
py::object result
Definition: _schema.cc:429
uint64_t * ptr
Definition: RangeSet.cc:88

◆ equals()

bool lsst::afw::typehandling::Storable::equals ( Storable const &  other) const
virtualnoexceptinherited

Compare this object to another Storable.

Subclasses that implement equality comparison must override this method to give results consistent with operator== for all inputs that are accepted by both.

Returns
This implementation returns whether the two objects are the same.
Warning
This method compares an object to any type of Storable, although cross-class comparisons should usually return false. If cross-class comparisons are valid, implementers should take care that they are symmetric and will give the same result no matter what the compile-time types of the left- and right-hand sides are.
See also
singleClassEquals
Note
When called on Python classes, this method delegates to __eq__ if it exists.

Reimplemented in lsst::afw::image::VisitInfo, lsst::afw::image::PhotoCalib, lsst::afw::geom::SkyWcs, lsst::afw::geom::polygon::Polygon, and lsst::afw::typehandling::StorableHelper< Base >.

Definition at line 48 of file Storable.cc.

48 { return this == &other; }

◆ getPersistenceName()

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

Return the unique name used to persist this object and look up its factory.

Must be less than ArchiveIndexSchema::MAX_NAME_LENGTH characters.

Reimplemented in lsst::meas::modelfit::Mixture, lsst::meas::algorithms::WarpedPsf, lsst::meas::algorithms::SingleGaussianPsf, lsst::meas::algorithms::KernelPsf, lsst::meas::algorithms::DoubleGaussianPsf, lsst::meas::algorithms::CoaddPsf, lsst::meas::algorithms::CoaddBoundedField, lsst::afw::typehandling::StorableHelper< Base >, lsst::afw::math::WarpingControl, lsst::afw::math::NearestWarpingKernel, lsst::afw::math::BilinearWarpingKernel, lsst::afw::math::LanczosWarpingKernel, lsst::afw::math::TransformBoundedField, lsst::afw::math::ProductBoundedField, lsst::afw::math::PixelAreaBoundedField, lsst::afw::math::LinearCombinationKernel, lsst::afw::math::DeltaFunctionKernel, lsst::afw::math::AnalyticKernel, lsst::afw::math::FixedKernel, lsst::afw::math::Chebyshev1Function2< ReturnT >, lsst::afw::math::PolynomialFunction2< ReturnT >, lsst::afw::math::DoubleGaussianFunction2< ReturnT >, lsst::afw::math::GaussianFunction2< ReturnT >, lsst::afw::math::ChebyshevBoundedField, lsst::afw::image::VisitInfo, lsst::afw::image::PhotoCalib, lsst::afw::image::CoaddInputs, lsst::afw::geom::Transform< FromEndpoint, ToEndpoint >, lsst::afw::geom::Transform< afw::geom::Point2Endpoint, afw::geom::GenericEndpoint >, lsst::afw::geom::SkyWcs, lsst::afw::geom::polygon::Polygon, lsst::afw::detection::HeavyFootprint< ImagePixelT, MaskPixelT, VariancePixelT >, lsst::afw::detection::GaussianPsf, lsst::afw::detection::Footprint, lsst::afw::cameraGeom::DetectorCollection, and lsst::afw::image::FilterLabel.

Definition at line 34 of file Persistable.cc.

34 { return std::string(); }

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

681 { return "lsst.afw.image"; }

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

◆ hash_value()

std::size_t lsst::afw::typehandling::Storable::hash_value ( ) const
virtualinherited

Return a hash of this object (optional operation).

Exceptions
UnsupportedOperationExceptionThrown if this object is not hashable.
Note
C++ subclass authors are responsible for any associated specializations of std::hash.
When called on Python classes, this method delegates to __hash__ if it exists.

Reimplemented in lsst::afw::typehandling::StorableHelper< Base >, lsst::afw::image::VisitInfo, lsst::afw::image::FilterLabel, and lsst::afw::geom::polygon::Polygon.

Definition at line 44 of file Storable.cc.

44  {
45  throw LSST_EXCEPT(UnsupportedOperationException, "Hashes are not supported.");
46 }

◆ isPersistable()

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

Return true if this particular object can be persisted using afw::table::io.

Reimplemented in lsst::meas::modelfit::Mixture, lsst::meas::extensions::psfex::PsfexPsf, lsst::meas::algorithms::WarpedPsf, lsst::meas::algorithms::SingleGaussianPsf, lsst::meas::algorithms::KernelPsf, lsst::meas::algorithms::DoubleGaussianPsf, lsst::meas::algorithms::CoaddPsf, lsst::meas::algorithms::CoaddBoundedField, lsst::afw::typehandling::StorableHelper< Base >, lsst::afw::math::WarpingControl, lsst::afw::math::NearestWarpingKernel, lsst::afw::math::BilinearWarpingKernel, lsst::afw::math::LanczosWarpingKernel, lsst::afw::math::TransformBoundedField, lsst::afw::math::ProductBoundedField, lsst::afw::math::PixelAreaBoundedField, lsst::afw::math::LinearCombinationKernel, lsst::afw::math::DeltaFunctionKernel, lsst::afw::math::AnalyticKernel, lsst::afw::math::FixedKernel, lsst::afw::math::Chebyshev1Function2< ReturnT >, lsst::afw::math::PolynomialFunction2< ReturnT >, lsst::afw::math::DoubleGaussianFunction2< ReturnT >, lsst::afw::math::GaussianFunction2< ReturnT >, lsst::afw::math::ChebyshevBoundedField, lsst::afw::image::VisitInfo, lsst::afw::image::PhotoCalib, lsst::afw::image::FilterLabel, lsst::afw::image::CoaddInputs, lsst::afw::image::ApCorrMap, lsst::afw::geom::Transform< FromEndpoint, ToEndpoint >, lsst::afw::geom::Transform< afw::geom::Point2Endpoint, afw::geom::GenericEndpoint >, lsst::afw::geom::SpanSet, lsst::afw::geom::SkyWcs, lsst::afw::geom::polygon::Polygon, lsst::afw::detection::GaussianPsf, lsst::afw::detection::Footprint, lsst::afw::cameraGeom::TransformMap, lsst::afw::cameraGeom::DetectorCollection, lsst::afw::cameraGeom::Detector, and lsst::afw::cameraGeom::Camera.

Definition at line 102 of file Persistable.h.

102 { return false; }

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

609  {
610  return IdentityTransmissionCurve::get();
611 }

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

626  {
627  ::gsl_set_error_handler_off();
629  wavelengths.getSize<0>(), throughput.getSize<0>(), pex::exceptions::LengthError,
630  "Length of wavelength array (%d) does not match first dimension of of throughput array (%d)");
632  radii.getSize<0>(), throughput.getSize<1>(), pex::exceptions::LengthError,
633  "Length of radii array (%d) does not match second dimension of of throughput array (%d)");
634  // GSL wants a column major array (Array<T,2,-2>). But ndarray can only flatten row-major arrays
635  // (Array<T,2,2>). So we allocate a row-major array, assign the caller's throughput array to a
636  // transposed view of it, and then flatten the row-major array.
637  ndarray::Array<double, 2, 2> throughputTransposed = ndarray::allocate(throughput.getShape().reverse());
638  throughputTransposed.transpose() = throughput;
639  ndarray::Array<double, 1, 1> throughputFlat = ndarray::flatten<1>(throughputTransposed);
640  return std::make_shared<InterpolatedTransmissionCurve<Impl2d>>(
641  Impl2d(throughputFlat, ndarray::copy(wavelengths), ndarray::copy(radii)),
643 }
table::Key< double > throughputAtMax
table::Key< double > throughputAtMin
#define LSST_THROW_IF_NE(N1, N2, EXC_CLASS, MSG)
Check whether the given values are equal, and throw an LSST Exception if they are not.
Definition: asserts.h:38
T make_pair(T... args)

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

615  {
616  ::gsl_set_error_handler_off();
617  LSST_THROW_IF_NE(wavelengths.getSize<0>(), throughput.getSize<0>(), pex::exceptions::LengthError,
618  "Length of wavelength array (%d) does not match size of throughput array (%d)");
619  return std::make_shared<InterpolatedTransmissionCurve<Impl1d>>(
620  Impl1d(ndarray::copy(throughput), ndarray::copy(wavelengths)),
622 }

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

646  {
647  auto a = shared_from_this();
648  auto b = other.shared_from_this();
649  auto result = a->_multipliedByImpl(b);
650  if (result == nullptr) {
651  result = b->_multipliedByImpl(a);
652  }
653  if (result == nullptr) {
654  result = std::make_shared<ProductTransmissionCurve>(std::move(a), std::move(b));
655  }
656  return result;
657 }
table::Key< int > b
table::Key< int > a

◆ operator=() [1/2]

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

◆ operator=() [2/2]

TransmissionCurve& lsst::afw::image::TransmissionCurve::operator= ( TransmissionCurve const &  )
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.

183  {
184  return dynamicCast(Persistable::_readFits(fitsfile));
185  }
static std::shared_ptr< TransmissionCurve > dynamicCast(std::shared_ptr< Persistable > const &ptr)
Dynamically cast a shared_ptr.
Definition: Persistable.cc:18

◆ readFits() [2/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.

205  {
206  return dynamicCast(Persistable::_readFits(manager, hdu));
207  }

◆ readFits() [3/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.

194  {
195  return dynamicCast(Persistable::_readFits(fileName, hdu));
196  }

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

665  {
666  ndarray::Array<double, 1, 1> out = ndarray::allocate(wavelengths.getSize<0>());
667  sampleAt(position, wavelengths, out);
668  return out;
669 }
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.

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

◆ singleClassEquals()

template<class T >
static bool lsst::afw::typehandling::Storable::singleClassEquals ( T const &  lhs,
Storable const &  rhs 
)
inlinestaticprotectedinherited

Test if a Storable is of a particular class and equal to another object.

This method template simplifies implementations of equals that delegate to operator== without supporting cross-class comparisons.

Template Parameters
TThe class expected of the two objects to be compared.
Parameters
lhs,rhsThe objects to compare. Note that rhs need not be a T, while lhs must be.
Returns
true if rhs is a T and lhs == rhs; false otherwise.
Exception Safety
Provides the same level of exception safety as operator==. Most implementations of operator== do not throw.
Note
This method template calls operator== with both arguments of compile-time type T const&. Its use is not recommended if there would be any ambiguity as to which operator== gets picked by overload resolution.

This method template is typically called from equals as:

bool MyType::equals(Storable const& other) const noexcept {
    return singleClassEquals(*this, other);
}

Definition at line 151 of file Storable.h.

151  {
152  auto typedRhs = dynamic_cast<T const*>(&rhs);
153  if (typedRhs != nullptr) {
154  return lhs == *typedRhs;
155  } else {
156  return false;
157  }
158  }

◆ toString()

std::string lsst::afw::typehandling::Storable::toString ( ) const
virtualinherited

Create a string representation of this object (optional operation).

Exceptions
UnsupportedOperationExceptionThrown if this object does not have a string representation.
Note
When called on Python classes, this method delegates to __repr__.

Reimplemented in lsst::afw::typehandling::StorableHelper< Base >, lsst::afw::image::VisitInfo, lsst::afw::image::PhotoCalib, lsst::afw::image::FilterLabel, lsst::afw::geom::SkyWcs, and lsst::afw::geom::polygon::Polygon.

Definition at line 40 of file Storable.cc.

40  {
41  throw LSST_EXCEPT(UnsupportedOperationException, "No string representation available.");
42 }

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

660  {
662 }
virtual std::shared_ptr< TransmissionCurve const > _transformedByImpl(std::shared_ptr< geom::TransformPoint2ToPoint2 > transform) const
Polymorphic implementation for transformedBy().

◆ write()

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

Write the object to one or more catalogs.

The handle object passed to this function provides an interface for adding new catalogs and adding nested objects to the same archive (while checking for duplicates). See OutputArchiveHandle for more information.

Reimplemented in lsst::afw::typehandling::StorableHelper< Base >, lsst::afw::image::FilterLabel, lsst::meas::modelfit::Mixture, lsst::meas::algorithms::WarpedPsf, lsst::meas::algorithms::SingleGaussianPsf, lsst::meas::algorithms::KernelPsf, lsst::meas::algorithms::DoubleGaussianPsf, lsst::meas::algorithms::CoaddPsf, lsst::meas::algorithms::CoaddBoundedField, lsst::afw::math::WarpingControl, lsst::afw::math::NearestWarpingKernel, lsst::afw::math::BilinearWarpingKernel, lsst::afw::math::LanczosWarpingKernel, lsst::afw::math::TransformBoundedField, lsst::afw::math::ProductBoundedField, lsst::afw::math::PixelAreaBoundedField, lsst::afw::math::LinearCombinationKernel, lsst::afw::math::DeltaFunctionKernel, lsst::afw::math::AnalyticKernel, lsst::afw::math::FixedKernel, lsst::afw::math::ChebyshevBoundedField, lsst::afw::image::VisitInfo, lsst::afw::image::PhotoCalib, lsst::afw::image::CoaddInputs, lsst::afw::geom::Transform< FromEndpoint, ToEndpoint >, lsst::afw::geom::Transform< afw::geom::Point2Endpoint, afw::geom::GenericEndpoint >, lsst::afw::geom::SkyWcs, lsst::afw::geom::polygon::Polygon, lsst::afw::detection::HeavyFootprint< ImagePixelT, MaskPixelT, VariancePixelT >, lsst::afw::detection::GaussianPsf, lsst::afw::detection::Footprint, lsst::afw::cameraGeom::DetectorCollection, lsst::afw::cameraGeom::Camera, lsst::meas::extensions::psfex::PsfexPsf, lsst::afw::math::Chebyshev1Function2< ReturnT >, lsst::afw::math::PolynomialFunction2< ReturnT >, lsst::afw::math::DoubleGaussianFunction2< ReturnT >, and lsst::afw::math::GaussianFunction2< ReturnT >.

Definition at line 38 of file Persistable.cc.

38  {
39  assert(!isPersistable());
40  throw LSST_EXCEPT(pex::exceptions::LogicError,
41  "afw::table-based persistence is not supported for this object.");
42 }
virtual bool isPersistable() const noexcept
Return true if this particular object can be persisted using afw::table::io.
Definition: Persistable.h:102

◆ writeFits() [1/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.

Definition at line 18 of file Persistable.cc.

18  {
19  OutputArchive archive;
20  archive.put(this);
21  archive.writeFits(fitsfile);
22 }

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

Definition at line 29 of file Persistable.cc.

29  {
30  fits::Fits fitsfile(manager, mode, fits::Fits::AUTO_CLOSE | fits::Fits::AUTO_CHECK);
31  writeFits(fitsfile);
32 }
void writeFits(std::string const &fileName, std::string const &mode="w") const
Write the object to a regular FITS file.
Definition: Persistable.cc:24

◆ writeFits() [3/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.

Definition at line 24 of file Persistable.cc.

24  {
25  fits::Fits fitsfile(fileName, mode, fits::Fits::AUTO_CLOSE | fits::Fits::AUTO_CHECK);
26  writeFits(fitsfile);
27 }

Friends And Related Function Documentation

◆ operator<<()

std::ostream & operator<< ( std::ostream os,
Storable const &  storable 
)
related

Output operator for Storable.

Parameters
osthe desired output stream
storablethe object to print
Returns
a reference to os
Exceptions
UnsupportedOperationExceptionThrown if storable does not have an implementation of Storable::toString.

Definition at line 174 of file Storable.h.

174  {
175  return os << storable.toString();
176 }
std::ostream * os
Definition: Schema.cc:557

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