LSSTApplications
20.0.0
LSSTDataManagementBasePackage
|
Go to the documentation of this file.
22 #include "pybind11/pybind11.h"
23 #include "pybind11/eigen.h"
30 #include "pybind11/stl.h"
31 #include "ndarray/pybind11.h"
43 using namespace py::literals;
51 py::module::import(
"lsst.geom");
52 py::module::import(
"lsst.afw.geom.transform");
53 py::module::import(
"lsst.afw.typehandling");
57 mod.def(
"makeFlippedWcs",
makeFlippedWcs,
"wcs"_a,
"flipLR"_a,
"flipTB"_a,
"center"_a);
58 mod.def(
"makeModifiedWcs",
makeModifiedWcs,
"pixelTransform"_a,
"wcs"_a,
"modifyActualPixels"_a);
62 "crpix"_a,
"crval"_a,
"cdMatrix"_a,
"projection"_a =
"TAN");
64 "metadata"_a,
"strip"_a =
false);
68 "pixelsToFieldAngle"_a,
"orientation"_a,
"flipX"_a,
"boresight"_a,
"projection"_a =
"TAN");
69 mod.def(
"makeTanSipWcs",
71 Eigen::Matrix2d
const &, Eigen::MatrixXd
const &,
73 "crpix"_a,
"crval"_a,
"cdMatrix"_a,
"sipA"_a,
"sipB"_a);
74 mod.def(
"makeTanSipWcs",
76 Eigen::Matrix2d
const &, Eigen::MatrixXd
const &,
77 Eigen::MatrixXd
const &, Eigen::MatrixXd
const &,
79 "crpix"_a,
"crval"_a,
"cdMatrix"_a,
"sipA"_a,
"sipB"_a,
"sipAp"_a,
"sipBp"_a);
85 py::class_<SkyWcs, std::shared_ptr<SkyWcs>, typehandling::Storable>
cls(mod,
"SkyWcs");
87 cls.def(py::init<daf::base::PropertySet &, bool>(),
"metadata"_a,
"strip"_a =
false);
88 cls.def(py::init<ast::FrameDict const &>(),
"frameDict"_a);
90 cls.def(
"__eq__", &SkyWcs::operator==, py::is_operator());
91 cls.def(
"__ne__", &SkyWcs::operator!=, py::is_operator());
93 table::io::python::addPersistableMethods<SkyWcs>(
cls);
95 cls.def(
"copyAtShiftedPixelOrigin", &SkyWcs::copyAtShiftedPixelOrigin,
"shift"_a);
96 cls.def(
"getFitsMetadata", &SkyWcs::getFitsMetadata,
"precise"_a =
false);
97 cls.def(
"getPixelScale",
101 cls.def(
"getPixelOrigin", &SkyWcs::getPixelOrigin);
102 cls.def(
"getSkyOrigin", &SkyWcs::getSkyOrigin);
103 cls.def(
"getCdMatrix",
104 (Eigen::Matrix2d(SkyWcs::*)(
lsst::geom::Point2D const &)
const) & SkyWcs::getCdMatrix,
"pixel"_a);
105 cls.def(
"getCdMatrix", (Eigen::Matrix2d(SkyWcs::*)()
const) & SkyWcs::getCdMatrix);
106 cls.def(
"getTanWcs", &SkyWcs::getTanWcs,
"pixel"_a);
107 cls.def(
"getFrameDict", [](SkyWcs
const &
self) {
return self.getFrameDict()->
copy(); });
108 cls.def(
"getTransform", &SkyWcs::getTransform);
110 cls.def_property_readonly(
"isFits", &SkyWcs::isFits);
111 cls.def_property_readonly(
"isFlipped", &SkyWcs::isFlipped);
112 cls.def(
"linearizePixelToSky",
115 SkyWcs::linearizePixelToSky,
116 "coord"_a,
"skyUnit"_a);
117 cls.def(
"linearizePixelToSky",
120 SkyWcs::linearizePixelToSky,
121 "coord"_a,
"skyUnit"_a);
122 cls.def(
"linearizeSkyToPixel",
125 SkyWcs::linearizeSkyToPixel,
126 "coord"_a,
"skyUnit"_a);
127 cls.def(
"linearizeSkyToPixel",
130 SkyWcs::linearizeSkyToPixel,
131 "coord"_a,
"skyUnit"_a);
132 cls.def(
"pixelToSky",
137 cls.def(
"pixelToSky",
142 cls.def(
"skyToPixel",
145 cls.def(
"skyToPixel",
153 cls.def_static(
"readString", &SkyWcs::readString);
154 cls.def(
"writeString", &SkyWcs::writeString);
constexpr AngleUnit degrees
constant with units of degrees
void addOutputOp(PyClass &cls, std::string const &method)
Add __str__ or __repr__ method implemented by operator<<.
std::shared_ptr< SkyWcs > makeModifiedWcs(TransformPoint2ToPoint2 const &pixelTransform, SkyWcs const &wcs, bool modifyActualPixels)
Create a new SkyWcs whose pixels are transformed by pixelTransform, as described below.
std::shared_ptr< TransformPoint2ToPoint2 > getPixelToIntermediateWorldCoords(SkyWcs const &wcs, bool simplify=true)
Return a transform from pixel coordinates to intermediate world coordinates.
std::shared_ptr< SkyWcs > makeTanSipWcs(lsst::geom::Point2D const &crpix, lsst::geom::SpherePoint const &crval, Eigen::Matrix2d const &cdMatrix, Eigen::MatrixXd const &sipA, Eigen::MatrixXd const &sipB)
Construct a TAN-SIP SkyWcs with forward SIP distortion terms and an iterative inverse.
std::shared_ptr< SkyWcs > makeFlippedWcs(SkyWcs const &wcs, bool flipLR, bool flipTB, lsst::geom::Point2D const ¢er)
Return a copy of a FITS-WCS with pixel positions flipped around a specified center.
Transform< Point2Endpoint, Point2Endpoint > TransformPoint2ToPoint2
A base class for image defects.
std::shared_ptr< TransformPoint2ToSpherePoint > getIntermediateWorldCoordsToSky(SkyWcs const &wcs, bool simplify=true)
Return a transform from intermediate world coordinates to sky.
Eigen::Matrix2d makeCdMatrix(lsst::geom::Angle const &scale, lsst::geom::Angle const &orientation=0 *lsst::geom::degrees, bool flipX=false)
Make a WCS CD matrix.
std::shared_ptr< TransformPoint2ToPoint2 > makeWcsPairTransform(SkyWcs const &src, SkyWcs const &dst)
A Transform obtained by putting two SkyWcs objects "back to back".
A class used to convert scalar POD types such as double to Angle.
A class representing an angle.
std::shared_ptr< SkyWcs > makeSkyWcs(daf::base::PropertySet &metadata, bool strip=false)
Construct a SkyWcs from FITS keywords.
Point in an unspecified spherical coordinate system.
PYBIND11_MODULE(camera, mod)