23 #include "pybind11/pybind11.h" 24 #include "pybind11/stl.h" 41 using PyAmpInfoRecord = py::class_<AmpInfoRecord, std::shared_ptr<AmpInfoRecord>, BaseRecord>;
42 using PyAmpInfoTable = py::class_<AmpInfoTable, std::shared_ptr<AmpInfoTable>, BaseTable>;
44 static PyAmpInfoRecord declareAmpInfoRecord(
py::module &mod) {
45 PyAmpInfoRecord
cls(mod,
"AmpInfoRecord");
46 cls.def(
"getName", &AmpInfoRecord::getName);
47 cls.def(
"setName", &AmpInfoRecord::setName,
"name"_a,
"Set name of amplifier location in camera");
48 cls.def(
"getTable", &AmpInfoRecord::getTable);
49 cls.def_property_readonly(
"table", &AmpInfoRecord::getTable);
50 cls.def(
"getBBox", &AmpInfoRecord::getBBox);
51 cls.def(
"setBBox", &AmpInfoRecord::setBBox,
"bbox"_a);
52 cls.def(
"getGain", &AmpInfoRecord::getGain);
53 cls.def(
"setGain", &AmpInfoRecord::setGain,
"gain"_a,
"Set amplifier gain in electron/adu");
54 cls.def(
"getReadNoise", &AmpInfoRecord::getReadNoise);
55 cls.def(
"setReadNoise", &AmpInfoRecord::setReadNoise,
"readNoise"_a,
"Set read noise in electron");
56 cls.def(
"getSaturation", &AmpInfoRecord::getSaturation);
57 cls.def(
"setSaturation", &AmpInfoRecord::setSaturation,
"saturation"_a,
58 "Set level in ADU above which pixels are considered saturated; " 59 "use `nan` if no such level applies");
60 cls.def(
"getSuspectLevel", &AmpInfoRecord::getSuspectLevel);
61 cls.def(
"setSuspectLevel", &AmpInfoRecord::setSuspectLevel,
"suspectLevel"_a,
62 "Set level in ADU above which pixels are considered suspicious; " 63 "use `nan` if no such level applies");
64 cls.def(
"getReadoutCorner", &AmpInfoRecord::getReadoutCorner);
65 cls.def(
"setReadoutCorner", &AmpInfoRecord::setReadoutCorner,
"corner"_a);
66 cls.def(
"getLinearityCoeffs", &AmpInfoRecord::getLinearityCoeffs);
67 cls.def(
"setLinearityCoeffs", &AmpInfoRecord::setLinearityCoeffs,
"coeffs"_a);
68 cls.def(
"getLinearityType", &AmpInfoRecord::getLinearityType);
69 cls.def(
"setLinearityType", &AmpInfoRecord::setLinearityType,
"type"_a);
70 cls.def(
"getHasRawInfo", &AmpInfoRecord::getHasRawInfo);
71 cls.def(
"setHasRawInfo", &AmpInfoRecord::setHasRawInfo,
"hasRawInfo"_a);
72 cls.def(
"getRawBBox", &AmpInfoRecord::getRawBBox);
73 cls.def(
"setRawBBox", &AmpInfoRecord::setRawBBox,
"bbox"_a);
74 cls.def(
"getRawDataBBox", &AmpInfoRecord::getRawDataBBox);
75 cls.def(
"setRawDataBBox", &AmpInfoRecord::setRawDataBBox,
"bbox"_a);
76 cls.def(
"getRawFlipX", &AmpInfoRecord::getRawFlipX);
77 cls.def(
"setRawFlipX", &AmpInfoRecord::setRawFlipX,
"rawFlipX"_a);
78 cls.def(
"getRawFlipY", &AmpInfoRecord::getRawFlipY);
79 cls.def(
"setRawFlipY", &AmpInfoRecord::setRawFlipY,
"rawFlipY"_a);
80 cls.def(
"getRawXYOffset", &AmpInfoRecord::getRawXYOffset);
81 cls.def(
"setRawXYOffset", &AmpInfoRecord::setRawXYOffset,
"offset"_a);
82 cls.def(
"getRawHorizontalOverscanBBox", &AmpInfoRecord::getRawHorizontalOverscanBBox);
83 cls.def(
"setRawHorizontalOverscanBBox", &AmpInfoRecord::setRawHorizontalOverscanBBox,
"bbox"_a);
84 cls.def(
"getRawVerticalOverscanBBox", &AmpInfoRecord::getRawVerticalOverscanBBox);
85 cls.def(
"setRawVerticalOverscanBBox", &AmpInfoRecord::setRawVerticalOverscanBBox,
"bbox"_a);
86 cls.def(
"getRawPrescanBBox", &AmpInfoRecord::getRawPrescanBBox);
87 cls.def(
"setRawPrescanBBox", &AmpInfoRecord::setRawPrescanBBox,
"bbox"_a);
91 static PyAmpInfoTable declareAmpInfoTable(
py::module &mod) {
92 PyAmpInfoTable
cls(mod,
"AmpInfoTable");
93 cls.def_static(
"make", &AmpInfoTable::make);
94 cls.def_static(
"makeMinimalSchema", &AmpInfoTable::makeMinimalSchema);
95 cls.def_static(
"checkSchema", &AmpInfoTable::checkSchema,
"other"_a);
96 cls.def_static(
"getNameKey", &AmpInfoTable::getNameKey);
97 cls.def_static(
"getBBoxMinKey", &AmpInfoTable::getBBoxMinKey);
98 cls.def_static(
"getBBoxExtentKey", &AmpInfoTable::getBBoxExtentKey);
99 cls.def_static(
"getGainKey", &AmpInfoTable::getGainKey);
100 cls.def_static(
"getReadNoiseKey", &AmpInfoTable::getReadNoiseKey);
101 cls.def_static(
"getSaturationKey", &AmpInfoTable::getSaturationKey);
102 cls.def_static(
"getSuspectLevelKey", &AmpInfoTable::getSuspectLevelKey);
103 cls.def_static(
"getReadoutCornerKey", &AmpInfoTable::getReadoutCornerKey);
104 cls.def_static(
"getLinearityCoeffsKey", &AmpInfoTable::getLinearityCoeffsKey);
105 cls.def_static(
"getLinearityTypeKey", &AmpInfoTable::getLinearityTypeKey);
106 cls.def_static(
"getHasRawInfoKey", &AmpInfoTable::getHasRawInfoKey);
107 cls.def_static(
"getRawBBoxMinKey", &AmpInfoTable::getRawBBoxMinKey);
108 cls.def_static(
"getRawBBoxExtentKey", &AmpInfoTable::getRawBBoxExtentKey);
109 cls.def_static(
"getRawDataBBoxMinKey", &AmpInfoTable::getRawDataBBoxMinKey);
110 cls.def_static(
"getRawDataBBoxExtentKey", &AmpInfoTable::getRawDataBBoxExtentKey);
111 cls.def_static(
"getRawFlipXKey", &AmpInfoTable::getRawFlipXKey);
112 cls.def_static(
"getRawFlipYKey", &AmpInfoTable::getRawFlipYKey);
113 cls.def_static(
"getRawXYOffsetKey", &AmpInfoTable::getRawXYOffsetKey);
114 cls.def_static(
"getRawHorizontalOverscanBBoxMinKey", &AmpInfoTable::getRawHorizontalOverscanBBoxMinKey);
115 cls.def_static(
"getRawHorizontalOverscanBBoxExtentKey",
116 &AmpInfoTable::getRawHorizontalOverscanBBoxExtentKey);
117 cls.def_static(
"getRawVerticalOverscanBBoxMinKey", &AmpInfoTable::getRawVerticalOverscanBBoxMinKey);
118 cls.def_static(
"getRawVerticalOverscanBBoxExtentKey", &AmpInfoTable::getRawVerticalOverscanBBoxExtentKey);
119 cls.def_static(
"getRawPrescanBBoxMinKey", &AmpInfoTable::getRawPrescanBBoxMinKey);
120 cls.def_static(
"getRawPrescanBBoxExtentKey", &AmpInfoTable::getRawPrescanBBoxExtentKey);
123 cls.def(
"makeRecord", &AmpInfoTable::makeRecord);
124 cls.def(
"copyRecord",
127 cls.def(
"copyRecord",
129 AmpInfoTable::copyRecord,
130 "other"_a,
"mapper"_a);
135 py::enum_<ReadoutCorner>(mod,
"ReadoutCorner")
142 auto clsAmpInfoRecord = declareAmpInfoRecord(mod);
143 auto clsAmpInfoTable = declareAmpInfoTable(mod);
144 auto clsAmpInfoColumnView = table::python::declareColumnView<AmpInfoRecord>(mod,
"AmpInfo");
145 auto clsAmpInfoCatalog = table::python::declareCatalog<AmpInfoRecord>(mod,
"AmpInfo");
147 clsAmpInfoRecord.attr(
"Table") = clsAmpInfoTable;
148 clsAmpInfoRecord.attr(
"ColumnView") = clsAmpInfoColumnView;
149 clsAmpInfoRecord.attr(
"Catalog") = clsAmpInfoCatalog;
150 clsAmpInfoTable.attr(
"Record") = clsAmpInfoRecord;
151 clsAmpInfoTable.attr(
"ColumnView") = clsAmpInfoColumnView;
152 clsAmpInfoTable.attr(
"Catalog") = clsAmpInfoCatalog;
153 clsAmpInfoCatalog.attr(
"Record") = clsAmpInfoRecord;
154 clsAmpInfoCatalog.attr(
"Table") = clsAmpInfoTable;
155 clsAmpInfoCatalog.attr(
"ColumnView") = clsAmpInfoColumnView;
PYBIND11_MODULE(camera, mod)
A base class for image defects.