23 #include "pybind11/pybind11.h" 25 #include "lsst/daf/base/PropertySet.h" 37 namespace py = pybind11;
45 using PyExposureInfo = py::class_<ExposureInfo, std::shared_ptr<ExposureInfo>>;
48 py::module mod(
"exposureInfo");
50 py::module::import(
"lsst.daf.base");
51 py::module::import(
"lsst.afw.image.wcs");
52 py::module::import(
"lsst.afw.image.calib");
53 py::module::import(
"lsst.afw.image.apCorrMap");
54 py::module::import(
"lsst.afw.image.coaddInputs");
55 py::module::import(
"lsst.afw.image.filter");
56 py::module::import(
"lsst.afw.image.visitInfo");
59 PyExposureInfo
cls(mod,
"ExposureInfo");
64 cls.def(py::init<std::shared_ptr<Wcs const>
const &, std::shared_ptr<detection::Psf const>
const &,
65 std::shared_ptr<Calib const>
const &,
66 std::shared_ptr<cameraGeom::Detector const>
const &,
67 std::shared_ptr<geom::polygon::Polygon const>
const &, Filter
const &,
68 std::shared_ptr<daf::base::PropertySet>
const &, std::shared_ptr<CoaddInputs>
const &,
69 std::shared_ptr<ApCorrMap>
const &, std::shared_ptr<VisitInfo const>>(),
70 "wcs"_a = std::shared_ptr<Wcs const>(),
"psf"_a = std::shared_ptr<detection::Psf const>(),
71 "calib"_a = std::shared_ptr<Calib const>(),
72 "detector"_a = std::shared_ptr<cameraGeom::Detector const>(),
73 "polygon"_a = std::shared_ptr<geom::polygon::Polygon const>(),
"filter"_a = Filter(),
74 "metadata"_a = std::shared_ptr<daf::base::PropertySet>(),
75 "coaddInputs"_a = std::shared_ptr<CoaddInputs>(),
"apCorrMap"_a = std::shared_ptr<ApCorrMap>(),
76 "visitInfo"_a = std::shared_ptr<VisitInfo const>());
77 cls.def(py::init<>());
78 cls.def(py::init<ExposureInfo>(),
"other"_a);
79 cls.def(py::init<ExposureInfo, bool>(),
"other"_a,
"copyMetadata"_a);
82 cls.def(
"hasWcs", &ExposureInfo::hasWcs);
83 cls.def(
"getWcs", (std::shared_ptr<Wcs> (ExposureInfo::*)()) & ExposureInfo::getWcs);
84 cls.def(
"setWcs", &ExposureInfo::setWcs,
"wcs"_a);
86 cls.def(
"hasDetector", &ExposureInfo::hasDetector);
87 cls.def(
"getDetector", &ExposureInfo::getDetector);
88 cls.def(
"setDetector",
89 [](ExposureInfo &
self, py::object detector) {
90 if (detector == py::none()) {
91 self.setDetector(
nullptr);
93 self.setDetector(py::cast<std::shared_ptr<afw::cameraGeom::Detector>>(detector));
98 cls.def(
"getFilter", &ExposureInfo::getFilter);
99 cls.def(
"setFilter", &ExposureInfo::setFilter,
"filter"_a);
101 cls.def(
"hasCalib", &ExposureInfo::hasCalib);
102 cls.def(
"getCalib", (std::shared_ptr<Calib> (ExposureInfo::*)()) & ExposureInfo::getCalib);
103 cls.def(
"setCalib", &ExposureInfo::setCalib,
"calib"_a);
105 cls.def(
"getMetadata", &ExposureInfo::getMetadata);
106 cls.def(
"setMetadata", &ExposureInfo::setMetadata,
"metadata"_a);
108 cls.def(
"hasPsf", &ExposureInfo::hasPsf);
109 cls.def(
"getPsf", &ExposureInfo::getPsf);
111 [](ExposureInfo &
self, py::object psf) {
112 if (psf == py::none()) {
113 self.setPsf(
nullptr);
115 self.setPsf(py::cast<std::shared_ptr<afw::detection::Psf>>(psf));
120 cls.def(
"hasValidPolygon", &ExposureInfo::hasValidPolygon);
121 cls.def(
"getValidPolygon", &ExposureInfo::getValidPolygon);
122 cls.def(
"setValidPolygon",
123 [](ExposureInfo &
self, py::object polygon) {
124 if (polygon == py::none()) {
125 self.setValidPolygon(
nullptr);
127 self.setValidPolygon(py::cast<std::shared_ptr<afw::geom::polygon::Polygon>>(polygon));
132 cls.def(
"hasApCorrMap", &ExposureInfo::hasApCorrMap);
133 cls.def(
"getApCorrMap", (std::shared_ptr<ApCorrMap> (ExposureInfo::*)()) & ExposureInfo::getApCorrMap);
134 cls.def(
"setApCorrMap", &ExposureInfo::setApCorrMap,
"apCorrMap"_a);
135 cls.def(
"initApCorrMap", &ExposureInfo::initApCorrMap);
137 cls.def(
"hasCoaddInputs", &ExposureInfo::hasCoaddInputs);
138 cls.def(
"getCoaddInputs", &ExposureInfo::getCoaddInputs);
139 cls.def(
"setCoaddInputs", &ExposureInfo::setCoaddInputs,
"coaddInputs"_a);
141 cls.def(
"hasVisitInfo", &ExposureInfo::hasVisitInfo);
142 cls.def(
"getVisitInfo", &ExposureInfo::getVisitInfo);
143 cls.def(
"setVisitInfo", &ExposureInfo::setVisitInfo,
"visitInfo"_a);
PYBIND11_PLUGIN(_cameraPoint)
A base class for image defects.