23 #include "pybind11/pybind11.h" 24 #include "pybind11/stl.h" 28 namespace py = pybind11;
36 using PyXYTransform = py::class_<XYTransform, std::shared_ptr<XYTransform>>;
38 using PyIdentityXYTransform =
39 py::class_<IdentityXYTransform, std::shared_ptr<IdentityXYTransform>, XYTransform>;
41 using PyInvertedXYTransform =
42 py::class_<InvertedXYTransform, std::shared_ptr<InvertedXYTransform>, XYTransform>;
44 using PyMultiXYTransform = py::class_<MultiXYTransform, std::shared_ptr<MultiXYTransform>, XYTransform>;
46 using PyAffineXYTransfrom = py::class_<AffineXYTransform, std::shared_ptr<AffineXYTransform>, XYTransform>;
48 using PyRadialXYTransform = py::class_<RadialXYTransform, std::shared_ptr<RadialXYTransform>, XYTransform>;
53 py::module::import(
"lsst.afw.geom.coordinates");
54 py::module::import(
"lsst.afw.geom.affineTransform");
56 PyXYTransform clsXYTransform(mod,
"XYTransform");
58 clsXYTransform.def(
"invert", &XYTransform::invert);
59 clsXYTransform.def(
"forwardTransform", &XYTransform::forwardTransform);
60 clsXYTransform.def(
"reverseTransform", &XYTransform::reverseTransform);
61 clsXYTransform.def(
"linearizeForwardTransform", &XYTransform::linearizeForwardTransform);
62 clsXYTransform.def(
"linearizeReverseTransform", &XYTransform::linearizeReverseTransform);
64 PyIdentityXYTransform clsIdentityXYTransform(mod,
"IdentityXYTransform");
65 clsIdentityXYTransform.def(py::init<>());
66 clsIdentityXYTransform.def(
"forwardTransform", &IdentityXYTransform::forwardTransform);
67 clsIdentityXYTransform.def(
"reverseTransform", &IdentityXYTransform::reverseTransform);
68 clsIdentityXYTransform.def(
"linearizeForwardTransform", &IdentityXYTransform::linearizeForwardTransform);
69 clsIdentityXYTransform.def(
"linearizeReverseTransform", &IdentityXYTransform::linearizeReverseTransform);
71 PyInvertedXYTransform clsInvertedXYTransform(mod,
"InvertedXYTransform");
73 clsInvertedXYTransform.def(
"invert", &InvertedXYTransform::invert);
74 clsInvertedXYTransform.def(
"forwardTransform", &InvertedXYTransform::forwardTransform);
75 clsInvertedXYTransform.def(
"reverseTransform", &InvertedXYTransform::reverseTransform);
76 clsInvertedXYTransform.def(
"linearizeForwardTransform", &InvertedXYTransform::linearizeForwardTransform);
77 clsInvertedXYTransform.def(
"linearizeReverseTransform", &InvertedXYTransform::linearizeReverseTransform);
79 PyMultiXYTransform clsMultiXYTransform(mod,
"MultiXYTransform");
80 clsMultiXYTransform.def(py::init<MultiXYTransform::TransformList const &>());
82 clsMultiXYTransform.def(
"forwardTransform", &MultiXYTransform::forwardTransform);
83 clsMultiXYTransform.def(
"reverseTransform", &MultiXYTransform::reverseTransform);
84 clsMultiXYTransform.def(
"linearizeForwardTransform", &MultiXYTransform::linearizeForwardTransform);
85 clsMultiXYTransform.def(
"linearizeReverseTransform", &MultiXYTransform::linearizeReverseTransform);
86 clsMultiXYTransform.def(
"getTransformList", &MultiXYTransform::getTransformList);
88 PyAffineXYTransfrom clsAffineXYTransform(mod,
"AffineXYTransform");
89 clsAffineXYTransform.def(py::init<AffineTransform const &>());
92 clsAffineXYTransform.def(
"forwardTransform", &AffineXYTransform::forwardTransform);
93 clsAffineXYTransform.def(
"reverseTransform", &AffineXYTransform::reverseTransform);
94 clsAffineXYTransform.def(
"linearizeForwardTransform", &AffineXYTransform::linearizeForwardTransform);
95 clsAffineXYTransform.def(
"linearizeReverseTransform", &AffineXYTransform::linearizeReverseTransform);
96 clsAffineXYTransform.def(
"getForwardTransform", &AffineXYTransform::getForwardTransform);
97 clsAffineXYTransform.def(
"getReverseTransform", &AffineXYTransform::getReverseTransform);
99 PyRadialXYTransform clsRadialXYTransform(mod,
"RadialXYTransform");
102 clsRadialXYTransform.def(
"invert", &RadialXYTransform::invert);
103 clsRadialXYTransform.def(
"forwardTransform", &RadialXYTransform::forwardTransform);
104 clsRadialXYTransform.def(
"reverseTransform", &RadialXYTransform::reverseTransform);
105 clsRadialXYTransform.def(
"linearizeForwardTransform", &RadialXYTransform::linearizeForwardTransform);
106 clsRadialXYTransform.def(
"linearizeReverseTransform", &RadialXYTransform::linearizeReverseTransform);
107 clsRadialXYTransform.def(
"getCoeffs", &RadialXYTransform::getCoeffs);
108 clsRadialXYTransform.def_static(
"polyInvert", &RadialXYTransform::polyInvert);
109 clsRadialXYTransform.def_static(
110 "polyEval", (
double (*)(
std::vector<double> const &,
double)) & RadialXYTransform::polyEval);
112 RadialXYTransform::polyEval);
113 clsRadialXYTransform.def_static(
"polyEvalDeriv", &RadialXYTransform::polyEvalDeriv);
114 clsRadialXYTransform.def_static(
"polyEvalJacobian", &RadialXYTransform::polyEvalJacobian);
115 clsRadialXYTransform.def_static(
"polyEvalInverse", (
double (*)(
std::vector<double> const &,
117 RadialXYTransform::polyEvalInverse);
118 clsRadialXYTransform.def_static(
121 RadialXYTransform::polyEvalInverse);
122 clsRadialXYTransform.def_static(
"polyEvalInverseJacobian", &RadialXYTransform::polyEvalInverseJacobian);
123 clsRadialXYTransform.def_static(
"makeAffineTransform", &RadialXYTransform::makeAffineTransform);
PYBIND11_PLUGIN(_cameraSys)
A base class for image defects.
Point< double, 2 > Point2D