23 #include "pybind11/pybind11.h" 27 namespace py = pybind11;
36 using PySlotDefinition = py::class_<SlotDefinition>;
38 void declareSlotDefinition(py::module &mod) {
39 PySlotDefinition
cls(mod,
"SlotDefinition");
40 cls.def(
"getName", &SlotDefinition::getName);
41 cls.def(
"getAlias", &SlotDefinition::getAlias);
47 template <
typename Class>
48 void declareSlotDefinitionSubclass(py::module &mod, std::string
const &
name) {
49 py::class_<Class, SlotDefinition>
cls(mod, name.c_str());
50 cls.def(py::init<std::string const &>(),
"name"_a);
51 cls.def(
"isValid", &Class::isValid);
52 cls.def(
"getMeasKey", &Class::getMeasKey);
53 cls.def(
"getErrKey", &Class::getErrKey);
54 cls.def(
"getFlagKey", &Class::getFlagKey);
55 cls.def(
"setKeys", &Class::setKeys,
"alias"_a,
"schema"_a);
59 py::module mod(
"slots");
60 py::module::import(
"lsst.afw.table.aggregates");
62 declareSlotDefinition(mod);
63 declareSlotDefinitionSubclass<FluxSlotDefinition>(mod,
"Flux");
64 declareSlotDefinitionSubclass<CentroidSlotDefinition>(mod,
"Centroid");
65 declareSlotDefinitionSubclass<ShapeSlotDefinition>(mod,
"Shape");
PYBIND11_PLUGIN(_cameraPoint)
A base class for image defects.
table::Key< std::string > name