22 #include "pybind11/pybind11.h" 23 #include "pybind11/stl.h" 27 #include "lsst/pex/config/python.h" 28 #include "lsst/afw/table/Match.h" 31 namespace py = pybind11;
39 static void declareOutlierRejectionControl(py::module& mod) {
40 py::class_<OutlierRejectionControl> cls(mod,
"OutlierRejectionControl");
42 cls.def(py::init<>());
44 LSST_DECLARE_CONTROL_FIELD(cls, OutlierRejectionControl, nSigma);
45 LSST_DECLARE_CONTROL_FIELD(cls, OutlierRejectionControl, nClipMin);
46 LSST_DECLARE_CONTROL_FIELD(cls, OutlierRejectionControl, nClipMax);
49 static void declareScaledPolynomialTransformFitter(py::module& mod) {
50 py::class_<ScaledPolynomialTransformFitter> cls(mod,
"ScaledPolynomialTransformFitter");
52 cls.def_static(
"fromMatches", &ScaledPolynomialTransformFitter::fromMatches);
53 cls.def_static(
"fromGrid", &ScaledPolynomialTransformFitter::fromGrid);
54 cls.def(
"fit", &ScaledPolynomialTransformFitter::fit,
"order"_a = -1);
55 cls.def(
"updateModel", &ScaledPolynomialTransformFitter::updateModel);
56 cls.def(
"updateIntrinsicScatter", &ScaledPolynomialTransformFitter::updateIntrinsicScatter);
57 cls.def(
"getIntrinsicScatter", &ScaledPolynomialTransformFitter::getIntrinsicScatter);
58 cls.def(
"rejectOutliers", &ScaledPolynomialTransformFitter::rejectOutliers,
"ctrl"_a);
59 cls.def(
"getData", &ScaledPolynomialTransformFitter::getData,
60 py::return_value_policy::reference_internal);
61 cls.def(
"getTransform", &ScaledPolynomialTransformFitter::getTransform, py::return_value_policy::copy);
62 cls.def(
"getPoly", &ScaledPolynomialTransformFitter::getPoly, py::return_value_policy::copy);
63 cls.def(
"getInputScaling", &ScaledPolynomialTransformFitter::getInputScaling,
64 py::return_value_policy::copy);
65 cls.def(
"getOutputScaling", &ScaledPolynomialTransformFitter::getOutputScaling,
66 py::return_value_policy::copy);
72 py::module mod(
"scaledPolynomialTransformFitter");
74 declareOutlierRejectionControl(mod);
75 declareScaledPolynomialTransformFitter(mod);
PYBIND11_PLUGIN(scaledPolynomialTransformFitter)