LSST Applications g063fba187b+cac8b7c890,g0f08755f38+6aee506743,g1653933729+a8ce1bb630,g168dd56ebc+a8ce1bb630,g1a2382251a+b4475c5878,g1dcb35cd9c+8f9bc1652e,g20f6ffc8e0+6aee506743,g217e2c1bcf+73dee94bd0,g28da252d5a+1f19c529b9,g2bbee38e9b+3f2625acfc,g2bc492864f+3f2625acfc,g3156d2b45e+6e55a43351,g32e5bea42b+1bb94961c2,g347aa1857d+3f2625acfc,g35bb328faa+a8ce1bb630,g3a166c0a6a+3f2625acfc,g3e281a1b8c+c5dd892a6c,g3e8969e208+a8ce1bb630,g414038480c+5927e1bc1e,g41af890bb2+8a9e676b2a,g7af13505b9+809c143d88,g80478fca09+6ef8b1810f,g82479be7b0+f568feb641,g858d7b2824+6aee506743,g89c8672015+f4add4ffd5,g9125e01d80+a8ce1bb630,ga5288a1d22+2903d499ea,gb58c049af0+d64f4d3760,gc28159a63d+3f2625acfc,gcab2d0539d+b12535109e,gcf0d15dbbd+46a3f46ba9,gda6a2b7d83+46a3f46ba9,gdaeeff99f8+1711a396fd,ge79ae78c31+3f2625acfc,gef2f8181fd+0a71e47438,gf0baf85859+c1f95f4921,gfa517265be+6aee506743,gfa999e8aa5+17cd334064,w.2024.51
LSST Data Management Base Package
|
An abstract base class for 2-d functions defined on an integer bounding boxes. More...
#include <BoundedField.h>
Public Member Functions | |
virtual double | evaluate (lsst::geom::Point2D const &position) const =0 |
Evaluate the field at the given point. | |
double | evaluate (double x, double y) const |
Evaluate the field at the given point. | |
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. | |
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 | divideImage (image::Image< T > &image, bool overlapOnly=false, int xStep=1, int yStep=1) const |
Divide an image by the field in-place. | |
virtual std::shared_ptr< BoundedField > | operator* (double const scale) const =0 |
Return a scaled BoundedField. | |
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 () override=default | |
BoundedField (BoundedField const &)=default | |
BoundedField (BoundedField &&)=default | |
BoundedField & | operator= (BoundedField const &)=delete |
BoundedField & | operator= (BoundedField &&)=delete |
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. | |
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 > | readFits (std::string const &fileName, int hdu=fits::DEFAULT_HDU) |
Read an object from a regular FITS file. | |
static std::shared_ptr< BoundedField > | readFits (fits::MemFileManager &manager, int hdu=fits::DEFAULT_HDU) |
Read an object from a FITS file in memory. | |
static std::shared_ptr< BoundedField > | dynamicCast (std::shared_ptr< Persistable > const &ptr) |
Dynamically cast a shared_ptr. | |
Protected Types | |
using | OutputArchiveHandle = io::OutputArchiveHandle |
Protected Member Functions | |
BoundedField (lsst::geom::Box2I const &bbox) | |
virtual std::string | getPersistenceName () const |
Return the unique name used to persist this object and look up its factory. | |
virtual std::string | getPythonModule () const |
Return the fully-qualified Python module that should be imported to guarantee that its factory is registered. | |
virtual void | write (OutputArchiveHandle &handle) const |
Write the object to one or more catalogs. | |
Private Member Functions | |
virtual std::string | toString () const =0 |
Friends | |
std::ostream & | operator<< (std::ostream &os, BoundedField const &bf) |
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.
Definition at line 55 of file BoundedField.h.
|
protectedinherited |
Definition at line 108 of file Persistable.h.
|
overridedefault |
|
default |
|
default |
|
inlineexplicitprotected |
Definition at line 208 of file BoundedField.h.
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 |
Add the field or a constant multiple of it to an image in-place.
[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. |
pex::exceptions::RuntimeError | if the bounding boxes do not overlap and overlapOnly=false. |
Definition at line 264 of file BoundedField.cc.
template void lsst::afw::math::BoundedField::divideImage | ( | image::Image< T > & | image, |
bool | overlapOnly = false, | ||
int | xStep = 1, | ||
int | yStep = 1 ) const |
Divide an image by the field in-place.
[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. |
pex::exceptions::RuntimeError | if the bounding boxes do not overlap and overlapOnly=false. |
Definition at line 275 of file BoundedField.cc.
|
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;
lsst::pex::exceptions::LogicError | if the cast fails |
param[in] ptr The pointer to be cast.
lsst::pex::exceptions::TypeError | If the dynamic cast fails. |
Definition at line 218 of file Persistable.cc.
|
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 75 of file BoundedField.h.
|
pure virtual |
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.
Implemented in lsst::meas::algorithms::CoaddBoundedField, lsst::afw::math::ChebyshevBoundedField, lsst::afw::math::PixelAreaBoundedField, lsst::afw::math::ProductBoundedField, lsst::afw::math::TransformBoundedField, lsst::afw::math::ChebyshevBoundedField, lsst::afw::math::ProductBoundedField, and lsst::afw::math::TransformBoundedField.
|
virtual |
Evaluate the field at multiple arbitrary points.
[in] | x | array of x coordinates, same shape as y |
[in] | y | array of y coordinates, same shape as x |
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 in lsst::afw::math::ChebyshevBoundedField, lsst::afw::math::ProductBoundedField, lsst::afw::math::TransformBoundedField, lsst::afw::math::PixelAreaBoundedField, lsst::afw::math::ProductBoundedField, and lsst::afw::math::TransformBoundedField.
Definition at line 40 of file BoundedField.cc.
template void lsst::afw::math::BoundedField::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.
[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. |
pex::exceptions::RuntimeError | if the bounding boxes do not overlap and overlapOnly=false. |
Definition at line 259 of file BoundedField.cc.
|
inline |
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 112 of file BoundedField.h.
|
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.
|
protectedvirtualinherited |
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 in lsst::afw::image::FilterLabel, lsst::afw::cameraGeom::Detector, lsst::afw::cameraGeom::DetectorCollection, lsst::afw::cameraGeom::TransformMap, lsst::afw::detection::Footprint, lsst::afw::detection::GaussianPsf, 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::TransmissionCurve, lsst::afw::math::ChebyshevBoundedField, lsst::afw::math::Function< double >, lsst::afw::math::Function< Kernel::Pixel >, lsst::afw::math::Function< Pixel >, lsst::afw::math::Function< ReturnT >, lsst::afw::math::Kernel, 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::KernelPsf, lsst::meas::algorithms::WarpedPsf, lsst::meas::extensions::psfex::PsfexPsf, and lsst::meas::modelfit::Mixture.
Definition at line 36 of file Persistable.cc.
|
virtual |
Compute the integral of this function over its bounding-box.
Reimplemented in lsst::afw::math::ChebyshevBoundedField.
Definition at line 49 of file BoundedField.cc.
|
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.
|
virtual |
Compute the mean of this function over its bounding-box.
Reimplemented in lsst::afw::math::ChebyshevBoundedField.
Definition at line 51 of file BoundedField.cc.
template void lsst::afw::math::BoundedField::multiplyImage | ( | image::Image< T > & | image, |
bool | overlapOnly = false, | ||
int | xStep = 1, | ||
int | yStep = 1 ) const |
Multiply an image by the field in-place.
[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. |
pex::exceptions::RuntimeError | if the bounding boxes do not overlap and overlapOnly=false. |
Definition at line 270 of file BoundedField.cc.
|
inline |
BoundedFields (of the same sublcass) are equal if their bounding boxes and parameters are equal.
Definition at line 195 of file BoundedField.h.
|
pure virtual |
Return a scaled BoundedField.
[in] | scale | Scaling factor |
Implemented in lsst::afw::math::ChebyshevBoundedField, lsst::afw::math::PixelAreaBoundedField, lsst::afw::math::ProductBoundedField, lsst::afw::math::TransformBoundedField, and lsst::meas::algorithms::CoaddBoundedField.
|
inline |
Definition at line 190 of file BoundedField.h.
|
delete |
|
delete |
|
pure virtual |
BoundedFields (of the same sublcass) are equal if their bounding boxes and parameters are equal.
Implemented in lsst::afw::math::ChebyshevBoundedField, lsst::afw::math::PixelAreaBoundedField, lsst::afw::math::ProductBoundedField, and lsst::afw::math::TransformBoundedField.
|
inlinestaticinherited |
Read an object from an already open FITS object.
[in] | fitsfile | FITS object to read from, already positioned at the desired HDU. |
Definition at line 183 of file Persistable.h.
|
inlinestaticinherited |
Read an object from a FITS file in memory.
[in] | manager | Manager for the memory to read from. |
[in] | hdu | HDU 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.
|
inlinestaticinherited |
Read an object from a regular FITS file.
[in] | fileName | Name of the file to read. |
[in] | hdu | HDU 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.
|
privatepure virtual |
|
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.
|
inherited |
Write the object to an already-open FITS object.
[in] | fitsfile | Open FITS object to write to. |
Definition at line 18 of file Persistable.cc.
|
inherited |
Write the object to a FITS image in memory.
[in] | manager | Name of the file to write to. |
[in] | mode | If "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.
|
inherited |
Write the object to a regular FITS file.
[in] | fileName | Name of the file to write to. |
[in] | mode | If "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.
|
friend |
Definition at line 203 of file BoundedField.h.