LSST Applications 27.0.0,g0265f82a02+469cd937ee,g02d81e74bb+21ad69e7e1,g1470d8bcf6+cbe83ee85a,g2079a07aa2+e67c6346a6,g212a7c68fe+04a9158687,g2305ad1205+94392ce272,g295015adf3+81dd352a9d,g2bbee38e9b+469cd937ee,g337abbeb29+469cd937ee,g3939d97d7f+72a9f7b576,g487adcacf7+71499e7cba,g50ff169b8f+5929b3527e,g52b1c1532d+a6fc98d2e7,g591dd9f2cf+df404f777f,g5a732f18d5+be83d3ecdb,g64a986408d+21ad69e7e1,g858d7b2824+21ad69e7e1,g8a8a8dda67+a6fc98d2e7,g99cad8db69+f62e5b0af5,g9ddcbc5298+d4bad12328,ga1e77700b3+9c366c4306,ga8c6da7877+71e4819109,gb0e22166c9+25ba2f69a1,gb6a65358fc+469cd937ee,gbb8dafda3b+69d3c0e320,gc07e1c2157+a98bf949bb,gc120e1dc64+615ec43309,gc28159a63d+469cd937ee,gcf0d15dbbd+72a9f7b576,gdaeeff99f8+a38ce5ea23,ge6526c86ff+3a7c1ac5f1,ge79ae78c31+469cd937ee,gee10cc3b42+a6fc98d2e7,gf1cff7945b+21ad69e7e1,gfbcc870c63+9a11dc8c8f
LSST Data Management Base Package
Loading...
Searching...
No Matches
Functions
lsst::meas::base::python Namespace Reference

Functions

template<class Algorithm , class PyAlg >
std::enable_if<!std::is_abstract< Algorithm >::value, void >::type declareAlgorithmConstructor (PyAlg &cls)
 Wrap the standard algorithm constructor.
 
template<class Algorithm , class PyAlg >
std::enable_if< std::is_abstract< Algorithm >::value, void >::type declareAlgorithmConstructor (PyAlg &cls)
 Dummy function for not wrapping the constructor of an abstract base class.
 
template<class Algorithm , class PyAlg >
void declareAlgorithm (PyAlg &clsAlgorithm)
 Wrap the implicit API used by meas_base's algorithms.
 
template<class Algorithm , class Control , class PyAlg , class PyCtrl >
void declareAlgorithm (PyAlg &clsAlgorithm, PyCtrl &clsControl)
 Wrap the implicit API used by meas_base's algorithm-control pairs (no transform).
 
template<class Algorithm , class Control , class Transform , class PyAlg , class PyCtrl , class PyXform >
void declareAlgorithm (PyAlg &clsAlgorithm, PyCtrl &clsControl, PyXform &clsTransform)
 Wrap the implicit API used by meas_base's algorithm-control-transform triads.
 

Function Documentation

◆ declareAlgorithm() [1/3]

template<class Algorithm , class PyAlg >
void lsst::meas::base::python::declareAlgorithm ( PyAlg & clsAlgorithm)

Wrap the implicit API used by meas_base's algorithms.

This function only initializes constructors, fields, and methods common to all Algorithms.

Template Parameters
AlgorithmThe algorithm class.
PyAlgThe pybind11::class_ class corresponding to Algorithm.
Parameters
[in,out]clsAlgorithmThe pybind11 wrapper for Algorithm.

Definition at line 87 of file python.h.

87 {
88 /* Member types and enums */
89
90 /* Constructors */
91 declareAlgorithmConstructor<Algorithm>(clsAlgorithm);
92
93 /* Operators */
94
95 /* Members */
96 clsAlgorithm.def("fail", &Algorithm::fail, "measRecord"_a, "error"_a = NULL);
97 clsAlgorithm.def("measure", &Algorithm::measure, "record"_a, "exposure"_a);
98}

◆ declareAlgorithm() [2/3]

template<class Algorithm , class Control , class PyAlg , class PyCtrl >
void lsst::meas::base::python::declareAlgorithm ( PyAlg & clsAlgorithm,
PyCtrl & clsControl )

Wrap the implicit API used by meas_base's algorithm-control pairs (no transform).

This function only initializes constructors, fields, and methods common to all Algorithms and Controls.

Template Parameters
AlgorithmThe algorithm class.
ControlThe control class. Must equal Algorithm::Control and Transform::Control.
PyAlgThe pybind11::class_ class corresponding to Algorithm.
PyCtrlThe pybind11::class_ class corresponding to Control.
Parameters
[in,out]clsAlgorithm,clsControlThe pybind11 wrappers for the respective C++ classes.

Definition at line 116 of file python.h.

116 {
117 declareAlgorithm<Algorithm>(clsAlgorithm);
118
119 /* Member types and enums */
120
121 /* Constructors */
122 clsControl.def(py::init<>());
123
124 /* Operators */
125
126 /* Members */
127}

◆ declareAlgorithm() [3/3]

template<class Algorithm , class Control , class Transform , class PyAlg , class PyCtrl , class PyXform >
void lsst::meas::base::python::declareAlgorithm ( PyAlg & clsAlgorithm,
PyCtrl & clsControl,
PyXform & clsTransform )

Wrap the implicit API used by meas_base's algorithm-control-transform triads.

This function only initializes constructors, fields, and methods common to all Algorithms, Controls, and Transforms.

Template Parameters
AlgorithmThe algorithm class.
ControlThe control class. Must equal Algorithm::Control and Transform::Control.
TransformThe transform class.
PyAlgThe pybind11::class_ class corresponding to Algorithm.
PyCtrlThe pybind11::class_ class corresponding to Control.
PyXformThe pybind11::class_ class corresponding to Transform.
Parameters
[in,out]clsAlgorithm,clsControl,clsTransformThe pybind11 wrappers for the respective C++ classes.

Definition at line 148 of file python.h.

148 {
149 declareAlgorithm<Algorithm, Control>(clsAlgorithm, clsControl);
150
151 /* Member types and enums */
152
153 /* Constructors */
154 clsTransform.def(
155 py::init<typename Transform::Control const &, std::string const &, afw::table::SchemaMapper &>(),
156 "ctrl"_a, "name"_a, "mapper"_a);
157
158 /* Operators */
159 clsTransform.def("__call__",
160 [](Transform const &self, afw::table::SourceCatalog const &inputCatalog,
161 afw::table::BaseCatalog &outputCatalog, afw::geom::SkyWcs const &wcs,
162 afw::image::PhotoCalib const &photoCalib) {
163 return self(inputCatalog, outputCatalog, wcs, photoCalib);
164 },
165 "inputCatalog"_a, "outputCatalog"_a, "wcs"_a, "photoCalib"_a);
166
167 /* Members */
168}
A 2-dimensional celestial WCS that transform pixels to ICRS RA/Dec, using the LSST standard for pixel...
Definition SkyWcs.h:117
The photometric calibration of an exposure.
Definition PhotoCalib.h:114

◆ declareAlgorithmConstructor() [1/2]

template<class Algorithm , class PyAlg >
std::enable_if<!std::is_abstract< Algorithm >::value, void >::type lsst::meas::base::python::declareAlgorithmConstructor ( PyAlg & cls)

Wrap the standard algorithm constructor.

Template Parameters
AlgorithmThe algorithm class.
PyAlgThe pybind11::class_ class corresponding to Algorithm.
Parameters
[in,out]clsThe pybind11 wrapper for Algorithm.

Definition at line 55 of file python.h.

56 {
57 cls.def(py::init<typename Algorithm::Control const &, std::string const &, afw::table::Schema &>(),
58 "ctrl"_a, "name"_a, "schema"_a);
59}

◆ declareAlgorithmConstructor() [2/2]

template<class Algorithm , class PyAlg >
std::enable_if< std::is_abstract< Algorithm >::value, void >::type lsst::meas::base::python::declareAlgorithmConstructor ( PyAlg & cls)

Dummy function for not wrapping the constructor of an abstract base class.

Pybind11 cannot wrap such constructors, and there is no reason to call them from Python anyway.

Template Parameters
AlgorithmThe algorithm class.
PyAlgThe pybind11::class_ class corresponding to Algorithm.
Parameters
[in,out]clsThe pybind11 wrapper for Algorithm.

Definition at line 72 of file python.h.

73 {}