26 #include <pybind11/pybind11.h>
27 #include <pybind11/stl.h>
29 #include "numpy/arrayobject.h"
30 #include "ndarray/pybind11.h"
42 namespace py = pybind11;
43 using namespace py::literals;
47 namespace cameraGeom {
50 py::module mod(
"_detector",
"Python wrapper for afw _detector library");
53 if (_import_array() < 0) {
54 PyErr_SetString(PyExc_ImportError,
"numpy.core.multiarray failed to import");
59 py::class_<Detector, std::shared_ptr<Detector>>
cls(mod,
"Detector");
62 py::enum_<DetectorType>(mod,
"DetectorType")
73 "name"_a,
"id"_a,
"type"_a,
"serial"_a,
"bbox"_a,
"ampInfoCatalog"_a,
"orientation"_a,
77 cls.def(
"__getitem__",
78 (std::shared_ptr<table::AmpInfoRecord const>(
Detector::*)(
int)
const) & Detector::_get,
"i"_a);
79 cls.def(
"__getitem__",
80 (std::shared_ptr<table::AmpInfoRecord const>(
Detector::*)(std::string
const &)
const) &
83 cls.def(
"__len__", &Detector::size);
86 cls.def(
"getName", &Detector::getName);
87 cls.def(
"getId", &Detector::getId);
88 cls.def(
"getType", &Detector::getType);
89 cls.def(
"getSerial", &Detector::getSerial);
90 cls.def(
"getBBox", &Detector::getBBox);
92 (std::vector<geom::Point2D>(
Detector::*)(
CameraSys const &)
const) & Detector::getCorners,
100 "getCenterPrefix"_a);
101 cls.def(
"getAmpInfoCatalog", &Detector::getAmpInfoCatalog);
102 cls.def(
"getOrientation", &Detector::getOrientation);
103 cls.def(
"getPixelSize", &Detector::getPixelSize);
104 cls.def(
"hasCrosstalk", &Detector::hasCrosstalk);
105 cls.def(
"getCrosstalk", &Detector::getCrosstalk);
106 cls.def(
"getTransformMap", &Detector::getTransformMap);
107 cls.def(
"hasTransform", (
bool (
Detector::*)(
CameraSys const &)
const) & Detector::hasTransform,
110 "cameraSysPrefix"_a);
111 cls.def(
"getTransform",
114 Detector::getTransform,
115 "fromSys"_a,
"toSys"_a);
116 cls.def(
"getTransform",
119 Detector::getTransform,
120 "fromSys"_a,
"toSys"_a);
121 cls.def(
"getTransform",
124 Detector::getTransform,
125 "fromSys"_a,
"toSys"_a);
126 cls.def(
"getTransform",
129 Detector::getTransform,
130 "fromSys"_a,
"toSys"_a);
131 cls.def(
"getNativeCoordSys", &Detector::getNativeCoordSys);
132 cls.def(
"makeCameraPoint",
134 Detector::makeCameraPoint,
135 "point"_a,
"cameraSys"_a);
136 cls.def(
"makeCameraPoint",
138 Detector::makeCameraPoint,
139 "point"_a,
"cameraSysPrefix"_a);
140 cls.def(
"makeCameraSys",
143 cls.def(
"makeCameraSys",
145 "cameraSysPrefix"_a);
148 "fromCameraPoint"_a,
"toSys"_a);
152 "fromCameraPoint"_a,
"toSys"_a);
Camera coordinate system; used as a key in in TransformMap.
A custom container class for records, based on std::vector.
An integer coordinate rectangle.
Describe a detector's orientation in the focal plane.
PYBIND11_PLUGIN(_cameraPoint)
Camera coordinate system prefix.
Information about a CCD or other imaging detector.
A Point2D with associated camera coordinate system.
DetectorType
Type of imaging detector.
ndarray::Array< float const, 2 > CrosstalkMatrix