LSSTApplications
10.0+286,10.0+36,10.0+46,10.0-2-g4f67435,10.1+152,10.1+37,11.0,11.0+1,11.0-1-g47edd16,11.0-1-g60db491,11.0-1-g7418c06,11.0-2-g04d2804,11.0-2-g68503cd,11.0-2-g818369d,11.0-2-gb8b8ce7
LSSTDataManagementBasePackage
|
A BoundedField based on 2-d Chebyshev polynomials of the first kind. More...
#include <ChebyshevBoundedField.h>
Public Types | |
typedef ChebyshevBoundedFieldControl | Control |
Public Member Functions | |
ChebyshevBoundedField (afw::geom::Box2I const &bbox, ndarray::Array< double const, 2, 2 > const &coefficients) | |
Initialize the field from its bounding box an coefficients. More... | |
ndarray::Array< double const, 2, 2 > | getCoefficients () const |
Return the coefficient matrix. More... | |
boost::shared_ptr < ChebyshevBoundedField > | truncate (Control const &ctrl) const |
Return a new ChebyshevBoudedField with maximum orders set by the given control object. More... | |
boost::shared_ptr < ChebyshevBoundedField > | relocate (geom::Box2I const &bbox) const |
virtual double | evaluate (geom::Point2D const &position) const |
virtual bool | isPersistable () const |
ChebyshevBoundedField is always persistable. More... | |
virtual boost::shared_ptr < BoundedField > | operator* (double const scale) const |
Public Member Functions inherited from lsst::afw::math::BoundedField | |
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 |
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 | ~Persistable () |
Static Public Member Functions | |
static boost::shared_ptr < ChebyshevBoundedField > | fit (afw::geom::Box2I const &bbox, ndarray::Array< double const, 1 > const &x, ndarray::Array< double const, 1 > const &y, ndarray::Array< double const, 1 > const &z, Control const &ctrl) |
Fit a Chebyshev approximation to non-gridded data with equal weights. More... | |
static boost::shared_ptr < ChebyshevBoundedField > | fit (afw::geom::Box2I const &bbox, ndarray::Array< double const, 1 > const &x, ndarray::Array< double const, 1 > const &y, ndarray::Array< double const, 1 > const &z, ndarray::Array< double const, 1 > const &w, Control const &ctrl) |
Fit a Chebyshev approximation to non-gridded data with unequal weights. More... | |
template<typename T > | |
static boost::shared_ptr < ChebyshevBoundedField > | fit (image::Image< T > const &image, Control const &ctrl) |
Fit a Chebyshev approximation to gridded data with equal weights. More... | |
Static Public Member Functions inherited from lsst::afw::table::io::PersistableFacade< ChebyshevBoundedField > | |
static boost::shared_ptr < ChebyshevBoundedField > | readFits (fits::Fits &fitsfile) |
Read an object from an already open FITS object. More... | |
static boost::shared_ptr < ChebyshevBoundedField > | readFits (std::string const &fileName, int hdu=0) |
Read an object from a regular FITS file. More... | |
static boost::shared_ptr < ChebyshevBoundedField > | readFits (fits::MemFileManager &manager, int hdu=0) |
Read an object from a FITS file in memory. More... | |
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 Member Functions | |
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... | |
Protected Member Functions inherited from lsst::afw::math::BoundedField | |
BoundedField (geom::Box2I const &bbox) | |
Protected Member Functions inherited from lsst::afw::table::io::Persistable | |
Persistable () | |
Persistable (Persistable const &other) | |
void | operator= (Persistable const &other) |
Private Member Functions | |
ChebyshevBoundedField (afw::geom::Box2I const &bbox) | |
Private Attributes | |
geom::AffineTransform | _toChebyshevRange |
ndarray::Array< double const, 2, 2 > | _coefficients |
Additional Inherited Members | |
Protected Types inherited from lsst::afw::table::io::Persistable | |
typedef io::OutputArchiveHandle | OutputArchiveHandle |
A BoundedField based on 2-d Chebyshev polynomials of the first kind.
ChebyshevBoundedField supports fitting to gridded and non-gridded data, as well coefficient matrices with different x- and y-order.
There is currently quite a bit of duplication of functionality between ChebyshevBoundedField, ApproximateChebyshev, and Chebyshev1Function2; the intent is that ChebyshevBoundedField will ultimately replace ApproximateChebyshev and should be preferred over Chebyshev1Function2 when the parametrization interface that is part of the Function2 class is not needed.
Definition at line 69 of file ChebyshevBoundedField.h.
Definition at line 75 of file ChebyshevBoundedField.h.
lsst::afw::math::ChebyshevBoundedField::ChebyshevBoundedField | ( | afw::geom::Box2I const & | bbox, |
ndarray::Array< double const, 2, 2 > const & | coefficients | ||
) |
Initialize the field from its bounding box an coefficients.
This constructor is mostly intended for testing purposes and persistence, but it also provides a way to initialize the object from Chebyshev coefficients derived from some external source.
Note that because the bounding box provided is always an integer bounding box, and LSST convention puts the center of each pixel at an integer, the actual floating-point domain of the Chebyshev functions is Box2D(bbox), that is, the box that contains the entirety of all the pixels included in the integer bounding box.
The coefficients are ordered [y,x], so the shape is (orderY+1, orderX+1), and the arguments to the Chebyshev functions are transformed such that the region Box2D(bbox) is mapped to [-1, 1]x[-1, 1].
Definition at line 58 of file ChebyshevBoundedField.cc.
|
explicitprivate |
Definition at line 66 of file ChebyshevBoundedField.cc.
|
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.
Implements lsst::afw::math::BoundedField.
Definition at line 310 of file ChebyshevBoundedField.cc.
|
static |
Fit a Chebyshev approximation to non-gridded data with equal weights.
[in] | bbox | Integer bounding box of the resulting approximation. All given points must lie within Box2D(bbox). |
[in] | x | Array of x coordinate values. |
[in] | y | Array of y coordinate values. |
[in] | z | Array of field values to be fit at each (x,y) point. |
[in] | ctrl | Specifies the orders and triangularity of the coefficient matrix. |
Definition at line 161 of file ChebyshevBoundedField.cc.
|
static |
Fit a Chebyshev approximation to non-gridded data with unequal weights.
[in] | bbox | Integer bounding box of the resulting approximation. All given points must lie within Box2D(bbox). |
[in] | x | Array of x coordinate values. |
[in] | y | Array of y coordinate values. |
[in] | z | Array of field values to be fit at each (x,y) point. |
[in] | w | Array of weights for each point in the fit. For points with Gaussian noise, w = 1/sigma. |
[in] | ctrl | Specifies the orders and triangularity of the coefficient matrix. |
Definition at line 182 of file ChebyshevBoundedField.cc.
|
static |
Fit a Chebyshev approximation to gridded data with equal weights.
[in] | image | The Image containing the data to fit. image.getBBox(PARENT) is used as the bounding box of the BoundedField. |
[in] | ctrl | Specifies the orders and triangularity of the coefficient matrix. |
Instantiated for float and double.
Definition at line 210 of file ChebyshevBoundedField.cc.
|
inline |
Return the coefficient matrix.
The coefficients are ordered [y,x], so the shape is (orderY+1, orderX+1).
Definition at line 162 of file ChebyshevBoundedField.h.
|
protectedvirtual |
Return the unique name used to persist this object and look up its factory.
Must be less than ArchiveIndexSchema::MAX_NAME_LENGTH characters.
Reimplemented from lsst::afw::table::io::Persistable.
Definition at line 379 of file ChebyshevBoundedField.cc.
|
protectedvirtual |
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 from lsst::afw::table::io::Persistable.
Definition at line 383 of file ChebyshevBoundedField.cc.
|
inlinevirtual |
ChebyshevBoundedField is always persistable.
Reimplemented from lsst::afw::table::io::Persistable.
Definition at line 181 of file ChebyshevBoundedField.h.
|
virtual |
Return a scaled BoundedField
[in] | scale | Scaling factor |
Implements lsst::afw::math::BoundedField.
Definition at line 398 of file ChebyshevBoundedField.cc.
boost::shared_ptr< ChebyshevBoundedField > lsst::afw::math::ChebyshevBoundedField::relocate | ( | geom::Box2I const & | bbox | ) | const |
Return a new ChebyshevBoundedField with domain set to the given bounding box.
Because this leaves the coefficients unchanged, it is equivalent to transforming the function by the affine transform that maps the old box to the new one.
Definition at line 261 of file ChebyshevBoundedField.cc.
boost::shared_ptr< ChebyshevBoundedField > lsst::afw::math::ChebyshevBoundedField::truncate | ( | Control const & | ctrl | ) | const |
Return a new ChebyshevBoudedField with maximum orders set by the given control object.
Definition at line 234 of file ChebyshevBoundedField.cc.
|
protectedvirtual |
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 from lsst::afw::table::io::Persistable.
Definition at line 387 of file ChebyshevBoundedField.cc.
|
private |
Definition at line 201 of file ChebyshevBoundedField.h.
|
private |
Definition at line 200 of file ChebyshevBoundedField.h.