LSSTApplications  18.1.0
LSSTDataManagementBasePackage
Namespaces | Classes | Typedefs | Enumerations | Functions | Variables
lsst::shapelet Namespace Reference

Namespaces

 constants
 
 generator
 
 multiShapeletFunction
 
 radialProfile
 
 shapeletFunction
 
 tests
 
 tractor
 
 version
 

Classes

class  BasisEvaluator
 Evaluates a standard shapelet Basis. More...
 
class  ConversionMatrix
 Conversions between shapelet basis types. More...
 
class  GaussHermiteConvolution
 A parametrized matrix that performs a convolution in shapelet space. More...
 
class  GaussHermiteEvaluator
 A class to evaluate HERMITE shapelet-related quantities. More...
 
class  GaussHermiteProjection
 
class  HermiteTransformMatrix
 A class that computes a matrix that applies a linear transform to a 2-d Hermite polynomial expansion. More...
 
class  MatrixBuilder
 Class that evaluates a (multi-)shapelet basis at predefined points. More...
 
class  MatrixBuilderFactory
 A factory class for MatrixBuilder, providing more control over workspace memory. More...
 
class  MatrixBuilderWorkspace
 Reusable, shareable workspace for MatrixBuilder. More...
 
class  MultiShapeletBasis
 A basis formed from a linear combination of shapelet bases that differ only in radius. More...
 
class  MultiShapeletBasisComponent
 Simple struct that represents one shapelet expansion in a MultiShapeletBasis. More...
 
class  MultiShapeletFunction
 A multi-scale shapelet function. More...
 
class  MultiShapeletFunctionEvaluator
 Evaluates a MultiShapeletFunction. More...
 
class  MultiShapeletFunctionKey
 Class that maps MultiShapeletFunction objects to fields in afw::table objects. More...
 
class  PackedIndex
 An iterator-like object to help in traversing "packed" shapelet or Hermite polynomial matrix or vector dimensions. More...
 
class  RadialProfile
 Registry and utility class for multi-Gaussian approximations to radial profiles. More...
 
class  ShapeletFunction
 A 2-d function defined by an expansion onto a Gauss-Laguerre or Gauss-Hermite basis. More...
 
class  ShapeletFunctionEvaluator
 Evaluates a ShapeletFunction. More...
 
class  ShapeletFunctionKey
 Class that maps ShapeletFunction objects to fields in afw::table objects. More...
 

Typedefs

typedef afw::geom::ellipses::Quadrupole EllipseCore
 
typedef ndarray::Array< double, 1 > Array1d
 Typedef for a commonly-used array type. More...
 

Enumerations

enum  BasisTypeEnum { HERMITE, LAGUERRE }
 An enum that sets whether to use real-valued polar shapelets or Cartesian shapelets. More...
 

Functions

int computeOffset (int order)
 Return the offset of the given order in a coefficient vector. More...
 
int computeSize (int order)
 Return the size of the coefficient vector for the given order. More...
 
int computeOrder (int size)
 Infer the order of a shapelet expansion from the number of coefficients. More...
 
double intSqrt (int n)
 Compute the square root of an integer number. More...
 
double rationalSqrt (int n, int d)
 Compute the square root of a rational number i.e. sqrt(n/d) More...
 
 PYBIND11_MODULE (basisEvaluator, mod)
 
 PYBIND11_MODULE (constants, mod)
 
 PYBIND11_MODULE (functorKeys, mod)
 
 PYBIND11_MODULE (gaussHermiteConvolution, mod)
 
 PYBIND11_MODULE (gaussHermiteProjection, mod)
 
 PYBIND11_MODULE (hermiteTransformMatrix, mod)
 
 PYBIND11_MODULE (matrixBuilder, mod)
 
 PYBIND11_MODULE (multiShapeletBasis, mod)
 
 PYBIND11_MODULE (multiShapeletFunction, mod)
 
 PYBIND11_MODULE (radialProfile, mod)
 
 PYBIND11_MODULE (shapeletFunction, mod)
 

Variables

double const BASIS_NORMALIZATION
 Normalization factor for 1-d orthonormal shapelets: pi^(-1/4) More...
 

Typedef Documentation

◆ Array1d

typedef ndarray::Array<double,1> lsst::shapelet::Array1d

Typedef for a commonly-used array type.

Note
Serves as a workaround for ambiguities in the C++ standard itself: http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#325

Definition at line 121 of file constants.h.

◆ EllipseCore

Definition at line 44 of file constants.h.

Enumeration Type Documentation

◆ BasisTypeEnum

An enum that sets whether to use real-valued polar shapelets or Cartesian shapelets.

The conversion between the two bases is theoretically exact, but of course subject to round-off error here.

Enumerator
HERMITE 

Cartesian shapelets or Gauss-Hermite functions, as defined in Refregier, 2003.

That is, \( \psi(x, y)_{n_x, n_y} = \frac{H_{n_x}(x) H_{n_y}(y) e^{-\frac{x^2 + y^2}{2}}} {\sigma 2^{n_x + n_y} \sqrt{\pi n_x! n_y!}} \) where \(H_n(x)\) is a Hermite polynomial.

The ordering of coefficients [n_x, n_y] is (row-major packed): [0,0], [0,1], [1,0], [0,2], [1,1], [2,0], [0,3], [1,2], [2,1], [3,0], [0,4], [1,3], [2,2], [3,1], [4,0] etc.

LAGUERRE 

Polar shapelets or Gauss-Laguerre functions, as defined in Bernstein and Jarvis, 2002.

That is, \( \psi(x, y, \sigma)_{p, q} = (-1)^q \sqrt{\frac{q!}{p!}} (x + i y)^{p-q} e^{-\frac{x^2 + y^2}{2}} L^{(p-q)}_q(x^2 + y^2) \) where \(L^{(m)}_n(r)\) is an associated Laguerre polynomial.

The ordering of coefficients [p, q] is (row-major packed): [0,0], Re([1,0]), Im([1,0]), Re([2,0]), Im([2,0]), [1,1], Re([3,0]), Im([3,0], Re([2,1]), Im([2,1]), Re([4,0]), Im([4,0], Re([3,1]), Im([3,1]), [2,2] etc.

Elements with p < q are redundant in representing real-valued functions, while those with p == q are inherently real.

Definition at line 52 of file constants.h.

52  {
53  HERMITE,
71  LAGUERRE,
91 };
Polar shapelets or Gauss-Laguerre functions, as defined in Bernstein and Jarvis, 2002.
Definition: constants.h:71
Cartesian shapelets or Gauss-Hermite functions, as defined in Refregier, 2003.
Definition: constants.h:53

Function Documentation

◆ computeOffset()

int lsst::shapelet::computeOffset ( int  order)
inline

Return the offset of the given order in a coefficient vector.

Definition at line 94 of file constants.h.

94 { return order * (order + 1) / 2; }

◆ computeOrder()

int lsst::shapelet::computeOrder ( int  size)
inline

Infer the order of a shapelet expansion from the number of coefficients.

Exceptions
InvalidParameterErrorif the number of coefficients does not correspond to any shapelet order.

Definition at line 104 of file constants.h.

104  {
105  int order = (std::sqrt(8*size + 1) - 3)/2;
106  if (computeSize(order) != size) {
107  throw LSST_EXCEPT(
108  pex::exceptions::InvalidParameterError,
109  "Invalid size for shapelet coefficient matrix"
110  );
111  }
112  return order;
113 }
int computeSize(int order)
Return the size of the coefficient vector for the given order.
Definition: constants.h:97
#define LSST_EXCEPT(type,...)
Create an exception with a given type.
Definition: Exception.h:48
T sqrt(T... args)

◆ computeSize()

int lsst::shapelet::computeSize ( int  order)
inline

Return the size of the coefficient vector for the given order.

Definition at line 97 of file constants.h.

97 { return computeOffset(order + 1); }
int computeOffset(int order)
Return the offset of the given order in a coefficient vector.
Definition: constants.h:94

◆ intSqrt()

double lsst::shapelet::intSqrt ( int  n)
inline

Compute the square root of an integer number.

Definition at line 124 of file constants.h.

124  {
125  return std::sqrt(double(n));
126 }
T sqrt(T... args)

◆ PYBIND11_MODULE() [1/11]

lsst::shapelet::PYBIND11_MODULE ( constants  ,
mod   
)

Definition at line 32 of file constants.cc.

32  {
33  py::enum_<BasisTypeEnum>(mod, "BasisTypeEnum")
34  .value("HERMITE", BasisTypeEnum::HERMITE)
35  .value("LAGUERRE", BasisTypeEnum::LAGUERRE)
36  .export_values();
37 
38  mod.def("computeOffset", computeOffset);
39  mod.def("computeSize", computeSize);
40  mod.def("computeOrder", computeOrder);
41  mod.def("intSqrt", intSqrt);
42  mod.def("rationalSqrt", rationalSqrt);
43 }
int computeSize(int order)
Return the size of the coefficient vector for the given order.
Definition: constants.h:97
Polar shapelets or Gauss-Laguerre functions, as defined in Bernstein and Jarvis, 2002.
Definition: constants.h:71
int computeOrder(int size)
Infer the order of a shapelet expansion from the number of coefficients.
Definition: constants.h:104
Cartesian shapelets or Gauss-Hermite functions, as defined in Refregier, 2003.
Definition: constants.h:53
double intSqrt(int n)
Compute the square root of an integer number.
Definition: constants.h:124
int computeOffset(int order)
Return the offset of the given order in a coefficient vector.
Definition: constants.h:94
double rationalSqrt(int n, int d)
Compute the square root of a rational number i.e. sqrt(n/d)
Definition: constants.h:129

◆ PYBIND11_MODULE() [2/11]

lsst::shapelet::PYBIND11_MODULE ( radialProfile  ,
mod   
)

Definition at line 34 of file radialProfile.cc.

34  {
35  py::class_<RadialProfile, std::shared_ptr<RadialProfile>> clsRadialProfile(mod, "RadialProfile");
36 
37  clsRadialProfile.def_static("get", &RadialProfile::get, py::return_value_policy::reference);
38  clsRadialProfile.def("getName", &RadialProfile::getName);
39  clsRadialProfile.def("_evaluate", (double (RadialProfile::*)(double) const) & RadialProfile::evaluate);
40  clsRadialProfile.def("_evaluate", (ndarray::Array<double, 1, 1> (RadialProfile::*)(
41  ndarray::Array<double const, 1, 1> const &) const) &
42  RadialProfile::evaluate);
43  clsRadialProfile.def("getMomentsRadiusFactor", &RadialProfile::getMomentsRadiusFactor);
44  clsRadialProfile.def("getBasis", &RadialProfile::getBasis, "nComponents"_a, "maxRadius"_a = 0);
45  clsRadialProfile.def("registerBasis", &RadialProfile::registerBasis);
46 }

◆ PYBIND11_MODULE() [3/11]

lsst::shapelet::PYBIND11_MODULE ( hermiteTransformMatrix  ,
mod   
)

Definition at line 34 of file hermiteTransformMatrix.cc.

34  {
35  py::module::import("lsst.afw.geom");
36 
37  py::class_<HermiteTransformMatrix, std::shared_ptr<HermiteTransformMatrix>> clsHermiteTransformMatrix(
38  mod, "HermiteTransformMatrix");
39 
40  clsHermiteTransformMatrix.def(py::init<int>(), "order"_a);
41 
42  clsHermiteTransformMatrix.def(
43  "compute", (Eigen::MatrixXd (HermiteTransformMatrix::*)(Eigen::Matrix2d const &) const) &
44  HermiteTransformMatrix::compute,
45  "transform"_a);
46  clsHermiteTransformMatrix.def(
47  "compute",
48  (Eigen::MatrixXd (HermiteTransformMatrix::*)(afw::geom::LinearTransform const &) const) &
49  HermiteTransformMatrix::compute,
50  "transform"_a);
51  clsHermiteTransformMatrix.def(
52  "compute", (Eigen::MatrixXd (HermiteTransformMatrix::*)(Eigen::Matrix2d const &, int) const) &
53  HermiteTransformMatrix::compute,
54  "transform"_a, "order"_a);
55  clsHermiteTransformMatrix.def("compute", (Eigen::MatrixXd (HermiteTransformMatrix::*)(
56  afw::geom::LinearTransform const &, int) const) &
57  HermiteTransformMatrix::compute,
58  "transform"_a, "order"_a);
59 
60  clsHermiteTransformMatrix.def("getCoefficientMatrix", &HermiteTransformMatrix::getCoefficientMatrix);
61  clsHermiteTransformMatrix.def("getInverseCoefficientMatrix",
62  &HermiteTransformMatrix::getInverseCoefficientMatrix);
63  clsHermiteTransformMatrix.def("getOrder", &HermiteTransformMatrix::getOrder);
64 }

◆ PYBIND11_MODULE() [4/11]

lsst::shapelet::PYBIND11_MODULE ( functorKeys  ,
mod   
)

Definition at line 34 of file functorKeys.cc.

34  {
35  py::module::import("lsst.afw.table");
36 
37  py::class_<ShapeletFunctionKey, std::shared_ptr<ShapeletFunctionKey>> clsShapeletFunctionKey(
38  mod, "ShapeletFunctionKey");
39 
40  clsShapeletFunctionKey.def(py::init<>());
41  clsShapeletFunctionKey.def(
42  py::init<afw::table::EllipseKey const &, afw::table::ArrayKey<double> const &, BasisTypeEnum>(),
43  "ellipse"_a, "coefficients"_a, "basisType"_a = HERMITE);
44  clsShapeletFunctionKey.def(py::init<afw::table::SubSchema const &, BasisTypeEnum>(), "s"_a,
45  "basisType"_a = HERMITE);
46 
47  clsShapeletFunctionKey.def("__eq__", &ShapeletFunctionKey::operator==, py::is_operator());
48  clsShapeletFunctionKey.def("__ne__", &ShapeletFunctionKey::operator!=, py::is_operator());
49 
50  clsShapeletFunctionKey.def_static("addFields", &ShapeletFunctionKey::addFields, "schema"_a, "name"_a,
51  "doc"_a, "ellipseUnit"_a, "coeffUnit"_a, "order"_a,
52  "basisType"_a = HERMITE);
53 
54  clsShapeletFunctionKey.def("get", &ShapeletFunctionKey::get);
55  clsShapeletFunctionKey.def("set", &ShapeletFunctionKey::set);
56  clsShapeletFunctionKey.def("isValid", &ShapeletFunctionKey::isValid);
57  clsShapeletFunctionKey.def("getEllipse", &ShapeletFunctionKey::getEllipse);
58  clsShapeletFunctionKey.def("getCoefficients", &ShapeletFunctionKey::getCoefficients);
59  clsShapeletFunctionKey.def("getOrder", &ShapeletFunctionKey::getOrder);
60  clsShapeletFunctionKey.def("getBasisType", &ShapeletFunctionKey::getBasisType);
61 
62  py::class_<MultiShapeletFunctionKey, std::shared_ptr<MultiShapeletFunctionKey>>
63  clsMultiShapeletFunctionKey(mod, "MultiShapeletFunctionKey");
64 
65  clsMultiShapeletFunctionKey.def(py::init<>());
66  clsMultiShapeletFunctionKey.def(py::init<afw::table::SubSchema const &, BasisTypeEnum>(), "s"_a,
67  "basisType"_a = HERMITE);
68  clsMultiShapeletFunctionKey.def(py::init<std::vector<PTR(ShapeletFunctionKey)> const &>(),
69  "components"_a);
70 
71  clsMultiShapeletFunctionKey.def_static("addFields", MultiShapeletFunctionKey::addFields, "schema"_a,
72  "name"_a, "doc"_a, "ellipseUnit"_a, "coeffUnit"_a, "orders"_a,
73  "basisType"_a = HERMITE);
74 
75  clsMultiShapeletFunctionKey.def("__eq__", &MultiShapeletFunctionKey::operator==, py::is_operator());
76  clsMultiShapeletFunctionKey.def("__ne__", &MultiShapeletFunctionKey::operator!=, py::is_operator());
77  clsMultiShapeletFunctionKey.def("__getitem__",
78  [](MultiShapeletFunctionKey &self, int i) { return self[i]; });
79 
80  clsMultiShapeletFunctionKey.def("get", &MultiShapeletFunctionKey::get);
81  clsMultiShapeletFunctionKey.def("set", &MultiShapeletFunctionKey::set);
82  clsMultiShapeletFunctionKey.def("isValid", &MultiShapeletFunctionKey::isValid);
83 }
#define PTR(...)
Definition: base.h:41
def init()
Definition: tests.py:75
daf::base::PropertySet * set
Definition: fits.cc:884
bool isValid
Definition: fits.cc:380
Cartesian shapelets or Gauss-Hermite functions, as defined in Refregier, 2003.
Definition: constants.h:53
BasisTypeEnum
An enum that sets whether to use real-valued polar shapelets or Cartesian shapelets.
Definition: constants.h:52
STL class.

◆ PYBIND11_MODULE() [5/11]

lsst::shapelet::PYBIND11_MODULE ( gaussHermiteProjection  ,
mod   
)

Definition at line 34 of file gaussHermiteProjection.cc.

34  {
35  py::module::import("lsst.afw.geom");
36  py::class_<GaussHermiteProjection, std::shared_ptr<GaussHermiteProjection>> clsGaussHermiteProjection(
37  mod, "GaussHermiteProjection");
38 
39  clsGaussHermiteProjection.def(py::init<int>(), "maxOrder"_a);
40 
41  clsGaussHermiteProjection.def("compute",
42  (Eigen::MatrixXd (GaussHermiteProjection::*)(
43  afw::geom::ellipses::Quadrupole const &, int inputOrder,
44  afw::geom::ellipses::Quadrupole const &, int outputOrder) const) &
45  GaussHermiteProjection::compute);
46  clsGaussHermiteProjection.def("compute",
47  (Eigen::MatrixXd (GaussHermiteProjection::*)(
48  afw::geom::LinearTransform const &, int inputOrder,
49  afw::geom::LinearTransform const &, int outputOrder) const) &
50  GaussHermiteProjection::compute);
51  clsGaussHermiteProjection.def(
52  "compute", (Eigen::MatrixXd (GaussHermiteProjection::*)(Eigen::Matrix2d const &, int,
53  Eigen::Matrix2d const &, int) const) &
54  GaussHermiteProjection::compute);
55 
56  clsGaussHermiteProjection.def("getMaxOrder", &GaussHermiteProjection::getMaxOrder);
57 }

◆ PYBIND11_MODULE() [6/11]

lsst::shapelet::PYBIND11_MODULE ( multiShapeletBasis  ,
mod   
)

Definition at line 34 of file multiShapeletBasis.cc.

34  {
35  py::class_<MultiShapeletBasisComponent, std::shared_ptr<MultiShapeletBasisComponent>>
36  clsMultiShapeletBasisComponent(mod, "MultiShapeletBasisComponent");
37 
38  clsMultiShapeletBasisComponent.def(py::init<double, int, ndarray::Array<double const, 2, 2> const &>(),
39  "radius"_a, "order"_a, "matrix"_a);
40 
41  clsMultiShapeletBasisComponent.def("getRadius", &MultiShapeletBasisComponent::getRadius);
42  clsMultiShapeletBasisComponent.def("getOrder", &MultiShapeletBasisComponent::getOrder);
43  clsMultiShapeletBasisComponent.def("getMatrix", &MultiShapeletBasisComponent::getMatrix);
44 
45  py::class_<MultiShapeletBasis, std::shared_ptr<MultiShapeletBasis>> clsMultiShapeletBasis(
46  mod, "MultiShapeletBasis");
47 
48  clsMultiShapeletBasis.attr("Component") = clsMultiShapeletBasisComponent;
49 
50  clsMultiShapeletBasis.def(py::init<int>());
51  clsMultiShapeletBasis.def(py::init<MultiShapeletBasis const &>());
52 
53  clsMultiShapeletBasis.def("getSize", &MultiShapeletBasis::getSize);
54  clsMultiShapeletBasis.def("getComponentCount", &MultiShapeletBasis::getComponentCount);
55  clsMultiShapeletBasis.def("addComponent", &MultiShapeletBasis::addComponent);
56  clsMultiShapeletBasis.def("scale", &MultiShapeletBasis::scale);
57  clsMultiShapeletBasis.def("normalize", &MultiShapeletBasis::normalize);
58  clsMultiShapeletBasis.def("merge", &MultiShapeletBasis::merge);
59  clsMultiShapeletBasis.def("makeFunction", &MultiShapeletBasis::makeFunction);
60 }
def init()
Definition: tests.py:75
def scale(algorithm, min, max=None, frame=None)
Definition: ds9.py:109

◆ PYBIND11_MODULE() [7/11]

lsst::shapelet::PYBIND11_MODULE ( shapeletFunction  ,
mod   
)

Definition at line 34 of file shapeletFunction.cc.

34  {
35  py::module::import("lsst.afw.geom");
36  py::module::import("lsst.afw.image");
37 
38  py::class_<ShapeletFunction, std::shared_ptr<ShapeletFunction>> clsShapeletFunction(mod,
39  "ShapeletFunction");
40 
41  clsShapeletFunction.def_readonly_static("FLUX_FACTOR", &ShapeletFunction::FLUX_FACTOR);
42 
43  clsShapeletFunction.def(py::init<int, BasisTypeEnum>(), "order"_a, "basisType"_a);
44  clsShapeletFunction.def(py::init<int, BasisTypeEnum, ndarray::Array<double, 1, 1> const &>(), "order"_a,
45  "basisType"_a, "coefficients"_a);
46  clsShapeletFunction.def(py::init<int, BasisTypeEnum, double, afw::geom::Point2D const &>(), "order"_a,
47  "basisType"_a, "radius"_a, "center"_a = afw::geom::Point2D());
48  clsShapeletFunction.def(py::init<int, BasisTypeEnum, double, afw::geom::Point2D const &,
49  ndarray::Array<double, 1, 1> const &>(),
50  "order"_a, "basisType"_a, "radius"_a, "center"_a, "coefficients"_a);
51  clsShapeletFunction.def(py::init<int, BasisTypeEnum, afw::geom::ellipses::Ellipse const &>(), "order"_a,
52  "basisType"_a, "ellipse"_a);
53  clsShapeletFunction.def(py::init<int, BasisTypeEnum, afw::geom::ellipses::Ellipse const &,
54  ndarray::Array<double const, 1, 1> const &>(),
55  "order"_a, "basisType"_a, "ellipse"_a, "coefficients"_a);
56  clsShapeletFunction.def(py::init<ShapeletFunction>());
57 
58  clsShapeletFunction.def("getOrder", &ShapeletFunction::getOrder);
59  clsShapeletFunction.def("getEllipse", (afw::geom::ellipses::Ellipse & (ShapeletFunction::*)()) &
61  py::return_value_policy::reference_internal);
62  clsShapeletFunction.def("setEllipse", &ShapeletFunction::setEllipse);
63  clsShapeletFunction.def("getBasisType", &ShapeletFunction::getBasisType);
64  clsShapeletFunction.def("changeBasisType", &ShapeletFunction::changeBasisType);
65  clsShapeletFunction.def("normalize", &ShapeletFunction::normalize, "value"_a = 1.0);
66  clsShapeletFunction.def("getCoefficients", (ndarray::Array<double, 1, 1> const (ShapeletFunction::*)()) &
67  ShapeletFunction::getCoefficients);
68  clsShapeletFunction.def("convolve", &ShapeletFunction::convolve);
69  clsShapeletFunction.def("evaluate", &ShapeletFunction::evaluate);
70  clsShapeletFunction.def("shiftInPlace", &ShapeletFunction::shiftInPlace);
71  clsShapeletFunction.def("transformInPlace", &ShapeletFunction::transformInPlace);
72 
73  py::class_<ShapeletFunctionEvaluator, std::shared_ptr<ShapeletFunctionEvaluator>>
74  clsShapeletFunctionEvaluator(mod, "ShapeletFunctionEvaluator");
75 
76  clsShapeletFunctionEvaluator.def(py::init<ShapeletFunction const &>(), "function"_a);
77 
78  clsShapeletFunctionEvaluator.def("__call__",
79  (double (ShapeletFunctionEvaluator::*)(double, double) const) &
80  ShapeletFunctionEvaluator::operator());
81  clsShapeletFunctionEvaluator.def(
82  "__call__", (double (ShapeletFunctionEvaluator::*)(afw::geom::Point2D const &) const) &
83  ShapeletFunctionEvaluator::operator());
84  clsShapeletFunctionEvaluator.def(
85  "__call__", (double (ShapeletFunctionEvaluator::*)(afw::geom::Extent2D const &) const) &
86  ShapeletFunctionEvaluator::operator());
87  clsShapeletFunctionEvaluator.def("__call__", (ndarray::Array<double, 1, 1> (ShapeletFunctionEvaluator::*)(
88  ndarray::Array<double const, 1> const &,
89  ndarray::Array<double const, 1> const &) const) &
90  ShapeletFunctionEvaluator::operator());
91 
92  clsShapeletFunctionEvaluator.def(
93  "addToImage", (void (ShapeletFunctionEvaluator::*)(ndarray::Array<double, 2, 1> const &,
94  afw::geom::Point2I const &) const) &
96  "array"_a, "xy0"_a = afw::geom::Point2D());
97  clsShapeletFunctionEvaluator.def(
98  "addToImage", (void (ShapeletFunctionEvaluator::*)(afw::image::Image<double> &) const) &
99  ShapeletFunctionEvaluator::addToImage,
100  "image"_a);
101  clsShapeletFunctionEvaluator.def("integrate", &ShapeletFunctionEvaluator::integrate);
102  clsShapeletFunctionEvaluator.def("computeMoments", &ShapeletFunctionEvaluator::computeMoments);
103  clsShapeletFunctionEvaluator.def("update", &ShapeletFunctionEvaluator::update);
104 }
def init()
Definition: tests.py:75
Point< double, 2 > Point2D
Definition: Point.h:324
BasisTypeEnum
An enum that sets whether to use real-valued polar shapelets or Cartesian shapelets.
Definition: constants.h:52
void convolve(OutImageT &convolvedImage, InImageT const &inImage, KernelT const &kernel, ConvolutionControl const &convolutionControl=ConvolutionControl())
Convolve an Image or MaskedImage with a Kernel, setting pixels of an existing output image...
Point< int, 2 > Point2I
Definition: Point.h:321
void addToImage(boost::shared_ptr< afw::image::Image< double > > image, std::vector< boost::shared_ptr< afw::image::Image< double > >> const &imgVector, std::vector< double > const &weightVector)
Definition: CoaddPsf.cc:192
Extent< double, 2 > Extent2D
Definition: Extent.h:400
UnaryFunctionT::result_type integrate(UnaryFunctionT func, typename UnaryFunctionT::argument_type const a, typename UnaryFunctionT::argument_type const b, double eps=1.0e-6)
The 1D integrator.
Definition: Integrate.h:886

◆ PYBIND11_MODULE() [8/11]

lsst::shapelet::PYBIND11_MODULE ( basisEvaluator  ,
mod   
)

Definition at line 34 of file basisEvaluator.cc.

34  {
35  py::module::import("lsst.afw.geom");
36 
37  py::class_<BasisEvaluator, std::shared_ptr<BasisEvaluator>> clsBasisEvaluator(mod, "BasisEvaluator");
38 
39  /* Constructors */
40  clsBasisEvaluator.def(py::init<int, BasisTypeEnum>(), "order"_a, "basisType"_a);
41 
42  /* Members */
43  clsBasisEvaluator.def("getOrder", &BasisEvaluator::getOrder);
44  clsBasisEvaluator.def("getBasisType", &BasisEvaluator::getBasisType);
45 
46  /* fillEvaluation has default constructed Array1d objects as keyword
47  * arguments.
48  * Unfortunately, for some reason array.isEmpty() == false even with 0
49  * elements,
50  * which leads to a segfault.
51  * Thus we must delegate through lambdas instead. */
52  clsBasisEvaluator.def("fillEvaluation", [](BasisEvaluator &self, Array1d const &array, double x,
53  double y) { return self.fillEvaluation(array, x, y); },
54  "array"_a, "x"_a, "y"_a);
55  clsBasisEvaluator.def(
56  "fillEvaluation",
57  [](BasisEvaluator &self, Array1d const &array, double x, double y, Array1d const &dx,
58  Array1d const &dy) { return self.fillEvaluation(array, x, y, dx, dy); },
59  "array"_a, "x"_a, "y"_a, "dx"_a, "dy"_a);
60  clsBasisEvaluator.def("fillEvaluation",
61  [](BasisEvaluator &self, Array1d const &array, afw::geom::Point2D const &point) {
62  return self.fillEvaluation(array, point);
63  },
64  "array"_a, "point"_a);
65  clsBasisEvaluator.def(
66  "fillEvaluation",
67  [](BasisEvaluator &self, Array1d const &array, afw::geom::Point2D const &point, Array1d const &dx,
68  Array1d const &dy) { return self.fillEvaluation(array, point, dx, dy); },
69  "array"_a, "point"_a, "dx"_a, "dy"_a);
70  clsBasisEvaluator.def("fillEvaluation",
71  [](BasisEvaluator &self, Array1d const &array, afw::geom::Extent2D const &extent) {
72  return self.fillEvaluation(array, extent);
73  },
74  "array"_a, "extent"_a);
75  clsBasisEvaluator.def(
76  "fillEvaluation",
77  [](BasisEvaluator &self, Array1d const &array, afw::geom::Extent2D const &extent,
78  Array1d const &dx, Array1d const &dy) { return self.fillEvaluation(array, extent, dx, dy); },
79  "array"_a, "extent"_a, "dx"_a, "dy"_a);
80  clsBasisEvaluator.def("fillIntegration", &BasisEvaluator::fillIntegration, "array"_a, "xMoment"_a = 0,
81  "yMoment"_a = 0);
82 }
ndarray::Array< double, 1 > Array1d
Typedef for a commonly-used array type.
Definition: constants.h:121
int y
Definition: SpanSet.cc:49
Point< double, 2 > Point2D
Definition: Point.h:324
double x
Extent< double, 2 > Extent2D
Definition: Extent.h:400

◆ PYBIND11_MODULE() [9/11]

lsst::shapelet::PYBIND11_MODULE ( gaussHermiteConvolution  ,
mod   
)

Definition at line 35 of file gaussHermiteConvolution.cc.

35  {
36  py::class_<GaussHermiteConvolution, std::shared_ptr<GaussHermiteConvolution>> clsGaussHermiteConvolution(
37  mod, "GaussHermiteConvolution");
38 
39  clsGaussHermiteConvolution.def(py::init<int, ShapeletFunction const &>(), "colOrder"_a, "psf"_a);
40 
41  clsGaussHermiteConvolution.def("computeRowOrder", &GaussHermiteConvolution::computeRowOrder);
42  clsGaussHermiteConvolution.def("evaluate", &GaussHermiteConvolution::evaluate);
43  clsGaussHermiteConvolution.def("getColOrder", &GaussHermiteConvolution::getColOrder);
44  clsGaussHermiteConvolution.def("getRowOrder", &GaussHermiteConvolution::getRowOrder);
45 }

◆ PYBIND11_MODULE() [10/11]

lsst::shapelet::PYBIND11_MODULE ( multiShapeletFunction  ,
mod   
)

Definition at line 94 of file multiShapeletFunction.cc.

94  {
95  py::module::import("lsst.afw.geom");
96  py::module::import("lsst.afw.image");
97 
98  py::class_<MultiShapeletFunction, std::shared_ptr<MultiShapeletFunction>> clsMultiShapeletFunction(
99  mod, "MultiShapeletFunction");
100  py::class_<MultiShapeletFunctionEvaluator, std::shared_ptr<MultiShapeletFunctionEvaluator>>
101  clsMultiShapeletFunctionEvaluator(mod, "MultiShapeletFunctionEvaluator");
102 
103  declareMultiShapeletFunctionMembers(clsMultiShapeletFunction);
104  declareMultiShapeletFunctionEvaluatorMembers(clsMultiShapeletFunctionEvaluator);
105 }

◆ PYBIND11_MODULE() [11/11]

lsst::shapelet::PYBIND11_MODULE ( matrixBuilder  ,
mod   
)

Definition at line 129 of file matrixBuilder.cc.

129  {
130  py::module::import("lsst.afw.geom");
131  declareMatrixBuilderTemplates<float>(mod, "F");
132  declareMatrixBuilderTemplates<double>(mod, "D");
133 }

◆ rationalSqrt()

double lsst::shapelet::rationalSqrt ( int  n,
int  d 
)
inline

Compute the square root of a rational number i.e. sqrt(n/d)

Definition at line 129 of file constants.h.

129  {
130  return std::sqrt(double(n) / double(d));
131 }
T sqrt(T... args)

Variable Documentation

◆ BASIS_NORMALIZATION

double const lsst::shapelet::BASIS_NORMALIZATION

Normalization factor for 1-d orthonormal shapelets: pi^(-1/4)