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

A BoundedField that evaluate the pixel area of a SkyWcs in angular units. More...

#include <PixelAreaBoundedField.h>

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

Public Member Functions

 PixelAreaBoundedField (lsst::geom::Box2I const &bbox, std::shared_ptr< geom::SkyWcs const > skyWcs, lsst::geom::AngleUnit const &unit=lsst::geom::radians, double scaling=1.0)
 Create a PixelAreaBoundedField from a SkyWcs.
 ~PixelAreaBoundedField () override=default
 PixelAreaBoundedField (PixelAreaBoundedField const &)=default
 PixelAreaBoundedField (PixelAreaBoundedField &&)=default
PixelAreaBoundedField & operator= (PixelAreaBoundedField const &)=delete
PixelAreaBoundedField & operator= (PixelAreaBoundedField &&)=delete
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
 PixelAreaBoundedField is persistable if and only if the nested SkyWcs is.
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::shared_ptr< geom::SkyWcs const > getSkyWcs () const
 Return the WCS that backs this field.
double getScaling () const
 Return the scaling applied to evaluation of the pixel area when that original area is in radians^2.
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< 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 evaluate the pixel area of a SkyWcs in angular units.

Typically used to move an image or source flux between surface brightness and fluence.

Definition at line 47 of file PixelAreaBoundedField.h.

Constructor & Destructor Documentation

◆ PixelAreaBoundedField() [1/3]

lsst::afw::math::PixelAreaBoundedField::PixelAreaBoundedField ( lsst::geom::Box2I const & bbox,
std::shared_ptr< geom::SkyWcs const > skyWcs,
lsst::geom::AngleUnit const & unit = lsst::geom::radians,
double scaling = 1.0 )

Create a PixelAreaBoundedField from a SkyWcs.

Parameters
[in]bboxPixel bounding box over which the WCS is valid.
[in]skyWcsWCS that maps pixels to and from sky coordinates.
[in]unitAngular unit that is used (squared) for the fields values.
[in]scalingFactor all field values should be scaled by.
Exceptions
pex::exception::InvalidParameterErrorThrown if skyWcs is null.

Definition at line 46 of file PixelAreaBoundedField.cc.

◆ ~PixelAreaBoundedField()

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

◆ PixelAreaBoundedField() [2/3]

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

◆ PixelAreaBoundedField() [3/3]

lsst::afw::math::PixelAreaBoundedField::PixelAreaBoundedField ( PixelAreaBoundedField && )
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()

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

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::PixelAreaBoundedField::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 64 of file PixelAreaBoundedField.cc.

◆ evaluate() [3/3]

ndarray::Array< double, 1, 1 > lsst::afw::math::PixelAreaBoundedField::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 68 of file PixelAreaBoundedField.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::PixelAreaBoundedField::getPersistenceName ( ) const
overrideprotected

Definition at line 179 of file PixelAreaBoundedField.cc.

◆ getPythonModule()

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

Definition at line 183 of file PixelAreaBoundedField.cc.

◆ getScaling()

double lsst::afw::math::PixelAreaBoundedField::getScaling ( ) const
inline

Return the scaling applied to evaluation of the pixel area when that original area is in radians^2.

Definition at line 100 of file PixelAreaBoundedField.h.

◆ getSkyWcs()

std::shared_ptr< geom::SkyWcs const > lsst::afw::math::PixelAreaBoundedField::getSkyWcs ( ) const
inline

Return the WCS that backs this field.

Definition at line 94 of file PixelAreaBoundedField.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::PixelAreaBoundedField::isPersistable ( ) const
overridenoexcept

PixelAreaBoundedField is persistable if and only if the nested SkyWcs is.

Definition at line 103 of file PixelAreaBoundedField.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::PixelAreaBoundedField::operator* ( double const scale) const
overridevirtual

Return a scaled BoundedField.

Parameters
[in]scaleScaling factor

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

Definition at line 107 of file PixelAreaBoundedField.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]

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

◆ operator=() [2/2]

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

◆ operator==()

bool lsst::afw::math::PixelAreaBoundedField::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 111 of file PixelAreaBoundedField.cc.

◆ readFits()

Read an object from an already open FITS object.

Parameters
[in]fitsfileFITS object to read from, already positioned at the desired HDU.

Definition at line 183 of file Persistable.h.

◆ toString()

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

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

Definition at line 119 of file PixelAreaBoundedField.cc.

◆ write()

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

Definition at line 185 of file PixelAreaBoundedField.cc.


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