77 wrappers.
wrapType(py::enum_<UndersampleStyle>(wrappers.
module,
"UndersampleStyle"),
78 [](
auto &mod,
auto &enm) {
79 enm.value(
"THROW_EXCEPTION", UndersampleStyle::THROW_EXCEPTION);
80 enm.value(
"REDUCE_INTERP_ORDER", UndersampleStyle::REDUCE_INTERP_ORDER);
81 enm.value(
"INCREASE_NXNYSAMPLE", UndersampleStyle::INCREASE_NXNYSAMPLE);
85 using PyBackgroundControl = py::classh<BackgroundControl>;
86 wrappers.
wrapType(PyBackgroundControl(wrappers.
module,
"BackgroundControl"), [](
auto &mod,
auto &cls) {
88 cls.def(py::init<int const, int const, StatisticsControl const, Property const,
89 ApproximateControl const>(),
90 "nxSample"_a,
"nySample"_a,
"sctrl"_a = StatisticsControl(),
"prop"_a = MEANCLIP,
91 "actrl"_a = ApproximateControl(ApproximateControl::UNKNOWN, 1));
92 cls.def(py::init<int const, int const, StatisticsControl const, std::string const &,
93 ApproximateControl const>(),
94 "nxSample"_a,
"nySample"_a,
"sctrl"_a,
"prop"_a,
95 "actrl"_a = ApproximateControl(ApproximateControl::UNKNOWN, 1));
96 cls.def(py::init<Interpolate::Style const, int const, int const, UndersampleStyle const,
97 StatisticsControl const, Property const, ApproximateControl const>(),
98 "style"_a,
"nxSample"_a = 10,
"nySample"_a = 10,
"undersampleStyle"_a = THROW_EXCEPTION,
99 "sctrl"_a = StatisticsControl(),
"prop"_a = MEANCLIP,
100 "actrl"_a = ApproximateControl(ApproximateControl::UNKNOWN, 1));
101 cls.def(py::init<std::string const &, int const, int const, std::string const &,
102 StatisticsControl const, std::string const &, ApproximateControl const>(),
103 "style"_a,
"nxSample"_a = 10,
"nySample"_a = 10,
"undersampleStyle"_a =
"THROW_EXCEPTION",
104 "sctrl"_a = StatisticsControl(),
"prop"_a =
"MEANCLIP",
105 "actrl"_a = ApproximateControl(ApproximateControl::UNKNOWN, 1));
108 cls.def(
"setNxSample", &BackgroundControl::setNxSample);
109 cls.def(
"setNySample", &BackgroundControl::setNySample);
110 cls.def(
"setInterpStyle",
111 (void (BackgroundControl::*)(Interpolate::Style const)) & BackgroundControl::setInterpStyle);
112 cls.def(
"setInterpStyle",
113 (void (BackgroundControl::*)(std::string const &)) & BackgroundControl::setInterpStyle);
114 cls.def(
"setUndersampleStyle", (void (BackgroundControl::*)(UndersampleStyle const)) &
115 BackgroundControl::setUndersampleStyle);
116 cls.def(
"setUndersampleStyle",
117 (void (BackgroundControl::*)(std::string const &)) & BackgroundControl::setUndersampleStyle);
118 cls.def(
"getNxSample", &BackgroundControl::getNxSample);
119 cls.def(
"getNySample", &BackgroundControl::getNySample);
120 cls.def(
"getInterpStyle", &BackgroundControl::getInterpStyle);
121 cls.def(
"getUndersampleStyle", &BackgroundControl::getUndersampleStyle);
122 cls.def(
"getStatisticsControl", (std::shared_ptr<StatisticsControl>(BackgroundControl::*)()) &
123 BackgroundControl::getStatisticsControl);
124 cls.def(
"getStatisticsProperty", &BackgroundControl::getStatisticsProperty);
125 cls.def(
"setStatisticsProperty",
126 (void (BackgroundControl::*)(Property)) & BackgroundControl::setStatisticsProperty);
127 cls.def(
"setStatisticsProperty",
128 (void (BackgroundControl::*)(std::string)) & BackgroundControl::setStatisticsProperty);
129 cls.def(
"setApproximateControl", &BackgroundControl::setApproximateControl);
130 cls.def(
"getApproximateControl", (std::shared_ptr<ApproximateControl>(BackgroundControl::*)()) &
131 BackgroundControl::getApproximateControl);
133 using PyBackground = py::classh<Background>;
134 wrappers.
wrapType(PyBackground(wrappers.
module,
"Background"), [](
auto &mod,
auto &cls) {
136 declareGetImage<float>(cls,
"F");
138 cls.def(
"getAsUsedInterpStyle", &Background::getAsUsedInterpStyle);
139 cls.def(
"getAsUsedUndersampleStyle", &Background::getAsUsedUndersampleStyle);
140 cls.def(
"getApproximate", &Background::getApproximate,
"actrl"_a,
141 "undersampleStyle"_a = THROW_EXCEPTION);
142 cls.def(
"getBackgroundControl",
143 (std::shared_ptr<BackgroundControl>(Background::*)()) & Background::getBackgroundControl);
146 using PyBackgroundMI = py::classh<BackgroundMI, Background>;
147 wrappers.
wrapType(PyBackgroundMI(wrappers.
module,
"BackgroundMI"), [](
auto &mod,
auto &cls) {
149 cls.def(py::init<lsst::geom::Box2I const,
150 image::MaskedImage<typename Background::InternalPixelT> const &>(),
151 "imageDimensions"_a,
"statsImage"_a);
154 cls.def(
"__iadd__", &BackgroundMI::operator+=);
155 cls.def(
"__isub__", &BackgroundMI::operator-=);
158 cls.def(
"getStatsImage", &BackgroundMI::getStatsImage);
159 cls.def(
"getImageBBox", &BackgroundMI::getImageBBox);
160 cls.def(
"getBinCentersX", &BackgroundMI::getBinCentersX);
161 cls.def(
"getBinCentersY", &BackgroundMI::getBinCentersY);