LSSTApplications
10.0-2-g4f67435,11.0.rc2+1,11.0.rc2+12,11.0.rc2+3,11.0.rc2+4,11.0.rc2+5,11.0.rc2+6,11.0.rc2+7,11.0.rc2+8
LSSTDataManagementBasePackage
|
An abstract base class for 2-d functions defined on an integer bounding boxes. More...
#include <BoundedField.h>
Public Member Functions | |
virtual double | evaluate (geom::Point2D const &position) const =0 |
double | evaluate (double x, double y) const |
ndarray::Array< double, 1, 1 > | evaluate (ndarray::Array< double const, 1 > const &x, ndarray::Array< double const, 1 > const &y) const |
geom::Box2I | getBBox () const |
template<typename T > | |
void | fillImage (image::Image< T > &image, bool overlapOnly=false) const |
template<typename T > | |
void | addToImage (image::Image< T > &image, double scaleBy=1.0, bool overlapOnly=false) const |
template<typename T > | |
void | multiplyImage (image::Image< T > &image, bool overlapOnly=false) const |
template<typename T > | |
void | divideImage (image::Image< T > &image, bool overlapOnly=false) const |
virtual boost::shared_ptr < BoundedField > | operator* (double const scale) const =0 |
boost::shared_ptr< BoundedField > | operator/ (double scale) const |
virtual | ~BoundedField () |
Public Member Functions inherited from lsst.afw.table.io::Persistable | |
void | writeFits (std::string const &fileName, std::string const &mode="w") const |
Write the object to a regular FITS file. More... | |
void | writeFits (fits::MemFileManager &manager, std::string const &mode="w") const |
Write the object to a FITS image in memory. More... | |
void | writeFits (fits::Fits &fitsfile) const |
Write the object to an already-open FITS object. More... | |
virtual bool | isPersistable () const |
Return true if this particular object can be persisted using afw::table::io. More... | |
virtual | ~Persistable () |
Protected Member Functions | |
BoundedField (geom::Box2I const &bbox) | |
Protected Member Functions inherited from lsst.afw.table.io::Persistable | |
virtual std::string | getPersistenceName () const |
Return the unique name used to persist this object and look up its factory. More... | |
virtual std::string | getPythonModule () const |
Return the fully-qualified Python module that should be imported to guarantee that its factory is registered. More... | |
virtual void | write (OutputArchiveHandle &handle) const |
Write the object to one or more catalogs. More... | |
Persistable () | |
Persistable (Persistable const &other) | |
void | operator= (Persistable const &other) |
Private Attributes | |
geom::Box2I const | _bbox |
Additional Inherited Members | |
Static Public Member Functions inherited from lsst.afw.table.io::PersistableFacade< BoundedField > | |
static boost::shared_ptr < BoundedField > | readFits (fits::Fits &fitsfile) |
Read an object from an already open FITS object. More... | |
static boost::shared_ptr < BoundedField > | readFits (std::string const &fileName, int hdu=0) |
Read an object from a regular FITS file. More... | |
static boost::shared_ptr < BoundedField > | readFits (fits::MemFileManager &manager, int hdu=0) |
Read an object from a FITS file in memory. More... | |
Protected Types inherited from lsst.afw.table.io::Persistable | |
typedef io::OutputArchiveHandle | OutputArchiveHandle |
An abstract base class for 2-d functions defined on an integer bounding boxes.
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 49 of file BoundedField.h.
|
inlinevirtual |
Definition at line 160 of file BoundedField.h.
|
inlineexplicitprotected |
Definition at line 164 of file BoundedField.h.
template void lsst.afw.math::BoundedField::addToImage | ( | image::Image< T > & | image, |
double | scaleBy = 1.0 , |
||
bool | overlapOnly = false |
||
) | 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(). |
pex::exceptions::RuntimeError | if the bounding boxes do not overlap and overlapOnly=false. |
Definition at line 113 of file BoundedField.cc.
template void lsst.afw.math::BoundedField::divideImage | ( | image::Image< T > & | image, |
bool | overlapOnly = false |
||
) | 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(). |
pex::exceptions::RuntimeError | if the bounding boxes do not overlap and overlapOnly=false. |
Definition at line 123 of file BoundedField.cc.
|
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.afw.math::ChebyshevBoundedField, and lsst::meas::algorithms::CoaddBoundedField.
|
inline |
Evaluate the field at the given point.
This delegates to the evaluate() method that takes 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 70 of file BoundedField.h.
ndarray::Array< double, 1, 1 > lsst.afw.math::BoundedField::evaluate | ( | ndarray::Array< double const, 1 > const & | x, |
ndarray::Array< double const, 1 > const & | y | ||
) | const |
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.
Definition at line 30 of file BoundedField.cc.
template void lsst.afw.math::BoundedField::fillImage | ( | image::Image< T > & | image, |
bool | overlapOnly = false |
||
) | 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(). |
pex::exceptions::RuntimeError | if the bounding boxes do not overlap and overlapOnly=false. |
Definition at line 108 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 Box2I into a Box2D.
Definition at line 95 of file BoundedField.h.
template void lsst.afw.math::BoundedField::multiplyImage | ( | image::Image< T > & | image, |
bool | overlapOnly = false |
||
) | 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(). |
pex::exceptions::RuntimeError | if the bounding boxes do not overlap and overlapOnly=false. |
Definition at line 118 of file BoundedField.cc.
|
pure virtual |
Return a scaled BoundedField
[in] | scale | Scaling factor |
Implemented in lsst.afw.math::ChebyshevBoundedField, and lsst::meas::algorithms::CoaddBoundedField.
|
inline |
Definition at line 156 of file BoundedField.h.
|
private |
Definition at line 167 of file BoundedField.h.