24#include "pybind11/pybind11.h"
25#include "ndarray/pybind11.h"
51using namespace pybind11::literals;
57using cpputils::python::WrapperCollection;
61using PyExposureRecord = py::class_<ExposureRecord, std::shared_ptr<ExposureRecord>, BaseRecord>;
62using PyExposureTable = py::class_<ExposureTable, std::shared_ptr<ExposureTable>, BaseTable>;
63using PyExposureCatalog =
65 SortedCatalogT<ExposureRecord>>;
67PyExposureRecord declareExposureRecord(WrapperCollection &wrappers) {
68 return wrappers.wrapType(PyExposureRecord(wrappers.module,
"ExposureRecord"), [](
auto &mod,
auto &cls) {
69 cls.def(
"getId", &ExposureRecord::getId);
70 cls.def(
"setId", &ExposureRecord::setId,
"id"_a);
71 cls.def_property(
"id", &ExposureRecord::getId, &ExposureRecord::setId);
72 cls.def(
"getBBox", &ExposureRecord::getBBox);
73 cls.def(
"setBBox", &ExposureRecord::setBBox,
"bbox"_a);
75 cls.def(
"getTable", &ExposureRecord::getTable);
77 cls.def_property_readonly(
"table", &ExposureRecord::getTable);
79 (bool(ExposureRecord::*)(lsst::geom::SpherePoint const &, bool) const) &
80 ExposureRecord::contains,
81 "coord"_a,
"includeValidPolygon"_a = false);
83 (bool(ExposureRecord::*)(lsst::geom::Point2D const &, geom::SkyWcs const &, bool) const) &
84 ExposureRecord::contains,
85 "point"_a,
"wcs"_a,
"includeValidPolygon"_a = false);
86 cls.def(
"getWcs", &ExposureRecord::getWcs);
87 cls.def(
"setWcs", &ExposureRecord::setWcs,
"wcs"_a);
88 cls.def_property(
"wcs", &ExposureRecord::getWcs, &ExposureRecord::setWcs);
89 cls.def(
"getPsf", &ExposureRecord::getPsf);
90 cls.def(
"setPsf", &ExposureRecord::setPsf,
"psf"_a);
91 cls.def_property(
"psf", &ExposureRecord::getPsf, &ExposureRecord::setPsf);
93 cls.def(
"getPhotoCalib", &ExposureRecord::getPhotoCalib);
94 cls.def(
"setPhotoCalib", &ExposureRecord::setPhotoCalib,
"photoCalib"_a);
95 cls.def_property(
"photoCalib", &ExposureRecord::getPhotoCalib, &ExposureRecord::setPhotoCalib);
96 cls.def(
"getApCorrMap", &ExposureRecord::getApCorrMap);
97 cls.def(
"setApCorrMap", &ExposureRecord::setApCorrMap,
"apCorrMap"_a);
98 cls.def_property(
"apCorrMap", &ExposureRecord::getApCorrMap, &ExposureRecord::setApCorrMap);
99 cls.def(
"getValidPolygon", &ExposureRecord::getValidPolygon);
100 cls.def(
"setValidPolygon", &ExposureRecord::setValidPolygon);
101 cls.def_property(
"validPolygon", &ExposureRecord::getValidPolygon, &ExposureRecord::setValidPolygon);
102 cls.def(
"getVisitInfo", &ExposureRecord::getVisitInfo);
103 cls.def(
"setVisitInfo", &ExposureRecord::setVisitInfo,
"visitInfo"_a);
104 cls.def_property(
"visitInfo", &ExposureRecord::getVisitInfo, &ExposureRecord::setVisitInfo);
105 cls.def(
"getTransmissionCurve", &ExposureRecord::getTransmissionCurve);
106 cls.def(
"setTransmissionCurve", &ExposureRecord::setTransmissionCurve,
"transmissionCurve"_a);
107 cls.def_property(
"transmissionCurve", &ExposureRecord::getTransmissionCurve,
108 &ExposureRecord::setTransmissionCurve);
109 cls.def(
"getDetector", &ExposureRecord::getDetector);
110 cls.def(
"setDetector", &ExposureRecord::setDetector,
"detector"_a);
111 cls.def_property(
"detector", &ExposureRecord::getDetector, &ExposureRecord::setDetector);
115PyExposureTable declareExposureTable(WrapperCollection &wrappers) {
116 return wrappers.wrapType(PyExposureTable(wrappers.module,
"ExposureTable"), [](
auto &mod,
auto &cls) {
117 cls.def_static(
"make", &ExposureTable::make);
118 cls.def_static(
"makeMinimalSchema", &ExposureTable::makeMinimalSchema);
119 cls.def_static(
"checkSchema", &ExposureTable::checkSchema,
"schema"_a);
121 cls.def_static(
"getIdKey", &ExposureTable::getIdKey);
122 cls.def_static(
"getBBoxMinKey", &ExposureTable::getBBoxMinKey);
123 cls.def_static(
"getBBoxMaxKey", &ExposureTable::getBBoxMaxKey);
125 cls.def(
"clone", &ExposureTable::clone);
126 cls.def(
"makeRecord", &ExposureTable::makeRecord);
127 cls.def(
"copyRecord", (std::shared_ptr<ExposureRecord>(ExposureTable::*)(BaseRecord const &)) &
128 ExposureTable::copyRecord);
129 cls.def(
"copyRecord", (std::shared_ptr<ExposureRecord>(ExposureTable::*)(BaseRecord const &,
130 SchemaMapper const &)) &
131 ExposureTable::copyRecord);
135PyExposureCatalog declareExposureCatalog(WrapperCollection &wrappers) {
136 using Catalog = ExposureCatalogT<ExposureRecord>;
137 table::python::declareSortedCatalog<ExposureRecord>(wrappers,
"Exposure",
true);
141 return wrappers.wrapType(
142 PyExposureCatalog(wrappers.module,
"ExposureCatalog", py::dynamic_attr()),
143 [](
auto &mod,
auto &cls) {
144 cls.def(py::init<Schema const &>(),
"schema"_a);
145 cls.def(py::init<std::shared_ptr<ExposureTable> const &>(),
146 "table"_a = std::shared_ptr<ExposureTable>());
147 cls.def(py::init<Catalog const &>(),
"other"_a);
150 cls.def_static(
"readFits", (Catalog(*)(std::string const &, int, int)) & Catalog::readFits,
151 "filename"_a,
"hdu"_a = fits::DEFAULT_HDU,
"flags"_a = 0);
152 cls.def_static(
"readFits", (Catalog(*)(fits::MemFileManager &, int, int)) & Catalog::readFits,
153 "manager"_a,
"hdu"_a = fits::DEFAULT_HDU,
"flags"_a = 0);
157 (Catalog(Catalog::*)(ndarray::Array<bool const, 1> const &) const) & Catalog::subset,
160 (Catalog(Catalog::*)(std::ptrdiff_t, std::ptrdiff_t, std::ptrdiff_t) const) &
162 "startd"_a,
"stopd"_a,
"step"_a);
163 cls.def(
"subsetContaining",
164 (Catalog(Catalog::*)(lsst::geom::SpherePoint const &, bool) const) &
165 Catalog::subsetContaining,
166 "coord"_a,
"includeValidPolygon"_a = false);
167 cls.def(
"subsetContaining",
168 (Catalog(Catalog::*)(lsst::geom::Point2D const &, geom::SkyWcs const &, bool) const) &
169 Catalog::subsetContaining,
170 "point"_a,
"wcs"_a,
"includeValidPolygon"_a = false);
Implementation of the Photometric Calibration class.
Tag types used to declare specialized field types.
A helper class for subdividing pybind11 module across multiple translation units (i....
void wrapExposure(WrapperCollection &wrappers)