24 #ifndef LSST_MEAS_BASE_PYTHON_H 25 #define LSST_MEAS_BASE_PYTHON_H 27 #include "pybind11/pybind11.h" 43 namespace py = pybind11;
54 template <
class Algorithm,
class PyAlg>
56 cls.def(py::init<
typename Algorithm::Control
const &,
59 "ctrl"_a,
"name"_a,
"schema"_a);
72 template <
class Algorithm,
class PyAlg>
87 template <
class Algorithm,
class PyAlg>
92 declareAlgorithmConstructor<Algorithm>(clsAlgorithm);
97 clsAlgorithm.def(
"fail", &Algorithm::fail,
"measRecord"_a,
"error"_a=NULL);
98 clsAlgorithm.def(
"measure", &Algorithm::measure,
"record"_a,
"exposure"_a);
116 template <
class Algorithm,
class Control,
class PyAlg,
class PyCtrl>
118 declareAlgorithm<Algorithm>(clsAlgorithm);
123 clsControl.def(py::init<>());
148 template <
class Algorithm,
class Control,
class Transform,
class PyAlg,
class PyCtrl,
class PyXform>
150 declareAlgorithm<Algorithm, Control>(clsAlgorithm, clsControl);
155 clsTransform.def(py::init<
typename Transform::Control
const &,
158 "ctrl"_a,
"name"_a,
"mapper"_a);
161 clsTransform.def(
"__call__", [](Transform
const &
self,
166 return self(inputCatalog, outputCatalog, wcs, calib);
167 },
"inputCatalog"_a,
"outputCatalog"_a,
"wcs"_a,
"calib"_a);
table::Key< table::Array< std::uint8_t > > wcs
void declareAlgorithm(PyAlg &clsAlgorithm)
Wrap the implicit API used by meas_base's algorithms.
std::enable_if<!std::is_abstract< Algorithm >::value, void >::type declareAlgorithmConstructor(PyAlg &cls)
Wrap the standard algorithm constructor.