22 #include "pybind11/pybind11.h"
29 #include "pybind11/stl.h"
30 #include "numpy/arrayobject.h"
31 #include "ndarray/pybind11.h"
39 namespace py = pybind11;
40 using namespace py::literals;
48 py::module mod(
"skyWcs");
50 py::module::import(
"lsst.afw.geom.transform");
53 if (_import_array() < 0) {
54 PyErr_SetString(PyExc_ImportError,
"numpy.core.multiarray failed to import");
60 py::class_<SkyWcs, std::shared_ptr<SkyWcs>, Transform<Point2Endpoint, IcrsCoordEndpoint>>
cls(mod,
63 cls.def(py::init<Point2D const &, coord::IcrsCoord const &, Eigen::Matrix2d const &>(),
"crpix"_a,
"crval"_a,
65 cls.def(py::init<daf::base::PropertyList &>(),
"metadata"_a);
66 cls.def(py::init<ast::FrameSet const&>(),
"frameSet"_a);
68 cls.def(
"getPixelScale", (
Angle (SkyWcs::*)(
Point2D const &)
const) &SkyWcs::getPixelScale,
"pixel"_a);
69 cls.def(
"getPixelScale", (
Angle (SkyWcs::*)()
const) &SkyWcs::getPixelScale);
70 cls.def(
"getPixelOrigin", &SkyWcs::getPixelOrigin);
71 cls.def(
"getSkyOrigin", &SkyWcs::getSkyOrigin);
72 cls.def(
"getCdMatrix", (Eigen::Matrix2d(SkyWcs::*)(
Point2D const &)
const) & SkyWcs::getCdMatrix,
74 cls.def(
"getCdMatrix", (Eigen::Matrix2d(SkyWcs::*)()
const) & SkyWcs::getCdMatrix);
75 cls.def(
"copyAtShiftedPixelOrigin", &SkyWcs::copyAtShiftedPixelOrigin,
"shift"_a);
76 cls.def(
"pixelToSky", (std::pair<Angle, Angle>(SkyWcs::*)(
double,
double)
const) & SkyWcs::pixelToSky,
80 (std::vector<coord::IcrsCoord>(SkyWcs::*)(std::vector<Point2D>
const &)
const) & SkyWcs::pixelToSky,
83 (std::pair<double, double>(SkyWcs::*)(
Angle const &,
Angle const &)
const) & SkyWcs::skyToPixel,
87 (std::vector<Point2D>(SkyWcs::*)(std::vector<coord::IcrsCoord>
const &)
const) & SkyWcs::skyToPixel,
lsst::afw::geom::Angle Angle
AngleUnit constexpr degrees
constant with units of degrees
PYBIND11_PLUGIN(_cameraPoint)
lsst::afw::coord::IcrsCoord IcrsCoord
Point< double, 2 > Point2D
Eigen::Matrix2d makeCdMatrix(Angle const &scale, Angle const &orientation=0 *degrees, bool flipX=false)
Make a WCS CD matrix.