75 wrappers.
wrapType(py::enum_<UndersampleStyle>(wrappers.module,
"UndersampleStyle"),
76 [](
auto &mod,
auto &enm) {
77 enm.value(
"THROW_EXCEPTION", UndersampleStyle::THROW_EXCEPTION);
78 enm.value(
"REDUCE_INTERP_ORDER", UndersampleStyle::REDUCE_INTERP_ORDER);
79 enm.value(
"INCREASE_NXNYSAMPLE", UndersampleStyle::INCREASE_NXNYSAMPLE);
83 using PyBackgroundControl = py::class_<BackgroundControl, std::shared_ptr<BackgroundControl>>;
84 wrappers.
wrapType(PyBackgroundControl(wrappers.module,
"BackgroundControl"), [](
auto &mod,
auto &cls) {
86 cls.def(py::init<int const, int const, StatisticsControl const, Property const,
87 ApproximateControl const>(),
88 "nxSample"_a,
"nySample"_a,
"sctrl"_a = StatisticsControl(),
"prop"_a = MEANCLIP,
89 "actrl"_a = ApproximateControl(ApproximateControl::UNKNOWN, 1));
90 cls.def(py::init<int const, int const, StatisticsControl const, std::string const &,
91 ApproximateControl const>(),
92 "nxSample"_a,
"nySample"_a,
"sctrl"_a,
"prop"_a,
93 "actrl"_a = ApproximateControl(ApproximateControl::UNKNOWN, 1));
94 cls.def(py::init<Interpolate::Style const, int const, int const, UndersampleStyle const,
95 StatisticsControl const, Property const, ApproximateControl const>(),
96 "style"_a,
"nxSample"_a = 10,
"nySample"_a = 10,
"undersampleStyle"_a = THROW_EXCEPTION,
97 "sctrl"_a = StatisticsControl(),
"prop"_a = MEANCLIP,
98 "actrl"_a = ApproximateControl(ApproximateControl::UNKNOWN, 1));
99 cls.def(py::init<std::string const &, int const, int const, std::string const &,
100 StatisticsControl const, std::string const &, ApproximateControl const>(),
101 "style"_a,
"nxSample"_a = 10,
"nySample"_a = 10,
"undersampleStyle"_a =
"THROW_EXCEPTION",
102 "sctrl"_a = StatisticsControl(),
"prop"_a =
"MEANCLIP",
103 "actrl"_a = ApproximateControl(ApproximateControl::UNKNOWN, 1));
106 cls.def(
"setNxSample", &BackgroundControl::setNxSample);
107 cls.def(
"setNySample", &BackgroundControl::setNySample);
108 cls.def(
"setInterpStyle",
109 (void (BackgroundControl::*)(Interpolate::Style const)) & BackgroundControl::setInterpStyle);
110 cls.def(
"setInterpStyle",
111 (void (BackgroundControl::*)(std::string const &)) & BackgroundControl::setInterpStyle);
112 cls.def(
"setUndersampleStyle", (void (BackgroundControl::*)(UndersampleStyle const)) &
113 BackgroundControl::setUndersampleStyle);
114 cls.def(
"setUndersampleStyle",
115 (void (BackgroundControl::*)(std::string const &)) & BackgroundControl::setUndersampleStyle);
116 cls.def(
"getNxSample", &BackgroundControl::getNxSample);
117 cls.def(
"getNySample", &BackgroundControl::getNySample);
118 cls.def(
"getInterpStyle", &BackgroundControl::getInterpStyle);
119 cls.def(
"getUndersampleStyle", &BackgroundControl::getUndersampleStyle);
120 cls.def(
"getStatisticsControl", (std::shared_ptr<StatisticsControl>(BackgroundControl::*)()) &
121 BackgroundControl::getStatisticsControl);
122 cls.def(
"getStatisticsProperty", &BackgroundControl::getStatisticsProperty);
123 cls.def(
"setStatisticsProperty",
124 (void (BackgroundControl::*)(Property)) & BackgroundControl::setStatisticsProperty);
125 cls.def(
"setStatisticsProperty",
126 (void (BackgroundControl::*)(std::string)) & BackgroundControl::setStatisticsProperty);
127 cls.def(
"setApproximateControl", &BackgroundControl::setApproximateControl);
128 cls.def(
"getApproximateControl", (std::shared_ptr<ApproximateControl>(BackgroundControl::*)()) &
129 BackgroundControl::getApproximateControl);
131 using PyBackground = py::class_<Background, std::shared_ptr<Background>>;
132 wrappers.
wrapType(PyBackground(wrappers.module,
"Background"), [](
auto &mod,
auto &cls) {
134 declareGetImage<float>(cls,
"F");
136 cls.def(
"getAsUsedInterpStyle", &Background::getAsUsedInterpStyle);
137 cls.def(
"getAsUsedUndersampleStyle", &Background::getAsUsedUndersampleStyle);
138 cls.def(
"getApproximate", &Background::getApproximate,
"actrl"_a,
139 "undersampleStyle"_a = THROW_EXCEPTION);
140 cls.def(
"getBackgroundControl",
141 (std::shared_ptr<BackgroundControl>(Background::*)()) & Background::getBackgroundControl);
144 using PyBackgroundMI = py::class_<BackgroundMI, std::shared_ptr<BackgroundMI>,
Background>;
145 wrappers.
wrapType(PyBackgroundMI(wrappers.module,
"BackgroundMI"), [](
auto &mod,
auto &cls) {
147 cls.def(py::init<lsst::geom::Box2I const,
148 image::MaskedImage<typename Background::InternalPixelT> const &>(),
149 "imageDimensions"_a,
"statsImage"_a);
152 cls.def(
"__iadd__", &BackgroundMI::operator+=);
153 cls.def(
"__isub__", &BackgroundMI::operator-=);
156 cls.def(
"getStatsImage", &BackgroundMI::getStatsImage);
157 cls.def(
"getImageBBox", &BackgroundMI::getImageBBox);