24#include "pybind11/pybind11.h"
26#include "pybind11/stl.h"
28#include "ndarray/pybind11.h"
34using namespace pybind11::literals;
40using PyAmplifier = py::class_<Amplifier, std::shared_ptr<Amplifier>>;
41using 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);
55 auto amplifier = wrappers.
wrapType(
PyAmplifier(wrappers.module,
"Amplifier"), [](
auto &mod,
auto &cls) {
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);
100 ndarray::Array<double, 1, 1> array = ndarray::allocate(coeffs.
size());
A mutable Amplifier subclass class that can be used to incrementally construct or modify Amplifiers.
void setSaturation(double saturation)
Level in ADU above which pixels are considered saturated; use nan if no such level applies.
void setRawParallelOverscanBBox(lsst::geom::Box2I const &bbox)
The bounding box of parallel overscan pixels (equivalent to vertical overscan pixels) in the image to...
void setBBox(lsst::geom::Box2I const &bbox)
Bounding box of amplifier pixels in the trimmed, assembled image.
void setRawFlipY(bool rawFlipY)
Is this amplifier (and the image to which it is attached) flipped in the Y direction,...
void setReadNoise(double readNoise)
Amplifier read noise, in e-.
void setLinearityThreshold(double threshold)
Level in ADU above which linearity should be applied.
void setLinearityCoeffs(ndarray::Array< double const, 1, 1 > const &coeffs)
Vector of linearity coefficients.
void setRawSerialOverscanBBox(lsst::geom::Box2I const &bbox)
The bounding box of serial overscan pixels (equivalent to horizontal overscan pixels) in the image to...
void setRawHorizontalPrescanBBox(lsst::geom::Box2I const &bbox)
The bounding box of horizontal/serial prescan pixels in the image to which it is attached,...
static Builder fromRecord(table::BaseRecord const &record)
Construct a new Builder object from the fields in the given record.
void setRawHorizontalOverscanBBox(lsst::geom::Box2I const &bbox)
The bounding box of horizontal overscan pixels in the image to which it is attached,...
void setRawFlipX(bool rawFlipX)
Is this amplifier (and the image to which it is attached) flipped in the X direction,...
void setGain(double gain)
Amplifier gain in e-/ADU.
void setReadoutCorner(ReadoutCorner readoutCorner)
Readout corner in the trimmed, assembled image.
void setRawDataBBox(lsst::geom::Box2I const &bbox)
Bounding box of amplifier data pixels in the image to which it is attached, which is assumed to be un...
std::shared_ptr< Amplifier const > finish() const
Construct an immutable Amplifier with the same values as the Builder.
void setLinearityMaximum(double maximum)
Level in ADU above which the linearity relation is poorly defined.
void setSuspectLevel(double suspectLevel)
Level in ADU above which pixels are considered suspicious, meaning they may be affected by unknown sy...
void setLinearityType(std::string const &type)
Name of linearity parameterization.
void setRawVerticalOverscanBBox(lsst::geom::Box2I const &bbox)
The bounding box of vertical overscan pixels in the image to which it is attached,...
void setRawXYOffset(lsst::geom::Extent2I const &xy)
Offset in transformation from this amplifier (and the image to which it is attached) to trimmed,...
void setRawPrescanBBox(lsst::geom::Box2I const &bbox)
The bounding box of (horizontal) prescan pixels in the image to which it is attached,...
void setRawSerialPrescanBBox(lsst::geom::Box2I const &bbox)
The bounding box of horizontal/serial prescan pixels in the image to which it is attached,...
void setName(std::string const &name)
Name of the amplifier.
void setLinearityUnits(std::string const &units)
Units for the input to the linearity relation (DN).
void setRawBBox(lsst::geom::Box2I const &bbox)
Bounding box of the untrimmed amplifier in the image to which it is attached, which is assumed to be ...
Geometry and electronic information about raw amplifier images.
A helper class for subdividing pybind11 module across multiple translation units (i....
void addInheritanceDependency(std::string const &name)
Indicate an external module that provides a base class for a subsequent addType call.
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...
py::class_< Amplifier, std::shared_ptr< Amplifier > > PyAmplifier
py::class_< Amplifier::Builder, Amplifier, std::shared_ptr< Amplifier::Builder > > PyAmplifierBuilder
void wrapAmplifier(lsst::cpputils::python::WrapperCollection &wrappers)