22 #include "pybind11/pybind11.h"
23 #include "pybind11/stl.h"
24 #include "pybind11/eigen.h"
26 #include "ndarray/pybind11.h"
31 using namespace pybind11::literals;
33 namespace lsst {
namespace afw {
namespace geom {
namespace {
35 using PySipApproximation = py::class_<SipApproximation, std::shared_ptr<SipApproximation>>;
38 py::module::import(
"lsst.geom");
39 py::module::import(
"lsst.afw.geom.transform");
41 PySipApproximation
cls(mod,
"SipApproximation");
47 Eigen::MatrixXd
const &,
54 "pixelToIwc"_a,
"crpix"_a,
"cd"_a,
"bbox"_a,
"gridShape"_a,
"order"_a,
55 "useInverse"_a=
true,
"svdThreshold"_a=-1
62 Eigen::MatrixXd
const &,
65 ndarray::Array<double const, 2>
const &,
66 ndarray::Array<double const, 2>
const &,
67 ndarray::Array<double const, 2>
const &,
68 ndarray::Array<double const, 2>
const &,
71 "pixelToIwc"_a,
"crpix"_a,
"cd"_a,
"bbox"_a,
"gridShape"_a,
72 "a"_a,
"b"_a,
"ap"_a,
"bp"_a,
"useInverse"_a=
true
79 cls.def(
"getOrder", &SipApproximation::getOrder);
80 cls.def(
"getA", py::overload_cast<int, int>(&SipApproximation::getA, py::const_),
"p"_a,
"q"_a);
81 cls.def(
"getB", py::overload_cast<int, int>(&SipApproximation::getB, py::const_),
"p"_a,
"q"_a);
82 cls.def(
"getAP", py::overload_cast<int, int>(&SipApproximation::getAP, py::const_),
"p"_a,
"q"_a);
83 cls.def(
"getBP", py::overload_cast<int, int>(&SipApproximation::getBP, py::const_),
"p"_a,
"q"_a);
84 cls.def(
"getA", py::overload_cast<>(&SipApproximation::getA, py::const_));
85 cls.def(
"getB", py::overload_cast<>(&SipApproximation::getB, py::const_));
86 cls.def(
"getAP", py::overload_cast<>(&SipApproximation::getAP, py::const_));
87 cls.def(
"getBP", py::overload_cast<>(&SipApproximation::getBP, py::const_));
88 cls.def(
"applyForward", (ScalarTransform)&SipApproximation::applyForward);
89 cls.def(
"applyForward", (VectorTransform)&SipApproximation::applyForward);
90 cls.def(
"applyInverse", (ScalarTransform)&SipApproximation::applyInverse);
91 cls.def(
"applyInverse", (VectorTransform)&SipApproximation::applyInverse);
92 cls.def(
"getGridStep", &SipApproximation::getGridStep);
93 cls.def(
"getGridShape", &SipApproximation::getGridShape);
94 cls.def(
"getBBox", &SipApproximation::getBBox);
95 cls.def(
"getPixelOrigin", &SipApproximation::getPixelOrigin);
96 cls.def(
"getCdMatrix", &SipApproximation::getCdMatrix);
97 cls.def(
"updateGrid", &SipApproximation::updateGrid,
"shape"_a);
98 cls.def(
"refineGrid", &SipApproximation::refineGrid,
"factor"_a=2);
99 cls.def(
"fit", &SipApproximation::fit,
"order"_a,
"svdThreshold"_a=-1);
100 cls.def(
"computeMaxDeviation", &SipApproximation::computeMaxDeviation);