LSST Applications  21.0.0+04719a4bac,21.0.0-1-ga51b5d4+f5e6047307,21.0.0-11-g2b59f77+a9c1acf22d,21.0.0-11-ga42c5b2+86977b0b17,21.0.0-12-gf4ce030+76814010d2,21.0.0-13-g1721dae+760e7a6536,21.0.0-13-g3a573fe+768d78a30a,21.0.0-15-g5a7caf0+f21cbc5713,21.0.0-16-g0fb55c1+b60e2d390c,21.0.0-19-g4cded4ca+71a93a33c0,21.0.0-2-g103fe59+bb20972958,21.0.0-2-g45278ab+04719a4bac,21.0.0-2-g5242d73+3ad5d60fb1,21.0.0-2-g7f82c8f+8babb168e8,21.0.0-2-g8f08a60+06509c8b61,21.0.0-2-g8faa9b5+616205b9df,21.0.0-2-ga326454+8babb168e8,21.0.0-2-gde069b7+5e4aea9c2f,21.0.0-2-gecfae73+1d3a86e577,21.0.0-2-gfc62afb+3ad5d60fb1,21.0.0-25-g1d57be3cd+e73869a214,21.0.0-3-g357aad2+ed88757d29,21.0.0-3-g4a4ce7f+3ad5d60fb1,21.0.0-3-g4be5c26+3ad5d60fb1,21.0.0-3-g65f322c+e0b24896a3,21.0.0-3-g7d9da8d+616205b9df,21.0.0-3-ge02ed75+a9c1acf22d,21.0.0-4-g591bb35+a9c1acf22d,21.0.0-4-g65b4814+b60e2d390c,21.0.0-4-gccdca77+0de219a2bc,21.0.0-4-ge8a399c+6c55c39e83,21.0.0-5-gd00fb1e+05fce91b99,21.0.0-6-gc675373+3ad5d60fb1,21.0.0-64-g1122c245+4fb2b8f86e,21.0.0-7-g04766d7+cd19d05db2,21.0.0-7-gdf92d54+04719a4bac,21.0.0-8-g5674e7b+d1bd76f71f,master-gac4afde19b+a9c1acf22d,w.2021.13
LSST Data Management Base Package
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  ShapeletFunctionKey
 Class that maps ShapeletFunction objects to fields in afw::table objects. More...
 
class  MultiShapeletFunctionKey
 Class that maps MultiShapeletFunction objects to fields in afw::table objects. More...
 
class  GaussHermiteConvolution
 A parametrized matrix that performs a convolution in shapelet space. More...
 
class  PackedIndex
 An iterator-like object to help in traversing "packed" shapelet or Hermite polynomial matrix or vector dimensions. 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  MatrixBuilderFactory
 A factory class for MatrixBuilder, providing more control over workspace memory. More...
 
class  MatrixBuilderWorkspace
 Reusable, shareable workspace for MatrixBuilder. More...
 
class  MatrixBuilder
 Class that evaluates a (multi-)shapelet basis at predefined points. More...
 
class  MultiShapeletBasisComponent
 Simple struct that represents one shapelet expansion in a MultiShapeletBasis. More...
 
class  MultiShapeletBasis
 A basis formed from a linear combination of shapelet bases that differ only in radius. More...
 
class  MultiShapeletFunction
 A multi-scale shapelet function. More...
 
class  MultiShapeletFunctionEvaluator
 Evaluates a MultiShapeletFunction. 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...
 

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 };
@ HERMITE
Cartesian shapelets or Gauss-Hermite functions, as defined in Refregier, 2003.
Definition: constants.h:53
@ LAGUERRE
Polar shapelets or Gauss-Laguerre functions, as defined in Bernstein and Jarvis, 2002.
Definition: constants.h:71

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 }
#define LSST_EXCEPT(type,...)
Create an exception with a given type.
Definition: Exception.h:48
int computeSize(int order)
Return the size of the coefficient vector for the given order.
Definition: constants.h:97
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 }

◆ PYBIND11_MODULE() [1/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, 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, 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, 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, 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 }
double x
int y
Definition: SpanSet.cc:49
ndarray::Array< double, 1 > Array1d
Typedef for a commonly-used array type.
Definition: constants.h:121

◆ PYBIND11_MODULE() [2/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 computeOrder(int size)
Infer the order of a shapelet expansion from the number of coefficients.
Definition: constants.h:104
double intSqrt(int n)
Compute the square root of an integer number.
Definition: constants.h:124
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() [3/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
daf::base::PropertySet * set
Definition: fits.cc:912
bool isValid
Definition: fits.cc:399
BasisTypeEnum
An enum that sets whether to use real-valued polar shapelets or Cartesian shapelets.
Definition: constants.h:52
def init()
Definition: tests.py:59

◆ PYBIND11_MODULE() [4/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() [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  geom::LinearTransform const &, int inputOrder,
49  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 }
A 2D linear coordinate transformation.

◆ PYBIND11_MODULE() [6/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::*)(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  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() [7/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 }

◆ PYBIND11_MODULE() [8/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 scale(algorithm, min, max=None, frame=None)
Definition: ds9.py:108

◆ PYBIND11_MODULE() [9/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() [10/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 }
std::string const & getName() const noexcept
Return a filter's name.
Definition: Filter.h:78

◆ PYBIND11_MODULE() [11/11]

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

Definition at line 34 of file shapeletFunction.cc.

34  {
35  py::module::import("lsst.geom");
36  py::module::import("lsst.afw.geom");
37  py::module::import("lsst.afw.image");
38 
39  py::class_<ShapeletFunction, std::shared_ptr<ShapeletFunction>> clsShapeletFunction(mod,
40  "ShapeletFunction");
41 
42  clsShapeletFunction.def_readonly_static("FLUX_FACTOR", &ShapeletFunction::FLUX_FACTOR);
43 
44  clsShapeletFunction.def(py::init<int, BasisTypeEnum>(), "order"_a, "basisType"_a);
45  clsShapeletFunction.def(py::init<int, BasisTypeEnum, ndarray::Array<double, 1, 1> const &>(), "order"_a,
46  "basisType"_a, "coefficients"_a);
47  clsShapeletFunction.def(py::init<int, BasisTypeEnum, double, geom::Point2D const &>(), "order"_a,
48  "basisType"_a, "radius"_a, "center"_a = geom::Point2D());
49  clsShapeletFunction.def(py::init<int, BasisTypeEnum, double, geom::Point2D const &,
50  ndarray::Array<double, 1, 1> const &>(),
51  "order"_a, "basisType"_a, "radius"_a, "center"_a, "coefficients"_a);
52  clsShapeletFunction.def(py::init<int, BasisTypeEnum, afw::geom::ellipses::Ellipse const &>(), "order"_a,
53  "basisType"_a, "ellipse"_a);
54  clsShapeletFunction.def(py::init<int, BasisTypeEnum, afw::geom::ellipses::Ellipse const &,
55  ndarray::Array<double const, 1, 1> const &>(),
56  "order"_a, "basisType"_a, "ellipse"_a, "coefficients"_a);
57  clsShapeletFunction.def(py::init<ShapeletFunction>());
58 
59  clsShapeletFunction.def("getOrder", &ShapeletFunction::getOrder);
60  clsShapeletFunction.def("getEllipse", (afw::geom::ellipses::Ellipse & (ShapeletFunction::*)()) &
61  ShapeletFunction::getEllipse,
62  py::return_value_policy::reference_internal);
63  clsShapeletFunction.def("setEllipse", &ShapeletFunction::setEllipse);
64  clsShapeletFunction.def("getBasisType", &ShapeletFunction::getBasisType);
65  clsShapeletFunction.def("changeBasisType", &ShapeletFunction::changeBasisType);
66  clsShapeletFunction.def("normalize", &ShapeletFunction::normalize, "value"_a = 1.0);
67  clsShapeletFunction.def("getCoefficients", (ndarray::Array<double, 1, 1> const (ShapeletFunction::*)()) &
68  ShapeletFunction::getCoefficients);
69  clsShapeletFunction.def("convolve", &ShapeletFunction::convolve);
70  clsShapeletFunction.def("evaluate", &ShapeletFunction::evaluate);
71  clsShapeletFunction.def("shiftInPlace", &ShapeletFunction::shiftInPlace);
72  clsShapeletFunction.def("transformInPlace", &ShapeletFunction::transformInPlace);
73 
74  py::class_<ShapeletFunctionEvaluator, std::shared_ptr<ShapeletFunctionEvaluator>>
75  clsShapeletFunctionEvaluator(mod, "ShapeletFunctionEvaluator");
76 
77  clsShapeletFunctionEvaluator.def(py::init<ShapeletFunction const &>(), "function"_a);
78 
79  clsShapeletFunctionEvaluator.def("__call__",
80  (double (ShapeletFunctionEvaluator::*)(double, double) const) &
81  ShapeletFunctionEvaluator::operator());
82  clsShapeletFunctionEvaluator.def(
83  "__call__", (double (ShapeletFunctionEvaluator::*)(geom::Point2D const &) const) &
84  ShapeletFunctionEvaluator::operator());
85  clsShapeletFunctionEvaluator.def(
86  "__call__", (double (ShapeletFunctionEvaluator::*)(geom::Extent2D const &) const) &
87  ShapeletFunctionEvaluator::operator());
88  clsShapeletFunctionEvaluator.def("__call__", (ndarray::Array<double, 1, 1> (ShapeletFunctionEvaluator::*)(
89  ndarray::Array<double const, 1> const &,
90  ndarray::Array<double const, 1> const &) const) &
91  ShapeletFunctionEvaluator::operator());
92 
93  clsShapeletFunctionEvaluator.def(
94  "addToImage", (void (ShapeletFunctionEvaluator::*)(ndarray::Array<double, 2, 1> const &,
95  geom::Point2I const &) const) &
97  "array"_a, "xy0"_a = geom::Point2D());
98  clsShapeletFunctionEvaluator.def(
99  "addToImage", (void (ShapeletFunctionEvaluator::*)(afw::image::Image<double> &) const) &
101  "image"_a);
102  clsShapeletFunctionEvaluator.def("integrate", &ShapeletFunctionEvaluator::integrate);
103  clsShapeletFunctionEvaluator.def("computeMoments", &ShapeletFunctionEvaluator::computeMoments);
104  clsShapeletFunctionEvaluator.def("update", &ShapeletFunctionEvaluator::update);
105 }
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
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.
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

◆ 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 }

Variable Documentation

◆ BASIS_NORMALIZATION

double const lsst::shapelet::BASIS_NORMALIZATION
extern

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