LSST Applications g0b6bd0c080+a72a5dd7e6,g1182afd7b4+2a019aa3bb,g17e5ecfddb+2b8207f7de,g1d67935e3f+06cf436103,g38293774b4+ac198e9f13,g396055baef+6a2097e274,g3b44f30a73+6611e0205b,g480783c3b1+98f8679e14,g48ccf36440+89c08d0516,g4b93dc025c+98f8679e14,g5c4744a4d9+a302e8c7f0,g613e996a0d+e1c447f2e0,g6c8d09e9e7+25247a063c,g7271f0639c+98f8679e14,g7a9cd813b8+124095ede6,g9d27549199+a302e8c7f0,ga1cf026fa3+ac198e9f13,ga32aa97882+7403ac30ac,ga786bb30fb+7a139211af,gaa63f70f4e+9994eb9896,gabf319e997+ade567573c,gba47b54d5d+94dc90c3ea,gbec6a3398f+06cf436103,gc6308e37c7+07dd123edb,gc655b1545f+ade567573c,gcc9029db3c+ab229f5caf,gd01420fc67+06cf436103,gd877ba84e5+06cf436103,gdb4cecd868+6f279b5b48,ge2d134c3d5+cc4dbb2e3f,ge448b5faa6+86d1ceac1d,gecc7e12556+98f8679e14,gf3ee170dca+25247a063c,gf4ac96e456+ade567573c,gf9f5ea5b4d+ac198e9f13,gff490e6085+8c2580be5c,w.2022.27
LSST Data Management Base Package
Namespaces | Classes | Typedefs | Enumerations | Functions | Variables
lsst::shapelet Namespace Reference

Namespaces

namespace  constants
 
namespace  generator
 
namespace  multiShapeletFunction
 
namespace  radialProfile
 
namespace  shapeletFunction
 
namespace  tests
 
namespace  tractor
 
namespace  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};
@ 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; }
table::Key< int > order

◆ 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(
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
Reports invalid arguments.
Definition: Runtime.h:66
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:48
Evaluates a standard shapelet Basis.
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(
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<std::shared_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}
A FunctorKey used to get or set a ndarray::Array from a sequence of scalar Keys.
Definition: arrays.h:45
A FunctorKey used to get or set a geom::ellipses::Ellipse from an (xx,yy,xy,x,y) tuple of Keys.
Definition: aggregates.h:360
Class that maps MultiShapeletFunction objects to fields in afw::table objects.
Definition: FunctorKeys.h:161
daf::base::PropertySet * set
Definition: fits.cc:912
bool isValid
Definition: fits.cc:399

◆ 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}
An ellipse core with quadrupole moments as parameters.
Definition: Quadrupole.h:47
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}
A class that computes a matrix that applies a linear transform to a 2-d Hermite polynomial expansion.

◆ 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}
Registry and utility class for multi-Gaussian approximations to radial profiles.
Definition: RadialProfile.h:60

◆ 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) &
96 ShapeletFunctionEvaluator::addToImage,
97 "array"_a, "xy0"_a = geom::Point2D());
98 clsShapeletFunctionEvaluator.def(
99 "addToImage", (void (ShapeletFunctionEvaluator::*)(afw::image::Image<double> &) const) &
100 ShapeletFunctionEvaluator::addToImage,
101 "image"_a);
102 clsShapeletFunctionEvaluator.def("integrate", &ShapeletFunctionEvaluator::integrate);
103 clsShapeletFunctionEvaluator.def("computeMoments", &ShapeletFunctionEvaluator::computeMoments);
104 clsShapeletFunctionEvaluator.def("update", &ShapeletFunctionEvaluator::update);
105}
An ellipse defined by an arbitrary BaseCore and a center point.
Definition: Ellipse.h:51
A class to represent a 2-dimensional array of pixels.
Definition: Image.h:51
A 2-d function defined by an expansion onto a Gauss-Laguerre or Gauss-Hermite basis.
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.
auto integrate(UnaryFunctionT func, Arg const a, Arg const b, double eps=1.0e-6)
The 1D integrator.
Definition: Integrate.h:767

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