lsst.afw gba399f52f3+9b61cfce8e
Loading...
Searching...
No Matches
lsst::afw::math::ProductBoundedField Class Referencefinal

A BoundedField that lazily multiplies a sequence of other BoundedFields. More...

#include <ProductBoundedField.h>

Inheritance diagram for lsst::afw::math::ProductBoundedField:
lsst::afw::table::io::PersistableFacade< ProductBoundedField > lsst::afw::math::BoundedField lsst::afw::table::io::PersistableFacade< BoundedField >

Public Member Functions

 ProductBoundedField (std::vector< std::shared_ptr< BoundedField const > > const &factors)
 Construct from a sequence of BoundedField factors.
 ProductBoundedField (ProductBoundedField const &)
 ProductBoundedField (ProductBoundedField &&)
ProductBoundedField & operator= (ProductBoundedField const &)=delete
ProductBoundedField & operator= (ProductBoundedField &&)=delete
 ~ProductBoundedField () override
double evaluate (lsst::geom::Point2D const &position) const override
 Evaluate the field at the given point.
ndarray::Array< double, 1, 1 > evaluate (ndarray::Array< double const, 1 > const &x, ndarray::Array< double const, 1 > const &y) const override
 Evaluate the field at multiple arbitrary points.
bool isPersistable () const noexcept override
 ProductBoundedField is persistable if and only if all of its factors are.
std::shared_ptr< BoundedField > operator* (double const scale) const override
 Return a scaled BoundedField.
bool operator== (BoundedField const &rhs) const override
 BoundedFields (of the same sublcass) are equal if their bounding boxes and parameters are equal.
std::vector< std::shared_ptr< BoundedField const > > getFactors () const
 Return the factors of the product.
double evaluate (double x, double y) const
 Evaluate the field at the given point.
virtual double integrate () const
 Compute the integral of this function over its bounding-box.
virtual double mean () const
 Compute the mean of this function over its bounding-box.
lsst::geom::Box2I getBBox () const
 Return the bounding box that defines the region where the field is valid.
template<typename T>
void fillImage (image::Image< T > &image, bool overlapOnly=false, int xStep=1, int yStep=1) const
 Assign the field to an image, overwriting values already present.
template<typename T>
void addToImage (image::Image< T > &image, double scaleBy=1.0, bool overlapOnly=false, int xStep=1, int yStep=1) const
 Add the field or a constant multiple of it to an image in-place.
template<typename T>
void multiplyImage (image::Image< T > &image, bool overlapOnly=false, int xStep=1, int yStep=1) const
 Multiply an image by the field in-place.
template<typename T>
void multiplyImage (image::MaskedImage< T > &image, bool overlapOnly=false) const
template<typename T>
void divideImage (image::Image< T > &image, bool overlapOnly=false, int xStep=1, int yStep=1) const
 Divide an image by the field in-place.
template<typename T>
void divideImage (image::MaskedImage< T > &image, bool overlapOnly=false) const
std::shared_ptr< BoundedField > operator/ (double scale) const
bool operator!= (BoundedField const &rhs) const
 BoundedFields (of the same sublcass) are equal if their bounding boxes and parameters are equal.

Static Public Member Functions

static std::shared_ptr< ProductBoundedField > readFits (fits::Fits &fitsfile)
 Read an object from an already open FITS object.
static std::shared_ptr< ProductBoundedField > dynamicCast (std::shared_ptr< Persistable > const &ptr)
 Dynamically cast a shared_ptr.
static std::shared_ptr< BoundedField > readFits (fits::Fits &fitsfile)
 Read an object from an already open FITS object.
static std::shared_ptr< BoundedField > dynamicCast (std::shared_ptr< Persistable > const &ptr)
 Dynamically cast a shared_ptr.

Protected Member Functions

std::string getPersistenceName () const override
std::string getPythonModule () const override
void write (OutputArchiveHandle &handle) const override

Private Member Functions

std::string toString () const override

Detailed Description

A BoundedField that lazily multiplies a sequence of other BoundedFields.

Definition at line 36 of file ProductBoundedField.h.

Constructor & Destructor Documentation

◆ ProductBoundedField() [1/3]

lsst::afw::math::ProductBoundedField::ProductBoundedField ( std::vector< std::shared_ptr< BoundedField const > > const & factors)
explicit

Construct from a sequence of BoundedField factors.

Parameters
[in]factorsBoundedFields to be multiplied together. All bounding boxes must be the same.
Exceptions
pex::exceptions::LengthErrorThrown if factors.size() < 1
pex::exceptions::InvalidParameterErrorThrown if the bounding boxes of the factors are inconsistent.

Definition at line 69 of file ProductBoundedField.cc.

◆ ProductBoundedField() [2/3]

lsst::afw::math::ProductBoundedField::ProductBoundedField ( ProductBoundedField const & )
default

◆ ProductBoundedField() [3/3]

lsst::afw::math::ProductBoundedField::ProductBoundedField ( ProductBoundedField && )
default

◆ ~ProductBoundedField()

lsst::afw::math::ProductBoundedField::~ProductBoundedField ( )
overridedefault

Member Function Documentation

◆ addToImage()

template<typename T>
template void lsst::afw::math::BoundedField::addToImage ( image::Image< T > & image,
double scaleBy = 1.0,
bool overlapOnly = false,
int xStep = 1,
int yStep = 1 ) const
inherited

Add the field or a constant multiple of it to an image in-place.

Parameters
[out]imageImage to add to.
[in]scaleByMultiply the field by this before adding it to the image.
[in]overlapOnlyIf true, only modify the region in the intersection of image.getBBox(image::PARENT) and this->getBBox().
[in]xStepDistance between grid points in X to evaluate; values between grid points will be linearly interpolated.
[in]yStepDistance between grid points in Y to evaluate; values between grid points will be linearly interpolated.
Exceptions
pex::exceptions::RuntimeErrorif the bounding boxes do not overlap and overlapOnly=false.

Definition at line 329 of file BoundedField.cc.

◆ divideImage() [1/2]

template<typename T>
void lsst::afw::math::BoundedField::divideImage ( image::Image< T > & image,
bool overlapOnly = false,
int xStep = 1,
int yStep = 1 ) const
inherited

Divide an image by the field in-place.

Parameters
[out]imageImage to fill.
[in]overlapOnlyIf true, only modify the region in the intersection of image.getBBox(image::PARENT) and this->getBBox().
[in]xStepDistance between grid points in X to evaluate; values between grid points will be linearly interpolated.
[in]yStepDistance between grid points in Y to evaluate; values between grid points will be linearly interpolated.
Exceptions
pex::exceptions::RuntimeErrorif the bounding boxes do not overlap and overlapOnly=false.

Definition at line 345 of file BoundedField.cc.

◆ divideImage() [2/2]

template<typename T>
void lsst::afw::math::BoundedField::divideImage ( image::MaskedImage< T > & image,
bool overlapOnly = false ) const
inherited

Definition at line 350 of file BoundedField.cc.

◆ dynamicCast() [1/2]

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.

◆ dynamicCast() [2/2]

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

◆ evaluate() [1/3]

double lsst::afw::math::BoundedField::evaluate ( double x,
double y ) const
inline

Evaluate the field at the given point.

This delegates to the evaluate() method that takes lsst::geom::Point2D.

There is no bounds-checking on the given position; this is the responsibility of the user, who can almost always do it more efficiently.

Definition at line 76 of file BoundedField.h.

◆ evaluate() [2/3]

double lsst::afw::math::ProductBoundedField::evaluate ( lsst::geom::Point2D const & position) const
overridevirtual

Evaluate the field at the given point.

This is the only abstract method to be implemented by subclasses.

Subclasses should not provide bounds checking on the given position; this is the responsibility of the user, who can almost always do it more efficiently.

Implements lsst::afw::math::BoundedField.

Definition at line 77 of file ProductBoundedField.cc.

◆ evaluate() [3/3]

ndarray::Array< double, 1, 1 > lsst::afw::math::ProductBoundedField::evaluate ( ndarray::Array< double const, 1 > const & x,
ndarray::Array< double const, 1 > const & y ) const
overridevirtual

Evaluate the field at multiple arbitrary points.

Parameters
[in]xarray of x coordinates, same shape as y
[in]yarray of y coordinates, same shape as x
Returns
an array of output values, same shape as x and y

There is no bounds-checking on the given positions; this is the responsibility of the user, who can almost always do it more efficiently.

Reimplemented from lsst::afw::math::BoundedField.

Definition at line 85 of file ProductBoundedField.cc.

◆ fillImage()

template<typename T>
template void lsst::afw::math::BoundedField::fillImage ( image::Image< T > & image,
bool overlapOnly = false,
int xStep = 1,
int yStep = 1 ) const
inherited

Assign the field to an image, overwriting values already present.

Parameters
[out]imageImage to fill.
[in]overlapOnlyIf true, only modify the region in the intersection of image.getBBox(image::PARENT) and this->getBBox().
[in]xStepDistance between grid points in X to evaluate; values between grid points will be linearly interpolated.
[in]yStepDistance between grid points in Y to evaluate; values between grid points will be linearly interpolated.
Exceptions
pex::exceptions::RuntimeErrorif the bounding boxes do not overlap and overlapOnly=false.

Definition at line 324 of file BoundedField.cc.

◆ getBBox()

lsst::geom::Box2I lsst::afw::math::BoundedField::getBBox ( ) const
inlineinherited

Return the bounding box that defines the region where the field is valid.

Because this is an integer bounding box, its minimum and maximum positions are the centers of the pixels where the field is valid, but the field can be assumed to be valid to the edges of those pixels, which is the boundary you'd get by converting the returned lsst::geom::Box2I into a lsst::geom::Box2D.

Definition at line 113 of file BoundedField.h.

◆ getFactors()

std::vector< std::shared_ptr< BoundedField const > > lsst::afw::math::ProductBoundedField::getFactors ( ) const
inline

Return the factors of the product.

Definition at line 80 of file ProductBoundedField.h.

◆ getPersistenceName()

std::string lsst::afw::math::ProductBoundedField::getPersistenceName ( ) const
overrideprotected

Definition at line 162 of file ProductBoundedField.cc.

◆ getPythonModule()

std::string lsst::afw::math::ProductBoundedField::getPythonModule ( ) const
overrideprotected

Definition at line 166 of file ProductBoundedField.cc.

◆ integrate()

double lsst::afw::math::BoundedField::integrate ( ) const
virtualinherited

Compute the integral of this function over its bounding-box.

Returns
The value of the integral.

Reimplemented in lsst::afw::math::ChebyshevBoundedField.

Definition at line 49 of file BoundedField.cc.

◆ isPersistable()

bool lsst::afw::math::ProductBoundedField::isPersistable ( ) const
overridenoexcept

ProductBoundedField is persistable if and only if all of its factors are.

Definition at line 157 of file ProductBoundedField.cc.

◆ mean()

double lsst::afw::math::BoundedField::mean ( ) const
virtualinherited

Compute the mean of this function over its bounding-box.

Returns
The value of the mean.

Reimplemented in lsst::afw::math::ChebyshevBoundedField.

Definition at line 51 of file BoundedField.cc.

◆ multiplyImage() [1/2]

template<typename T>
void lsst::afw::math::BoundedField::multiplyImage ( image::Image< T > & image,
bool overlapOnly = false,
int xStep = 1,
int yStep = 1 ) const
inherited

Multiply an image by the field in-place.

Parameters
[out]imageImage to fill.
[in]overlapOnlyIf true, only modify the region in the intersection of image.getBBox(image::PARENT) and this->getBBox().
[in]xStepDistance between grid points in X to evaluate; values between grid points will be linearly interpolated.
[in]yStepDistance between grid points in Y to evaluate; values between grid points will be linearly interpolated.
Exceptions
pex::exceptions::RuntimeErrorif the bounding boxes do not overlap and overlapOnly=false.

Definition at line 335 of file BoundedField.cc.

◆ multiplyImage() [2/2]

template<typename T>
void lsst::afw::math::BoundedField::multiplyImage ( image::MaskedImage< T > & image,
bool overlapOnly = false ) const
inherited

Definition at line 340 of file BoundedField.cc.

◆ operator!=()

bool lsst::afw::math::BoundedField::operator!= ( BoundedField const & rhs) const
inlineinherited

BoundedFields (of the same sublcass) are equal if their bounding boxes and parameters are equal.

Definition at line 206 of file BoundedField.h.

◆ operator*()

std::shared_ptr< BoundedField > lsst::afw::math::ProductBoundedField::operator* ( double const scale) const
overridevirtual

Return a scaled BoundedField.

Parameters
[in]scaleScaling factor

Implements lsst::afw::math::BoundedField.

Definition at line 180 of file ProductBoundedField.cc.

◆ operator/()

std::shared_ptr< BoundedField > lsst::afw::math::BoundedField::operator/ ( double scale) const
inlineinherited

Definition at line 201 of file BoundedField.h.

◆ operator=() [1/2]

ProductBoundedField & lsst::afw::math::ProductBoundedField::operator= ( ProductBoundedField && )
delete

◆ operator=() [2/2]

ProductBoundedField & lsst::afw::math::ProductBoundedField::operator= ( ProductBoundedField const & )
delete

◆ operator==()

bool lsst::afw::math::ProductBoundedField::operator== ( BoundedField const & rhs) const
overridevirtual

BoundedFields (of the same sublcass) are equal if their bounding boxes and parameters are equal.

Implements lsst::afw::math::BoundedField.

Definition at line 198 of file ProductBoundedField.cc.

◆ readFits() [1/2]

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/2]

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.

◆ toString()

std::string lsst::afw::math::ProductBoundedField::toString ( ) const
overrideprivatevirtual

Implements lsst::afw::math::BoundedField.

Definition at line 208 of file ProductBoundedField.cc.

◆ write()

void lsst::afw::math::ProductBoundedField::write ( OutputArchiveHandle & handle) const
overrideprotected

Definition at line 168 of file ProductBoundedField.cc.


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