25 #ifndef LSST_AFW_MATH_BoundedField_h_INCLUDED 26 #define LSST_AFW_MATH_BoundedField_h_INCLUDED 30 #include "lsst/base.h" 87 virtual ndarray::Array<double, 1, 1>
evaluate(ndarray::Array<double const, 1>
const&
x,
88 ndarray::Array<double const, 1>
const& y)
const;
102 virtual double mean()
const;
128 template <
typename T>
130 int xStep = 1,
int yStep = 1)
const;
147 template <
typename T>
149 int xStep = 1,
int yStep = 1)
const;
165 template <
typename T>
167 int xStep = 1,
int yStep = 1)
const;
183 template <
typename T>
185 int xStep = 1,
int yStep = 1)
const;
192 virtual std::shared_ptr<BoundedField>
operator*(
double const scale)
const = 0;
193 std::shared_ptr<BoundedField>
operator/(
double scale)
const {
return (*
this) * (1.0 /
scale); }
203 {
return os << bf.toString() <<
" on " << bf.
getBBox(); }
212 virtual std::string toString()
const = 0;
215 std::shared_ptr<BoundedField>
operator*(
double const scale, std::shared_ptr<BoundedField const> bf);
220 #endif // !LSST_AFW_MATH_BoundedField_h_INCLUDED
virtual double mean() const
Compute the mean of this function over its bounding-box.
virtual double evaluate(geom::Point2D const &position) const =0
Evaluate the field at the given point.
virtual std::shared_ptr< BoundedField > operator*(double const scale) const =0
Return a scaled BoundedField.
def scale(algorithm, min, max=None, frame=None)
An integer coordinate rectangle.
void multiplyImage(image::Image< T > &image, bool overlapOnly=false, int xStep=1, int yStep=1) const
Multiply an image by the field in-place.
A base class for objects that can be persisted via afw::table::io Archive classes.
geom::Box2I getBBox() const
Return the bounding box that defines the region where the field is valid.
A base class for image defects.
BoundedField(geom::Box2I const &bbox)
virtual bool operator==(BoundedField const &rhs) const =0
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.
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.
friend std::ostream & operator<<(std::ostream &os, BoundedField const &bf)
An abstract base class for 2-d functions defined on an integer bounding boxes.
void divideImage(image::Image< T > &image, bool overlapOnly=false, int xStep=1, int yStep=1) const
Divide an image by the field in-place.
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.
A CRTP facade class for subclasses of Persistable.
A class to represent a 2-dimensional array of pixels.
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...
virtual double integrate() const
Compute the integral of this function over its bounding-box.