LSST Applications g1cfbe01172+01aa18f939,g20cdd03214+31e6b93548,g28da252d5a+ea8665a95b,g2bbee38e9b+9ec6cc348d,g2bc492864f+9ec6cc348d,g347aa1857d+9ec6cc348d,g3a166c0a6a+9ec6cc348d,g4322eb9e3a+65eff1e020,g461a3dce89+b86e4b8053,g50ff169b8f+f991eae79d,g52b1c1532d+b86e4b8053,g607f77f49a+31e6b93548,g78056777b3+8ae2798781,g858d7b2824+31e6b93548,g8cd86fa7b1+4851e61ca4,g9ddcbc5298+f24b38b85a,ga1e77700b3+3309dba821,gae0086650b+b86e4b8053,gb0e22166c9+6076c0b52b,gbb886bcc26+dccb771098,gbd462c55f0+dc07f8e65d,gc0c51c7ec2+31e6b93548,gc120e1dc64+a417ce3171,gc28159a63d+9ec6cc348d,gc2a6998b7e+f95f64aeae,gcdd4ae20e8+507450c4cd,gcf0d15dbbd+507450c4cd,gd1535ee943+bcf88ba65f,gd598c5cd71+66126f91fb,gdaeeff99f8+006e14e809,gdbce86181e+39d5515b1a,ge3d4d395c2+b12d4d6a95,ge79ae78c31+9ec6cc348d,gf048a9a2f4+d9c36e6b63,gfbcc870c63+ea41c4420b,w.2024.27
LSST Data Management Base Package
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Static Protected Member Functions | Related Symbols | 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.
 
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
 
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.
 
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.
 
virtual std::shared_ptr< StorablecloneStorable () const
 Create a new object that is a copy of this one (optional operation).
 
virtual std::string toString () const
 Create a string representation of this object (optional operation).
 
virtual std::size_t hash_value () const
 Return a hash of this object (optional operation).
 
virtual bool equals (Storable const &other) const noexcept
 Compare this object to another Storable.
 
void writeFits (std::string const &fileName, std::string const &mode="w") const
 Write the object to a regular FITS file.
 
void writeFits (fits::MemFileManager &manager, std::string const &mode="w") const
 Write the object to a FITS image in memory.
 
void writeFits (fits::Fits &fitsfile) const
 Write the object to an already-open FITS object.
 
virtual bool isPersistable () const noexcept
 Return true if this particular object can be persisted using afw::table::io.
 
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< TransmissionCurvereadFits (fits::Fits &fitsfile)
 Read an object from an already open FITS object.
 
static std::shared_ptr< TransmissionCurvereadFits (std::string const &fileName, int hdu=fits::DEFAULT_HDU)
 Read an object from a regular FITS file.
 
static std::shared_ptr< TransmissionCurvereadFits (fits::MemFileManager &manager, int hdu=fits::DEFAULT_HDU)
 Read an object from a FITS file in memory.
 
static std::shared_ptr< TransmissionCurvedynamicCast (std::shared_ptr< Persistable > const &ptr)
 Dynamically cast a shared_ptr.
 

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().
 
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
 Return the fully-qualified Python module that should be imported to guarantee that its factory is registered.
 
virtual std::string getPersistenceName () const
 Return the unique name used to persist this object and look up its factory.
 
virtual void write (OutputArchiveHandle &handle) const
 Write the object to one or more catalogs.
 

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.
 

Related Symbols

(Note that these are not member symbols.)

std::ostreamoperator<< (std::ostream &os, Storable const &storable)
 Output operator for Storable.
 

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}
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::detection::Psf, lsst::afw::geom::polygon::Polygon, lsst::afw::geom::SkyWcs, lsst::afw::image::ApCorrMap, lsst::afw::image::CoaddInputs, lsst::afw::image::FilterLabel, lsst::afw::image::PhotoCalib, lsst::afw::image::VisitInfo, and lsst::afw::typehandling::StorableHelper< Base >.

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.

◆ 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::typehandling::StorableHelper< Base >, lsst::afw::geom::polygon::Polygon, lsst::afw::geom::SkyWcs, lsst::afw::image::PhotoCalib, and lsst::afw::image::VisitInfo.

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

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::geom::polygon::Polygon, lsst::afw::image::FilterLabel, lsst::afw::image::VisitInfo, and lsst::afw::typehandling::StorableHelper< Base >.

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

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}
py::object result
Definition _schema.cc:429
table::Key< int > b

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

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

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

◆ 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::geom::polygon::Polygon, lsst::afw::geom::SkyWcs, lsst::afw::image::FilterLabel, lsst::afw::image::PhotoCalib, lsst::afw::image::VisitInfo, and lsst::afw::typehandling::StorableHelper< Base >.

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 {
661 return _transformedByImpl(std::move(transform));
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::math::GaussianFunction2< ReturnT >, lsst::afw::math::DoubleGaussianFunction2< ReturnT >, lsst::afw::math::PolynomialFunction2< ReturnT >, lsst::afw::math::Chebyshev1Function2< ReturnT >, lsst::meas::extensions::psfex::PsfexPsf, lsst::afw::cameraGeom::Camera, lsst::afw::cameraGeom::Detector, lsst::afw::cameraGeom::DetectorCollection, lsst::afw::cameraGeom::TransformMap, lsst::afw::detection::Footprint, lsst::afw::detection::GaussianPsf, lsst::afw::detection::HeavyFootprint< ImagePixelT, MaskPixelT, VariancePixelT >, lsst::afw::geom::polygon::Polygon, lsst::afw::geom::SkyWcs, lsst::afw::geom::SpanSet, lsst::afw::geom::Transform< FromEndpoint, ToEndpoint >, lsst::afw::geom::Transform< afw::geom::Point2Endpoint, afw::geom::GenericEndpoint >, lsst::afw::image::ApCorrMap, lsst::afw::image::CoaddInputs, lsst::afw::image::PhotoCalib, lsst::afw::image::VisitInfo, lsst::afw::math::ChebyshevBoundedField, lsst::afw::math::FixedKernel, lsst::afw::math::AnalyticKernel, lsst::afw::math::DeltaFunctionKernel, lsst::afw::math::LinearCombinationKernel, lsst::afw::math::PixelAreaBoundedField, lsst::afw::math::ProductBoundedField, lsst::afw::math::TransformBoundedField, lsst::afw::math::LanczosWarpingKernel, lsst::afw::math::BilinearWarpingKernel, lsst::afw::math::NearestWarpingKernel, lsst::afw::math::WarpingControl, lsst::meas::algorithms::CoaddBoundedField, lsst::meas::algorithms::CoaddPsf, lsst::meas::algorithms::DoubleGaussianPsf, lsst::meas::algorithms::KernelPsf, lsst::meas::algorithms::SingleGaussianPsf, lsst::meas::algorithms::WarpedPsf, lsst::meas::modelfit::Mixture, lsst::afw::image::FilterLabel, and lsst::afw::typehandling::StorableHelper< Base >.

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.

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

◆ 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 Symbol 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}

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