23 #include "pybind11/pybind11.h" 47 using PyPeakRecord = py::class_<PeakRecord, std::shared_ptr<PeakRecord>, table::BaseRecord>;
48 using PyPeakTable = py::class_<PeakTable, std::shared_ptr<PeakTable>, table::BaseTable>;
53 void declarePeakRecord(PyPeakRecord &
cls) {
54 cls.def(
"getTable", &PeakRecord::getTable);
55 cls.def_property_readonly(
"table", &PeakRecord::getTable);
56 cls.def(
"getId", &PeakRecord::getId);
57 cls.def(
"setId", &PeakRecord::setId);
58 cls.def(
"getIx", &PeakRecord::getIx);
59 cls.def(
"getIy", &PeakRecord::getIy);
60 cls.def(
"setIx", &PeakRecord::setIx);
61 cls.def(
"setIy", &PeakRecord::setIy);
62 cls.def(
"getI", &PeakRecord::getI);
63 cls.def(
"getCentroid", (
lsst::geom::Point2I (PeakRecord::*)(
bool)
const) & PeakRecord::getCentroid);
64 cls.def(
"getCentroid", (
lsst::geom::Point2D (PeakRecord::*)()
const) & PeakRecord::getCentroid);
65 cls.def(
"getFx", &PeakRecord::getFx);
66 cls.def(
"getFy", &PeakRecord::getFy);
67 cls.def(
"setFx", &PeakRecord::setFx);
68 cls.def(
"setFy", &PeakRecord::setFy);
69 cls.def(
"getF", &PeakRecord::getF);
70 cls.def(
"getPeakValue", &PeakRecord::getPeakValue);
71 cls.def(
"setPeakValue", &PeakRecord::setPeakValue);
79 void declarePeakTable(PyPeakTable &cls) {
80 cls.def_static(
"make", &PeakTable::make,
"schema"_a,
"forceNew"_a =
false);
81 cls.def_static(
"makeMinimalSchema", &PeakTable::makeMinimalSchema);
82 cls.def_static(
"checkSchema", &PeakTable::checkSchema,
"schema"_a);
84 cls.def(
"setIdFactory", &PeakTable::setIdFactory,
"factory"_a);
85 cls.def_static(
"getIdKey", &PeakTable::getIdKey);
86 cls.def_static(
"getIxKey", &PeakTable::getIxKey);
87 cls.def_static(
"getIyKey", &PeakTable::getIyKey);
88 cls.def_static(
"getFxKey", &PeakTable::getFxKey);
89 cls.def_static(
"getFyKey", &PeakTable::getFyKey);
90 cls.def_static(
"getPeakValueKey", &PeakTable::getPeakValueKey);
92 cls.def(
"makeRecord", &PeakTable::makeRecord);
94 PeakTable::copyRecord);
96 afw::table::SchemaMapper
const &)) &
97 PeakTable::copyRecord);
104 PyPeakRecord clsPeakRecord(mod,
"PeakRecord");
105 PyPeakTable clsPeakTable(mod,
"PeakTable");
108 declarePeakRecord(clsPeakRecord);
109 declarePeakTable(clsPeakTable);
110 auto clsPeakColumnView = table::python::declareColumnView<PeakRecord>(mod,
"Peak");
111 auto clsPeakCatalog = table::python::declareCatalog<PeakRecord>(mod,
"Peak");
113 clsPeakRecord.attr(
"Table") = clsPeakTable;
114 clsPeakRecord.attr(
"ColumnView") = clsPeakColumnView;
115 clsPeakRecord.attr(
"Catalog") = clsPeakCatalog;
116 clsPeakTable.attr(
"Record") = clsPeakRecord;
117 clsPeakTable.attr(
"ColumnView") = clsPeakColumnView;
118 clsPeakTable.attr(
"Catalog") = clsPeakCatalog;
119 clsPeakCatalog.attr(
"Record") = clsPeakRecord;
120 clsPeakCatalog.attr(
"Table") = clsPeakTable;
121 clsPeakCatalog.attr(
"ColumnView") = clsPeakColumnView;
void addOutputOp(PyClass &cls, std::string const &method)
Add __str__ or __repr__ method implemented by operator<<.
A base class for image defects.
PYBIND11_MODULE(peak, mod)