24#ifndef LSST_AFW_GEOM_SKYWCS_H
25#define LSST_AFW_GEOM_SKYWCS_H
63Eigen::Matrix2d
makeCdMatrix(lsst::geom::Angle
const &scale,
196 bool precise =
false,
345 return _transform->applyForward(pixel);
351 return _transform->applyForward(pixels);
360 return _transform->applyInverse(sky);
363 return _transform->applyInverse(sky);
447 bool equals(typehandling::Storable
const &other)
const noexcept override;
453 void write(OutputArchiveHandle &handle)
const override;
501 void _computeCache() {
546 bool modifyActualPixels);
576 Eigen::Matrix2d
const &cdMatrix,
std::string const &projection =
"TAN");
611 Eigen::Matrix2d
const &cdMatrix, Eigen::MatrixXd
const &sipA,
612 Eigen::MatrixXd
const &sipB);
628 Eigen::Matrix2d
const &cdMatrix, Eigen::MatrixXd
const &sipA,
629 Eigen::MatrixXd
const &sipB, Eigen::MatrixXd
const &sipAp,
630 Eigen::MatrixXd
const &sipBp);
648 bool simplify =
true);
656 bool simplify =
true);
Eigen::Matrix2d getCdMatrix() const
Get the 2x2 CD matrix at the pixel origin.
std::string writeString() const
Serialize this SkyWcs to a string, using the same format as writeStream.
SkyWcs & operator=(SkyWcs const &)=delete
lsst::geom::SpherePoint pixelToSky(lsst::geom::Point2D const &pixel) const
Compute sky position(s) from pixel position(s).
std::shared_ptr< SkyWcs > copyAtShiftedPixelOrigin(lsst::geom::Extent2D const &shift) const
Return a copy of this SkyWcs with the pixel origin shifted by the specified amount.
static std::shared_ptr< SkyWcs > readStream(std::istream &is)
Deserialize a SkyWcs from an input stream.
std::shared_ptr< SkyWcs > getTanWcs(lsst::geom::Point2D const &pixel) const
Get a local TAN WCS approximation to this WCS at the specified pixel position.
lsst::geom::Angle getPixelScale() const
Get the pixel scale at the pixel origin.
bool isPersistable() const noexcept override
static std::shared_ptr< SkyWcs > readString(std::string &str)
Deserialize a SkyWcs from a string, using the same format as readStream.
lsst::geom::SpherePoint getSkyOrigin() const
Get the sky origin, the celestial fiducial point.
std::shared_ptr< SkyWcs > copyWithFitsApproximation(std::shared_ptr< SkyWcs > fitsApproximation) const
Return a copy of this SkyWcs with the given FITS approximation.
std::string toString() const override
Create a string representation of this object.
lsst::geom::Point2D getPixelOrigin() const
Get the pixel origin, in pixels, using the LSST convention.
lsst::geom::AffineTransform linearizePixelToSky(lsst::geom::SpherePoint const &coord, lsst::geom::AngleUnit const &skyUnit) const
Return the local linear approximation to pixelToSky at a point given in sky coordinates.
bool operator==(SkyWcs const &other) const
Equality is based on the string representations being equal.
lsst::geom::AffineTransform linearizeSkyToPixel(lsst::geom::SpherePoint const &coord, lsst::geom::AngleUnit const &skyUnit) const
Return the local linear approximation to skyToPixel at a point given in sky coordinates.
SkyWcs(SkyWcs const &)=default
std::shared_ptr< daf::base::PropertyList > getFitsMetadata(bool precise=false, lsst::geom::Box2I const &bbox=lsst::geom::Box2I(lsst::geom::Point2I(0, 0), lsst::geom::Extent2I(100, 100))) const
Return the WCS as FITS WCS metadata.
std::shared_ptr< const TransformPoint2ToSpherePoint > getTransform() const
Get a TransformPoint2ToSpherePoint that transforms pixels to sky in the forward direction and sky to ...
bool operator!=(SkyWcs const &other) const
lsst::geom::Point2D skyToPixel(lsst::geom::SpherePoint const &sky) const
Compute pixel position(s) from sky position(s).
lsst::geom::SpherePoint pixelToSky(double x, double y) const
std::string getPythonModule() const override
bool isFlipped() const
Does the WCS follow the convention of North=Up, East=Left?
std::string getPersistenceName() const override
bool hasFitsApproximation() const
Does this SkyWcs have an approximate SkyWcs that can be represented as standard FITS WCS?
void write(OutputArchiveHandle &handle) const override
SkyWcs & operator=(SkyWcs &&)=delete
std::shared_ptr< SkyWcs > getFitsApproximation() const
Return FITS SkyWcs that approximates this one.
SkyWcs(SkyWcs &&)=default
bool equals(typehandling::Storable const &other) const noexcept override
Compare this object to another Storable.
~SkyWcs() override=default
void writeStream(std::ostream &os) const
Serialize this SkyWcs to an output stream.
std::shared_ptr< typehandling::Storable > cloneStorable() const override
Create a new SkyWcs that is a copy of this one.
static std::string getShortClassName()
std::shared_ptr< const ast::FrameDict > getFrameDict() const
Get the contained FrameDict.
bool isFits() const
Return true getFitsMetadata(true) will succeed with no arguments, false if not.
std::vector< lsst::geom::SpherePoint > pixelToSky(std::vector< lsst::geom::Point2D > const &pixels) const
std::vector< lsst::geom::Point2D > skyToPixel(std::vector< lsst::geom::SpherePoint > const &sky) const
A CRTP facade class for subclasses of Persistable.
std::shared_ptr< SkyWcs > makeSkyWcs(daf::base::PropertySet &metadata, bool strip=false)
Construct a SkyWcs from FITS keywords.
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::ostream & operator<<(std::ostream &os, GenericEndpoint const &endpoint)
Print "GenericEndpoint(_n_)" to the ostream where _n_ is the number of axes, e.g. "GenericAxes(4)".
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< TransformPoint2ToSpherePoint > getIntermediateWorldCoordsToSky(SkyWcs const &wcs, bool simplify=true)
Return a transform from intermediate world coordinates to sky.
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.
Transform< Point2Endpoint, Point2Endpoint > TransformPoint2ToPoint2
std::shared_ptr< TransformPoint2ToPoint2 > makeWcsPairTransform(SkyWcs const &src, SkyWcs const &dst)
A Transform obtained by putting two SkyWcs objects "back to back".
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.
AngleUnit constexpr degrees
Extent< double, 2 > Extent2D
Point< double, 2 > Point2D
Extent< int, 2 > Extent2I