24#include "pybind11/pybind11.h"
25#include "ndarray/pybind11.h"
51using namespace pybind11::literals;
57using cpputils::python::WrapperCollection;
61using PyExposureRecord = py::classh<ExposureRecord, BaseRecord>;
62using PyExposureTable = py::classh<ExposureTable, BaseTable>;
66 return wrappers.
wrapType(PyExposureRecord(wrappers.
module,
"ExposureRecord"), [](
auto &mod,
auto &cls) {
67 cls.def(
"getId", &ExposureRecord::getId);
68 cls.def(
"setId", &ExposureRecord::setId,
"id"_a);
69 cls.def_property(
"id", &ExposureRecord::getId, &ExposureRecord::setId);
70 cls.def(
"getBBox", &ExposureRecord::getBBox);
71 cls.def(
"setBBox", &ExposureRecord::setBBox,
"bbox"_a);
73 cls.def(
"getTable", &ExposureRecord::getTable);
75 cls.def_property_readonly(
"table", &ExposureRecord::getTable);
77 (bool(ExposureRecord::*)(lsst::geom::SpherePoint const &, bool) const) &
78 ExposureRecord::contains,
79 "coord"_a,
"includeValidPolygon"_a = false);
81 (bool(ExposureRecord::*)(lsst::geom::Point2D const &, geom::SkyWcs const &, bool) const) &
82 ExposureRecord::contains,
83 "point"_a,
"wcs"_a,
"includeValidPolygon"_a = false);
84 cls.def(
"getWcs", &ExposureRecord::getWcs);
85 cls.def(
"setWcs", &ExposureRecord::setWcs,
"wcs"_a);
86 cls.def_property(
"wcs", &ExposureRecord::getWcs, &ExposureRecord::setWcs);
87 cls.def(
"getPsf", &ExposureRecord::getPsf);
88 cls.def(
"setPsf", &ExposureRecord::setPsf,
"psf"_a);
89 cls.def_property(
"psf", &ExposureRecord::getPsf, &ExposureRecord::setPsf);
91 cls.def(
"getPhotoCalib", &ExposureRecord::getPhotoCalib);
92 cls.def(
"setPhotoCalib", &ExposureRecord::setPhotoCalib,
"photoCalib"_a);
93 cls.def_property(
"photoCalib", &ExposureRecord::getPhotoCalib, &ExposureRecord::setPhotoCalib);
94 cls.def(
"getApCorrMap", &ExposureRecord::getApCorrMap);
95 cls.def(
"setApCorrMap", &ExposureRecord::setApCorrMap,
"apCorrMap"_a);
96 cls.def_property(
"apCorrMap", &ExposureRecord::getApCorrMap, &ExposureRecord::setApCorrMap);
97 cls.def(
"getValidPolygon", &ExposureRecord::getValidPolygon);
98 cls.def(
"setValidPolygon", &ExposureRecord::setValidPolygon);
99 cls.def_property(
"validPolygon", &ExposureRecord::getValidPolygon, &ExposureRecord::setValidPolygon);
100 cls.def(
"getVisitInfo", &ExposureRecord::getVisitInfo);
101 cls.def(
"setVisitInfo", &ExposureRecord::setVisitInfo,
"visitInfo"_a);
102 cls.def_property(
"visitInfo", &ExposureRecord::getVisitInfo, &ExposureRecord::setVisitInfo);
103 cls.def(
"getTransmissionCurve", &ExposureRecord::getTransmissionCurve);
104 cls.def(
"setTransmissionCurve", &ExposureRecord::setTransmissionCurve,
"transmissionCurve"_a);
105 cls.def_property(
"transmissionCurve", &ExposureRecord::getTransmissionCurve,
106 &ExposureRecord::setTransmissionCurve);
107 cls.def(
"getDetector", &ExposureRecord::getDetector);
108 cls.def(
"setDetector", &ExposureRecord::setDetector,
"detector"_a);
109 cls.def_property(
"detector", &ExposureRecord::getDetector, &ExposureRecord::setDetector);
114 return wrappers.
wrapType(PyExposureTable(wrappers.
module,
"ExposureTable"), [](
auto &mod,
auto &cls) {
115 cls.def_static(
"make", &ExposureTable::make);
116 cls.def_static(
"makeMinimalSchema", &ExposureTable::makeMinimalSchema);
117 cls.def_static(
"checkSchema", &ExposureTable::checkSchema,
"schema"_a);
119 cls.def_static(
"getIdKey", &ExposureTable::getIdKey);
120 cls.def_static(
"getBBoxMinKey", &ExposureTable::getBBoxMinKey);
121 cls.def_static(
"getBBoxMaxKey", &ExposureTable::getBBoxMaxKey);
123 cls.def(
"clone", &ExposureTable::clone);
124 cls.def(
"makeRecord", &ExposureTable::makeRecord);
125 cls.def(
"copyRecord", (std::shared_ptr<ExposureRecord>(ExposureTable::*)(BaseRecord const &)) &
126 ExposureTable::copyRecord);
127 cls.def(
"copyRecord", (std::shared_ptr<ExposureRecord>(ExposureTable::*)(BaseRecord const &,
128 SchemaMapper const &)) &
129 ExposureTable::copyRecord);
140 PyExposureCatalog(wrappers.
module,
"ExposureCatalog", py::dynamic_attr()),
141 [](
auto &mod,
auto &cls) {
142 cls.def(py::init<Schema const &>(),
"schema"_a);
143 cls.def(py::init<std::shared_ptr<ExposureTable> const &>(),
144 "table"_a = std::shared_ptr<ExposureTable>());
145 cls.def(py::init<Catalog const &>(),
"other"_a);
148 cls.def_static(
"readFits", (Catalog(*)(std::string const &, int, int)) & Catalog::readFits,
149 "filename"_a,
"hdu"_a = fits::DEFAULT_HDU,
"flags"_a = 0);
150 cls.def_static(
"readFits", (Catalog(*)(fits::MemFileManager &, int, int)) & Catalog::readFits,
151 "manager"_a,
"hdu"_a = fits::DEFAULT_HDU,
"flags"_a = 0);
154 (Catalog(Catalog::*)(ndarray::Array<bool const, 1> const &) const) & Catalog::subset,
157 (Catalog(Catalog::*)(std::ptrdiff_t, std::ptrdiff_t, std::ptrdiff_t) const) &
159 "startd"_a,
"stopd"_a,
"step"_a);
160 cls.def(
"subsetContaining",
161 (Catalog(Catalog::*)(lsst::geom::SpherePoint const &, bool) const) &
162 Catalog::subsetContaining,
163 "coord"_a,
"includeValidPolygon"_a = false);
164 cls.def(
"subsetContaining",
165 (Catalog(Catalog::*)(lsst::geom::Point2D const &, geom::SkyWcs const &, bool) const) &
166 Catalog::subsetContaining,
167 "point"_a,
"wcs"_a,
"includeValidPolygon"_a = false);
179 auto clsExposureRecord = declareExposureRecord(wrappers);
180 auto clsExposureTable = declareExposureTable(wrappers);
182 auto clsExposureCatalog = declareExposureCatalog(wrappers);
184 clsExposureRecord.attr(
"Table") = clsExposureTable;
185 clsExposureRecord.attr(
"ColumnView") = clsExposureColumnView;
186 clsExposureRecord.attr(
"Catalog") = clsExposureCatalog;
187 clsExposureTable.attr(
"Record") = clsExposureRecord;
188 clsExposureTable.attr(
"ColumnView") = clsExposureColumnView;
189 clsExposureTable.attr(
"Catalog") = clsExposureCatalog;
190 clsExposureCatalog.attr(
"Record") = clsExposureRecord;
191 clsExposureCatalog.attr(
"Table") = clsExposureTable;
192 clsExposureCatalog.attr(
"ColumnView") = clsExposureColumnView;
Implementation of the Photometric Calibration class.
PyType wrapType(PyType cls, ClassWrapperCallback function, bool setModuleName=true)
Add a type (class or enum) wrapper, deferring method and other attribute definitions until finish() i...
pybind11::module module
The module object passed to the PYBIND11_MODULE block that contains this WrapperCollection.
Custom catalog class for ExposureRecord/Table.
Custom catalog class for record/table subclasses that are guaranteed to have an ID,...
A helper class for subdividing pybind11 module across multiple translation units (i....
PySortedCatalog< Record > declareSortedCatalog(cpputils::python::WrapperCollection &wrappers, std::string const &name, bool isBase=false)
Wrap an instantiation of lsst::afw::table::SortedCatalogT<Record>.
PyColumnView< Record > declareColumnView(cpputils::python::WrapperCollection &wrappers, std::string const &name, bool isBase=false)
Declare member and static functions for a given instantiation of lsst::afw::table::ColumnViewT<Record...
void wrapExposure(WrapperCollection &wrappers)