26 #include <pybind11/pybind11.h>
27 #include <pybind11/stl.h>
40 namespace py = pybind11;
41 using namespace py::literals;
45 namespace cameraGeom {
48 py::module mod(
"_detector",
"Python wrapper for afw _detector library");
51 py::class_<Detector, std::shared_ptr<Detector>>
cls(mod,
"Detector");
54 py::enum_<DetectorType>(mod,
"DetectorType")
65 "name"_a,
"id"_a,
"type"_a,
"serial"_a,
"bbox"_a,
"ampInfoCatalog"_a,
"orientation"_a,
66 "pixelSize"_a,
"transforms"_a);
69 cls.def(
"__getitem__",
70 (std::shared_ptr<table::AmpInfoRecord const>(
Detector::*)(
int)
const) & Detector::_get,
"i"_a);
71 cls.def(
"__getitem__",
72 (std::shared_ptr<table::AmpInfoRecord const>(
Detector::*)(std::string
const &)
const) &
75 cls.def(
"__len__", &Detector::size);
78 cls.def(
"getName", &Detector::getName);
79 cls.def(
"getId", &Detector::getId);
80 cls.def(
"getType", &Detector::getType);
81 cls.def(
"getSerial", &Detector::getSerial);
82 cls.def(
"getBBox", &Detector::getBBox);
84 (std::vector<geom::Point2D>(
Detector::*)(
CameraSys const &)
const) & Detector::getCorners,
93 cls.def(
"getAmpInfoCatalog", &Detector::getAmpInfoCatalog);
94 cls.def(
"getOrientation", &Detector::getOrientation);
95 cls.def(
"getPixelSize", &Detector::getPixelSize);
96 cls.def(
"getTransformMap", &Detector::getTransformMap);
97 cls.def(
"hasTransform", (
bool (
Detector::*)(
CameraSys const &)
const) & Detector::hasTransform,
100 "cameraSysPrefix"_a);
101 cls.def(
"getTransform",
102 (std::shared_ptr<geom::XYTransform const>(
Detector::*)(
CameraSys const &)
const) &
103 Detector::getTransform,
105 cls.def(
"getTransform",
107 Detector::getTransform,
108 "cameraSysPrefix"_a);
109 cls.def(
"makeCameraPoint",
111 Detector::makeCameraPoint,
112 "point"_a,
"cameraSys"_a);
113 cls.def(
"makeCameraPoint",
115 Detector::makeCameraPoint,
116 "point"_a,
"cameraSysPrefix"_a);
117 cls.def(
"makeCameraSys",
120 cls.def(
"makeCameraSys",
122 "cameraSysPrefix"_a);
125 "fromCameraPoint"_a,
"toSys"_a);
129 "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.