24 #ifndef LSST_AFW_GEOM_SKYWCS_H 25 #define LSST_AFW_GEOM_SKYWCS_H 329 return _transform->applyForward(pixels);
339 return _transform->applyInverse(sky);
416 Angle _pixelScaleAtOrigin;
433 void _computeCache() {
434 _transform = std::make_shared<TransformPoint2ToSpherePoint>(*_frameDict->getMapping(),
true);
478 bool modifyActualPixels);
508 Eigen::Matrix2d
const &cdMatrix,
std::string const &projection =
"TAN");
522 Eigen::Matrix2d
const &cdMatrix, Eigen::MatrixXd
const &sipA,
523 Eigen::MatrixXd
const &sipB);
539 Eigen::Matrix2d
const &cdMatrix, Eigen::MatrixXd
const &sipA,
540 Eigen::MatrixXd
const &sipB, Eigen::MatrixXd
const &sipAp,
541 Eigen::MatrixXd
const &sipBp);
559 bool simplify =
true);
567 bool simplify =
true);
Point in an unspecified spherical coordinate system.
std::shared_ptr< TransformPoint2ToPoint2 > makeWcsPairTransform(SkyWcs const &src, SkyWcs const &dst)
A Transform obtained by putting two SkyWcs objects "back to back".
A 2-dimensional celestial WCS that transform pixels to ICRS RA/Dec, using the LSST standard for pixel...
lsst::afw::geom::Angle Angle
std::shared_ptr< SkyWcs > getTanWcs(Point2D const &pixel) const
Get a local TAN WCS approximation to this WCS at the specified pixel position.
An object passed to Persistable::write to allow it to persist itself.
std::ostream & operator<<(std::ostream &os, lsst::afw::geom::AffineTransform const &transform)
bool isFits() const
Return true getFitsMetadata(true) will succeed, false if not.
def scale(algorithm, min, max=None, frame=None)
AngleUnit constexpr degrees
constant with units of degrees
std::shared_ptr< SkyWcs > makeFlippedWcs(SkyWcs const &wcs, bool flipLR, bool flipTB, geom::Point2D const ¢er)
Return a copy of a FITS-WCS with pixel positions flipped around a specified center.
std::string getPythonModule() const override
Return the fully-qualified Python module that should be imported to guarantee that its factory is reg...
std::shared_ptr< TransformPoint2ToSpherePoint > getIntermediateWorldCoordsToSky(SkyWcs const &wcs, bool simplify=true)
Return a transform from intermediate world coordinates to sky.
A class used to convert scalar POD types such as double to Angle.
std::vector< SpherePoint > pixelToSky(std::vector< Point2D > const &pixels) const
Compute sky position(s) from pixel position(s)
A base class for objects that can be persisted via afw::table::io Archive classes.
std::shared_ptr< const ast::FrameDict > getFrameDict() const
Get the contained FrameDict.
std::string getPersistenceName() const override
Return the unique name used to persist this object and look up its factory.
Eigen::Matrix2d getCdMatrix() const
Get the 2x2 CD matrix at the pixel origin.
std::shared_ptr< SkyWcs > makeTanSipWcs(Point2D const &crpix, 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< const TransformPoint2ToSpherePoint > getTransform() const
Get a TransformPoint2ToSpherePoint that transforms pixels to sky in the forward direction and sky to ...
A class representing an angle.
static std::shared_ptr< SkyWcs > readStream(std::istream &is)
Deserialize a SkyWcs from an input stream.
A base class for image defects.
bool hasFitsApproximation() const
Does this SkyWcs have an approximate SkyWcs that can be represented as standard FITS WCS...
Point< double, 2 > Point2D
std::shared_ptr< SkyWcs > makeSkyWcs(daf::base::PropertySet &metadata, bool strip=false)
Construct a SkyWcs from FITS keywords.
std::vector< Point2D > skyToPixel(std::vector< SpherePoint > const &sky) const
Compute pixel position(s) from sky position(s)
SpherePoint pixelToSky(double x, double y) const
Compute sky position(s) from pixel position(s)
Angle getPixelScale() const
Get the pixel scale at the pixel origin.
static std::string getShortClassName()
static std::shared_ptr< SkyWcs > readString(std::string &str)
Deserialize a SkyWcs from a string, using the same format as readStream.
std::shared_ptr< SkyWcs > copyAtShiftedPixelOrigin(Extent2D const &shift) const
Return a copy of this SkyWcs with the pixel origin shifted by the specified amount.
AffineTransform linearizeSkyToPixel(SpherePoint const &coord, AngleUnit const &skyUnit) const
Return the local linear approximation to skyToPixel at a point given in sky coordinates.
bool operator!=(SkyWcs const &other) const
Point2D getPixelOrigin() const
Get the pixel origin, in pixels, using the LSST convention.
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.
SpherePoint pixelToSky(Point2D const &pixel) const
Compute sky position(s) from pixel position(s)
void write(OutputArchiveHandle &handle) const override
Write the object to one or more catalogs.
Point2D skyToPixel(SpherePoint const &sky) const
Compute pixel position(s) from sky position(s)
SkyWcs(SkyWcs const &)=default
std::string writeString() const
Serialize this SkyWcs to a string, using the same format as writeStream.
bool isPersistable() const override
Return true if this particular object can be persisted using afw::table::io.
AffineTransform linearizePixelToSky(SpherePoint const &coord, AngleUnit const &skyUnit) const
Return the local linear approximation to pixelToSky at a point given in sky coordinates.
Eigen::Matrix2d makeCdMatrix(Angle const &scale, Angle const &orientation=0 *degrees, bool flipX=false)
Make a WCS CD matrix.
void writeStream(std::ostream &os) const
Serialize this SkyWcs to an output stream.
bool isFlipped() const
Does the WCS follow the convention of North=Up, East=Left?
SkyWcs & operator=(SkyWcs const &)=delete
A CRTP facade class for subclasses of Persistable.
SpherePoint getSkyOrigin() const
Get the sky origin, the celestial fiducial point.
bool operator==(SkyWcs const &other) const
Equality is based on the string representations being equal.
std::shared_ptr< TransformPoint2ToPoint2 > getPixelToIntermediateWorldCoords(SkyWcs const &wcs, bool simplify=true)
Return a transform from pixel coordinates to intermediate world coordinates.
std::shared_ptr< daf::base::PropertyList > getFitsMetadata(bool precise=false) const
Return the WCS as FITS WCS metadata.