lsst.afw gba399f52f3+9b61cfce8e
Loading...
Searching...
No Matches
lsst::afw::math::TransformBoundedField Class Reference

A BoundedField based on geom::Transform<Poin2Endpoint, GenericEndpoint<1>>. More...

#include <TransformBoundedField.h>

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

Public Types

using Transform = afw::geom::Transform<afw::geom::Point2Endpoint, afw::geom::GenericEndpoint>

Public Member Functions

 TransformBoundedField (lsst::geom::Box2I const &bbox, Transform const &transform)
 Create a TransformBoundedField from a bounding box and transform.
 ~TransformBoundedField () override=default
 TransformBoundedField (TransformBoundedField const &)=default
 TransformBoundedField (TransformBoundedField &&)=default
TransformBoundedField & operator= (TransformBoundedField const &)=delete
TransformBoundedField & operator= (TransformBoundedField &&)=delete
Transform getTransform () const
 Get the contained Transform.
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 the given point.
bool isPersistable () const noexcept override
 TransformBoundedField is always persistable.
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.
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< TransformBoundedField > readFits (fits::Fits &fitsfile)
 Read an object from an already open FITS object.
static std::shared_ptr< TransformBoundedField > 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 based on geom::Transform<Poin2Endpoint, GenericEndpoint<1>>.

TransformBoundedField supports arbitrary transforms.

Definition at line 43 of file TransformBoundedField.h.

Member Typedef Documentation

◆ Transform

Constructor & Destructor Documentation

◆ TransformBoundedField() [1/3]

lsst::afw::math::TransformBoundedField::TransformBoundedField ( lsst::geom::Box2I const & bbox,
Transform const & transform )

Create a TransformBoundedField from a bounding box and transform.

Definition at line 44 of file TransformBoundedField.cc.

◆ ~TransformBoundedField()

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

◆ TransformBoundedField() [2/3]

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

◆ TransformBoundedField() [3/3]

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

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< TransformBoundedField >::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::TransformBoundedField::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 53 of file TransformBoundedField.cc.

◆ evaluate() [3/3]

ndarray::Array< double, 1, 1 > lsst::afw::math::TransformBoundedField::evaluate ( ndarray::Array< double const, 1 > const & x,
ndarray::Array< double const, 1 > const & y ) 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.

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

Definition at line 57 of file TransformBoundedField.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.

◆ getPersistenceName()

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

Definition at line 126 of file TransformBoundedField.cc.

◆ getPythonModule()

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

Definition at line 130 of file TransformBoundedField.cc.

◆ getTransform()

Transform lsst::afw::math::TransformBoundedField::getTransform ( ) const
inline

Get the contained Transform.

Definition at line 61 of file TransformBoundedField.h.

◆ 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::TransformBoundedField::isPersistable ( ) const
inlineoverridenoexcept

TransformBoundedField is always persistable.

Definition at line 73 of file TransformBoundedField.h.

◆ 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::TransformBoundedField::operator* ( double const scale) const
overridevirtual

Return a scaled BoundedField.

Parameters
[in]scaleScaling factor

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

Definition at line 141 of file TransformBoundedField.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]

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

◆ operator=() [2/2]

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

◆ operator==()

bool lsst::afw::math::TransformBoundedField::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 148 of file TransformBoundedField.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::TransformBoundedField::toString ( ) const
overrideprivatevirtual

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

Definition at line 156 of file TransformBoundedField.cc.

◆ write()

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

Definition at line 132 of file TransformBoundedField.cc.


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