24 #include "pybind11/pybind11.h"
26 #include "pybind11/stl.h"
28 #include "ndarray/pybind11.h"
34 using namespace pybind11::literals;
38 namespace cameraGeom {
40 using PyAmplifier = py::class_<Amplifier, std::shared_ptr<Amplifier>>;
41 using PyAmplifierBuilder = py::class_<Amplifier::Builder, Amplifier, std::shared_ptr<Amplifier::Builder>>;
45 wrappers.
wrapType(py::enum_<ReadoutCorner>(wrappers.
module,
"ReadoutCorner"), [](
auto &mod,
auto &enm) {
46 enm.value(
"LL", ReadoutCorner::LL);
47 enm.value(
"LR", ReadoutCorner::LR);
48 enm.value(
"UR", ReadoutCorner::UR);
49 enm.value(
"UL", ReadoutCorner::UL);
51 wrappers.
wrapType(py::enum_<AssemblyState>(wrappers.
module,
"AssemblyState"), [](
auto &mod,
auto &enm) {
52 enm.value(
"RAW", AssemblyState::RAW);
53 enm.value(
"SCIENCE", AssemblyState::SCIENCE);
56 cls.def_static(
"getRecordSchema", &Amplifier::getRecordSchema);
57 cls.def(
"toRecord", &Amplifier::toRecord);
58 cls.def(
"rebuild", &Amplifier::rebuild);
59 cls.def(
"getName", &Amplifier::getName);
60 cls.def(
"getBBox", &Amplifier::getBBox);
61 cls.def(
"getGain", &Amplifier::getGain);
62 cls.def(
"getReadNoise", &Amplifier::getReadNoise);
63 cls.def(
"getSaturation", &Amplifier::getSaturation);
64 cls.def(
"getSuspectLevel", &Amplifier::getSuspectLevel);
65 cls.def(
"getReadoutCorner", &Amplifier::getReadoutCorner);
66 cls.def(
"getLinearityCoeffs", &Amplifier::getLinearityCoeffs);
67 cls.def(
"getLinearityType", &Amplifier::getLinearityType);
68 cls.def(
"getLinearityThreshold", &Amplifier::getLinearityThreshold);
69 cls.def(
"getLinearityMaximum", &Amplifier::getLinearityMaximum);
70 cls.def(
"getLinearityUnits", &Amplifier::getLinearityUnits);
71 cls.def(
"getRawBBox", &Amplifier::getRawBBox);
72 cls.def(
"getRawDataBBox", &Amplifier::getRawDataBBox);
73 cls.def(
"getRawFlipX", &Amplifier::getRawFlipX);
74 cls.def(
"getRawFlipY", &Amplifier::getRawFlipY);
75 cls.def(
"getRawXYOffset", &Amplifier::getRawXYOffset);
76 cls.def(
"getRawHorizontalOverscanBBox", &Amplifier::getRawHorizontalOverscanBBox);
77 cls.def(
"getRawVerticalOverscanBBox", &Amplifier::getRawVerticalOverscanBBox);
78 cls.def(
"getRawPrescanBBox", &Amplifier::getRawPrescanBBox);
79 cls.def(
"getRawSerialOverscanBBox", &Amplifier::getRawSerialOverscanBBox);
80 cls.def(
"getRawParallelOverscanBBox", &Amplifier::getRawParallelOverscanBBox);
81 cls.def(
"getRawSerialPrescanBBox", &Amplifier::getRawSerialPrescanBBox);
82 cls.def(
"getRawHorizontalPrescanBBox", &Amplifier::getRawHorizontalPrescanBBox);
85 cls.def_static(
"fromRecord", &Amplifier::Builder::fromRecord);
87 cls.def(
"finish", &Amplifier::Builder::finish);
89 cls.def(
"setName", &Amplifier::Builder::setName,
"name"_a);
90 cls.def(
"setBBox", &Amplifier::Builder::setBBox,
"bbox"_a);
91 cls.def(
"setGain", &Amplifier::Builder::setGain,
"gain"_a);
92 cls.def(
"setReadNoise", &Amplifier::Builder::setReadNoise,
"readNoise"_a);
93 cls.def(
"setSaturation", &Amplifier::Builder::setSaturation,
"saturation"_a);
94 cls.def(
"setSuspectLevel", &Amplifier::Builder::setSuspectLevel,
"suspectLevel"_a);
95 cls.def(
"setReadoutCorner", &Amplifier::Builder::setReadoutCorner,
"corner"_a);
96 cls.def(
"setLinearityCoeffs", &Amplifier::Builder::setLinearityCoeffs,
"coeffs"_a);
100 ndarray::Array<double, 1, 1> array = ndarray::allocate(coeffs.
size());
102 self.setLinearityCoeffs(array);
104 cls.def(
"setLinearityType", &Amplifier::Builder::setLinearityType,
"type"_a);
105 cls.def(
"setLinearityThreshold", &Amplifier::Builder::setLinearityThreshold,
"threshold"_a);
106 cls.def(
"setLinearityMaximum", &Amplifier::Builder::setLinearityMaximum,
"maximum"_a);
107 cls.def(
"setLinearityUnits", &Amplifier::Builder::setLinearityUnits,
"units"_a);
108 cls.def(
"setRawBBox", &Amplifier::Builder::setRawBBox,
"bbox"_a);
109 cls.def(
"setRawDataBBox", &Amplifier::Builder::setRawDataBBox,
"bbox"_a);
110 cls.def(
"setRawFlipX", &Amplifier::Builder::setRawFlipX,
"rawFlipX"_a);
111 cls.def(
"setRawFlipY", &Amplifier::Builder::setRawFlipY,
"rawFlipY"_a);
112 cls.def(
"setRawXYOffset", &Amplifier::Builder::setRawXYOffset,
"offset"_a);
113 cls.def(
"setRawHorizontalOverscanBBox", &Amplifier::Builder::setRawHorizontalOverscanBBox,
"bbox"_a);
114 cls.def(
"setRawVerticalOverscanBBox", &Amplifier::Builder::setRawVerticalOverscanBBox,
"bbox"_a);
115 cls.def(
"setRawPrescanBBox", &Amplifier::Builder::setRawPrescanBBox,
"bbox"_a);
116 cls.def(
"setRawSerialOverscanBBox", &Amplifier::Builder::setRawSerialOverscanBBox,
"bbox"_a);
117 cls.def(
"setRawParallelOverscanBBox", &Amplifier::Builder::setRawParallelOverscanBBox,
"bbox"_a);
118 cls.def(
"setRawSerialPrescanBBox", &Amplifier::Builder::setRawSerialPrescanBBox,
"bbox"_a);
119 cls.def(
"setRawHorizontalPrescanBBox", &Amplifier::Builder::setRawHorizontalPrescanBBox,
"bbox"_a);
ItemVariant const * other
A mutable Amplifier subclass class that can be used to incrementally construct or modify Amplifiers.
Geometry and electronic information about raw amplifier images.
A helper class for subdividing pybind11 module across multiple translation units (i....
pybind11::module module
The module object passed to the PYBIND11_MODULE block that contains this WrapperCollection.
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...
void addInheritanceDependency(std::string const &name)
Indicate an external module that provides a base class for a subsequent addType call.
py::class_< Amplifier::Builder, Amplifier, std::shared_ptr< Amplifier::Builder > > PyAmplifierBuilder
void wrapAmplifier(lsst::utils::python::WrapperCollection &wrappers)
py::class_< Amplifier, std::shared_ptr< Amplifier > > PyAmplifier
A base class for image defects.