File BoundedField.h¶
-
namespace
lsst
Class for a simple mapping implementing a generic AstrometryTransform.
Remove all non-astronomical counts from the Chunk Exposure’s pixels.
Forward declarations for lsst::utils::Cache
For details on the Cache class, see the Cache.h file.
It uses a template rather than a pointer so that the derived classes can use the specifics of the transform. The class simplePolyMapping overloads a few routines.
A base class for image defects
Numeric constants used by the Integrate.h integrator routines.
Compute Image Statistics
- Note
Gauss-Kronrod-Patterson quadrature coefficients for use in quadpack routine qng. These coefficients were calculated with 101 decimal digit arithmetic by L. W. Fullerton, Bell Labs, Nov 1981.
- Note
The Statistics class itself can only handle lsst::afw::image::MaskedImage() types. The philosophy has been to handle other types by making them look like lsst::afw::image::MaskedImage() and reusing that code. Users should have no need to instantiate a Statistics object directly, but should use the overloaded makeStatistics() factory functions.
-
namespace
afw
-
namespace
math
Functions
-
class
BoundedField
: public lsst::afw::table::io::PersistableFacade<BoundedField>, public lsst::afw::table::io::Persistable - #include <BoundedField.h>
An abstract base class for 2-d functions defined on an integer bounding boxes
Integer bounding boxes (lsst::geom::Box2I) are inclusive of the end pixels (integer positions correspond to the centers of the pixels and include the entirety of those pixels). Thus a BoundedField defined on the box [x0, x1] x [y0, y1] actually covers the range [x0 - 0.5, x1 + 0.5] x [y0 - 0.5, y1 + 0.5].
BoundedField provides a number of ways of accessing the function, all delegating to a single evaluate-at-a-point implementation. The base class does not mandate anything about how the field is constructed, so it’s appropriate for use with e.g. model-fitting results, interpolation results points, or functions known a priori.
Usually, BoundedField will be used to represent functions that correspond to images, for quantities such as aperture corrections, photometric scaling, PSF model parameters, or backgrounds, and its bounding box will be set to match the PARENT bounding box of the image.
Subclassed by lsst::afw::math::ChebyshevBoundedField, lsst::afw::math::PixelAreaBoundedField, lsst::afw::math::ProductBoundedField, lsst::afw::math::TransformBoundedField, lsst::meas::algorithms::CoaddBoundedField
Public Functions
-
virtual double
evaluate
(lsst::geom::Point2D const &position) const = 0 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.
-
double
evaluate
(double x, double y) const 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.
-
virtual ndarray::Array<double, 1, 1>
evaluate
(ndarray::Array<double const, 1> const &x, ndarray::Array<double const, 1> const &y) const Evaluate the field at multiple arbitrary points
There is no bounds-checking on the given positions; this is the responsibility of the user, who can almost always do it more efficiently.
- Return
an array of output values, same shape as x and y
- Parameters
[in] x
: array of x coordinates, same shape as y[in] y
: array of y coordinates, same shape as x
-
virtual double
integrate
() const Compute the integral of this function over its bounding-box.
- Return
The value of the integral.
-
virtual double
mean
() const Compute the mean of this function over its bounding-box.
- Return
The value of the mean.
-
lsst::geom::Box2I
getBBox
() const 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.
-
template<typename
T
>
voidfillImage
(image::Image<T> &image, bool overlapOnly = false, int xStep = 1, int yStep = 1) const Assign the field to an image, overwriting values already present.
- Parameters
[out] image
: Image to fill.[in] overlapOnly
: If true, only modify the region in the intersection of image.getBBox(image::PARENT) and this->getBBox().[in] xStep
: Distance between grid points in X to evaluate; values between grid points will be linearly interpolated.[in] yStep
: Distance between grid points in Y to evaluate; values between grid points will be linearly interpolated.
- Exceptions
pex::exceptions::RuntimeError
: if the bounding boxes do not overlap and overlapOnly=false.
-
template<typename
T
>
voidaddToImage
(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
- Parameters
[out] image
: Image to add to.[in] scaleBy
: Multiply the field by this before adding it to the image.[in] overlapOnly
: If true, only modify the region in the intersection of image.getBBox(image::PARENT) and this->getBBox().[in] xStep
: Distance between grid points in X to evaluate; values between grid points will be linearly interpolated.[in] yStep
: Distance between grid points in Y to evaluate; values between grid points will be linearly interpolated.
- Exceptions
pex::exceptions::RuntimeError
: if the bounding boxes do not overlap and overlapOnly=false.
-
template<typename
T
>
voidmultiplyImage
(image::Image<T> &image, bool overlapOnly = false, int xStep = 1, int yStep = 1) const Multiply an image by the field in-place.
- Parameters
[out] image
: Image to fill.[in] overlapOnly
: If true, only modify the region in the intersection of image.getBBox(image::PARENT) and this->getBBox().[in] xStep
: Distance between grid points in X to evaluate; values between grid points will be linearly interpolated.[in] yStep
: Distance between grid points in Y to evaluate; values between grid points will be linearly interpolated.
- Exceptions
pex::exceptions::RuntimeError
: if the bounding boxes do not overlap and overlapOnly=false.
-
template<typename
T
>
voiddivideImage
(image::Image<T> &image, bool overlapOnly = false, int xStep = 1, int yStep = 1) const Divide an image by the field in-place.
- Parameters
[out] image
: Image to fill.[in] overlapOnly
: If true, only modify the region in the intersection of image.getBBox(image::PARENT) and this->getBBox().[in] xStep
: Distance between grid points in X to evaluate; values between grid points will be linearly interpolated.[in] yStep
: Distance between grid points in Y to evaluate; values between grid points will be linearly interpolated.
- Exceptions
pex::exceptions::RuntimeError
: if the bounding boxes do not overlap and overlapOnly=false.
-
virtual std::shared_ptr<BoundedField>
operator*
(double const scale) const = 0 Return a scaled BoundedField
- Parameters
[in] scale
: Scaling factor
-
std::shared_ptr<BoundedField>
operator/
(double scale) const
-
virtual bool
operator==
(BoundedField const &rhs) const = 0 BoundedFields (of the same sublcass) are equal if their bounding boxes and parameters are equal.
-
bool
operator!=
(BoundedField const &rhs) const BoundedFields (of the same sublcass) are equal if their bounding boxes and parameters are equal.
-
~BoundedField
()
-
BoundedField
(BoundedField const&)
-
BoundedField
(BoundedField&&)
-
BoundedField &
operator=
(BoundedField const&)
-
BoundedField &
operator=
(BoundedField&&)
Protected Functions
-
BoundedField
(lsst::geom::Box2I const &bbox)
-
virtual double
-
class
-
namespace