lsst.afw  13.0-109-g62eb66483
Public Types | Public Member Functions | Static Public Member Functions | List of all members
lsst::afw::geom::SkyWcs Class Reference

A WCS that transform pixels to ICRS RA/Dec using the LSST standard for pixels. More...

#include <SkyWcs.h>

Inheritance diagram for lsst::afw::geom::SkyWcs:
lsst::afw::geom::Transform< FromEndpoint, ToEndpoint >

Public Types

using FromArray = typename FromEndpoint::Array
 
using FromPoint = typename FromEndpoint::Point
 
using ToArray = typename ToEndpoint::Array
 
using ToPoint = typename ToEndpoint::Point
 

Public Member Functions

 SkyWcs (SkyWcs const &)=default
 
 SkyWcs (SkyWcs &&)=default
 
SkyWcs & operator= (SkyWcs const &)=delete
 
SkyWcs & operator= (SkyWcs &&)=delete
 
 SkyWcs (Point2D const &crpix, coord::IcrsCoord const &crval, Eigen::Matrix2d const &cdMatrix)
 Construct a pure tangent SkyWcs. More...
 
 SkyWcs (daf::base::PropertyList &metadata, bool strip=true)
 Construct a WCS from FITS keywords. More...
 
 SkyWcs (ast::FrameSet const &frameSet)
 Construct a WCS from an ast::FrameSet. More...
 
 ~SkyWcs ()
 
Angle getPixelScale (Point2D const &pixel) const
 Get the pixel scale at the specified pixel position. More...
 
Angle getPixelScale () const
 Get the pixel scale at the pixel origin. More...
 
Point2D getPixelOrigin () const
 Get CRPIX, the pixel origin, using the LSST convention. More...
 
coord::IcrsCoord getSkyOrigin () const
 Get CRVAL, the sky origin or celestial fiducial point. More...
 
Eigen::Matrix2d getCdMatrix (Point2D const &pixel) const
 Get the 2x2 CD matrix at the specified pixel position. More...
 
Eigen::Matrix2d getCdMatrix () const
 Get the 2x2 CD matrix at the pixel origin. More...
 
SkyWcs getTanWcs (Point2D const &pixel) const
 Get a local TAN WCS approximation to this WCS at the specified pixel position. More...
 
SkyWcs copyAtShiftedPixelOrigin (Extent2D const &shift) const
 Return a copy of this SkyWcs with the pixel origin by the specified amount. More...
 
void writeStream (std::ostream &os) const override
 Serialize this SkyWcs to an output stream. More...
 
std::string writeString () const override
 Serialize this SkyWcs to a string, using the same format as writeStream. More...
 
bool hasForward () const
 Test if this method has a forward transform. More...
 
bool hasInverse () const
 Test if this method has an inverse transform. More...
 
FromEndpoint getFromEndpoint () const
 Get the "from" endpoint. More...
 
std::shared_ptr< const ast::FrameSet > getFrameSet () const
 Get the contained frameset. More...
 
ToEndpoint getToEndpoint () const
 Get the "to" endpoint. More...
 
ToPoint applyForward (FromPoint const &point) const
 Transform one point in the forward direction ("from" to "to") More...
 
ToArray applyForward (FromArray const &array) const
 Transform an array of points in the forward direction ("from" to "to") More...
 
FromPoint applyInverse (ToPoint const &point) const
 Transform one point in the inverse direction ("to" to "from") More...
 
FromArray applyInverse (ToArray const &array) const
 Transform an array of points in the inverse direction ("to" to "from") More...
 
Transform< ToEndpoint, FromEndpoint > getInverse () const
 The inverse of this Transform. More...
 
Eigen::MatrixXd getJacobian (FromPoint const &x) const
 The Jacobian matrix of this Transform. More...
 
template<class NextToEndpoint >
Transform< FromEndpoint, NextToEndpoint > then (Transform< ToEndpoint, NextToEndpoint > const &next) const
 Concatenate two Transforms. More...
 
std::pair< Angle, Angle > pixelToSky (double x, double y) const
 Compute sky position(s) from pixel position(s) More...
 
coord::IcrsCoord pixelToSky (Point2D const &pixel) const
 Compute sky position(s) from pixel position(s) More...
 
std::vector< coord::IcrsCoord > pixelToSky (std::vector< Point2D > const &pixels) const
 Compute sky position(s) from pixel position(s) More...
 
std::pair< double, double > skyToPixel (Angle const &ra, Angle const &dec) const
 Compute pixel position(s) from sky position(s) More...
 
Point2D skyToPixel (coord::IcrsCoord const &sky) const
 Compute pixel position(s) from sky position(s) More...
 
std::vector< Point2D > skyToPixel (std::vector< coord::IcrsCoord > const &sky) const
 Compute pixel position(s) from sky position(s) More...
 

Static Public Member Functions

static std::string getShortClassName ()
 
static SkyWcs readStream (std::istream &is)
 Deserialize a SkyWcs from an input stream. More...
 
static SkyWcs readString (std::string &str)
 Deserialize a SkyWcs from a string, using the same format as readStream. More...
 

Detailed Description

A WCS that transform pixels to ICRS RA/Dec using the LSST standard for pixels.

The LSST standard for pixel position is: 0,0 is the center of the lower left pixel of the parent image (unlike FITS standard, which uses 1,1 as the center of the lower left pixel of the subimage).

The forward direction transforms from pixels (actual, if known, else nominal) to ICRS RA, Dec.

The contained ast::FrameSet must have the following frames. All are of class ast::Frame except the sky frame. The domain is listed first, if set:

If ACTUAL_PIXEL0 is present then it will be the base frame (the starting point for forward transformations else PIXEL0 will be the base frame. The SkyFrame is always the current frame (the ending point for forward transformations).

Constructors must set the following properties of the contained ast::FrameSet:

Definition at line 97 of file SkyWcs.h.

Member Typedef Documentation

◆ FromArray

template<class FromEndpoint, class ToEndpoint>
using lsst::afw::geom::Transform< FromEndpoint, ToEndpoint >::FromArray = typename FromEndpoint::Array
inherited

Definition at line 66 of file Transform.h.

◆ FromPoint

template<class FromEndpoint, class ToEndpoint>
using lsst::afw::geom::Transform< FromEndpoint, ToEndpoint >::FromPoint = typename FromEndpoint::Point
inherited

Definition at line 67 of file Transform.h.

◆ ToArray

template<class FromEndpoint, class ToEndpoint>
using lsst::afw::geom::Transform< FromEndpoint, ToEndpoint >::ToArray = typename ToEndpoint::Array
inherited

Definition at line 68 of file Transform.h.

◆ ToPoint

template<class FromEndpoint, class ToEndpoint>
using lsst::afw::geom::Transform< FromEndpoint, ToEndpoint >::ToPoint = typename ToEndpoint::Point
inherited

Definition at line 69 of file Transform.h.

Constructor & Destructor Documentation

◆ SkyWcs() [1/5]

lsst::afw::geom::SkyWcs::SkyWcs ( SkyWcs const &  )
default

◆ SkyWcs() [2/5]

lsst::afw::geom::SkyWcs::SkyWcs ( SkyWcs &&  )
default

◆ SkyWcs() [3/5]

lsst::afw::geom::SkyWcs::SkyWcs ( Point2D const &  crpix,
coord::IcrsCoord const &  crval,
Eigen::Matrix2d const &  cdMatrix 
)
explicit

Construct a pure tangent SkyWcs.

Parameters
[in]crpixCenter of projection on the CCD using the LSST convention: 0, 0 is the lower left pixel of the parent image
[in]crvalCenter of projection on the sky
[in]cdMatrixCD matrix, where element (i-1, j-1) corresponds to FITS keyword CDi_j and i, j have range [1, 2]. May be computed by calling makeCdMatrix.

◆ SkyWcs() [4/5]

lsst::afw::geom::SkyWcs::SkyWcs ( daf::base::PropertyList &  metadata,
bool  strip = true 
)
explicit

Construct a WCS from FITS keywords.

In addition to standard FITS WCS keywords uses these IRAF keywords: LTV1, LTV2: offset of subimage with respect to parent image

Parameters
[in]metadataFITS header metadata
[in]stripStrip keywords used to create the SkyWcs? Even if true. keywords that might used for other purposes are retained, including LTV1, LTV2 and all date and time keywords except EQUINOX

◆ SkyWcs() [5/5]

lsst::afw::geom::SkyWcs::SkyWcs ( ast::FrameSet const &  frameSet)
explicit

Construct a WCS from an ast::FrameSet.

This is the most general constructor; it can be used to define any celestial WCS as long as it contains the required frames.

Exceptions
lsst::pex::exceptions::InvalidParameterErrorif frameSet is missing any of the required frames.

◆ ~SkyWcs()

lsst::afw::geom::SkyWcs::~SkyWcs ( )
inline

Definition at line 139 of file SkyWcs.h.

Member Function Documentation

◆ applyForward() [1/2]

template<class FromEndpoint, class ToEndpoint>
ToPoint lsst::afw::geom::Transform< FromEndpoint, ToEndpoint >::applyForward ( FromPoint const &  point) const
inherited

Transform one point in the forward direction ("from" to "to")

◆ applyForward() [2/2]

template<class FromEndpoint, class ToEndpoint>
ToArray lsst::afw::geom::Transform< FromEndpoint, ToEndpoint >::applyForward ( FromArray const &  array) const
inherited

Transform an array of points in the forward direction ("from" to "to")

The first dimension of the array must match the number of input axes, and the data order is values for the first axis, then values for the next axis, and so on, e.g. for 2 axes: x0, x1, x2, ..., y0, y1, y2...

◆ applyInverse() [1/2]

template<class FromEndpoint, class ToEndpoint>
FromPoint lsst::afw::geom::Transform< FromEndpoint, ToEndpoint >::applyInverse ( ToPoint const &  point) const
inherited

Transform one point in the inverse direction ("to" to "from")

◆ applyInverse() [2/2]

template<class FromEndpoint, class ToEndpoint>
FromArray lsst::afw::geom::Transform< FromEndpoint, ToEndpoint >::applyInverse ( ToArray const &  array) const
inherited

Transform an array of points in the inverse direction ("to" to "from")

The first dimension of the array must match the number of output axes, and the data order is values for the first axis, then values for the next axis, and so on, e.g. for 2 axes: x0, x1, x2, ..., y0, y1, y2...

◆ copyAtShiftedPixelOrigin()

SkyWcs lsst::afw::geom::SkyWcs::copyAtShiftedPixelOrigin ( Extent2D const &  shift) const

Return a copy of this SkyWcs with the pixel origin by the specified amount.

◆ getCdMatrix() [1/2]

Eigen::Matrix2d lsst::afw::geom::SkyWcs::getCdMatrix ( Point2D const &  pixel) const

Get the 2x2 CD matrix at the specified pixel position.

◆ getCdMatrix() [2/2]

Eigen::Matrix2d lsst::afw::geom::SkyWcs::getCdMatrix ( ) const

Get the 2x2 CD matrix at the pixel origin.

◆ getFrameSet()

template<class FromEndpoint, class ToEndpoint>
std::shared_ptr<const ast::FrameSet> lsst::afw::geom::Transform< FromEndpoint, ToEndpoint >::getFrameSet ( ) const
inlineinherited

Get the contained frameset.

Definition at line 134 of file Transform.h.

◆ getFromEndpoint()

template<class FromEndpoint, class ToEndpoint>
FromEndpoint lsst::afw::geom::Transform< FromEndpoint, ToEndpoint >::getFromEndpoint ( ) const
inlineinherited

Get the "from" endpoint.

Definition at line 129 of file Transform.h.

◆ getInverse()

template<class FromEndpoint, class ToEndpoint>
Transform<ToEndpoint, FromEndpoint> lsst::afw::geom::Transform< FromEndpoint, ToEndpoint >::getInverse ( ) const
inherited

The inverse of this Transform.

Returns
a Transform whose applyForward is equivalent to this Transform's applyInverse, and vice versa.
Exception Safety
Provides basic exception safety.

◆ getJacobian()

template<class FromEndpoint, class ToEndpoint>
Eigen::MatrixXd lsst::afw::geom::Transform< FromEndpoint, ToEndpoint >::getJacobian ( FromPoint const &  x) const
inherited

The Jacobian matrix of this Transform.

The matrix is defined only if this object has a forward transform.

Parameters
xthe position at which the Jacobian shall be evaluated
Returns
a matrix J with getToEndpoint().getNAxes() rows and getFromEndpoint().getNAxes() columns. J(i,j) shall be the rate of change of the ith output coordinate with respect to the jth input coordinate, or NaN if the derivative cannot be calculated.
Exception Safety
Provides basic exception safety.
Note
The derivatives may be estimated by sampling and interpolating this Transform in the neighborhood of x. If the implementation requires interpolation, computation of the Jacobian may require hundreds of evaluations of applyForward.

◆ getPixelOrigin()

Point2D lsst::afw::geom::SkyWcs::getPixelOrigin ( ) const

Get CRPIX, the pixel origin, using the LSST convention.

◆ getPixelScale() [1/2]

Angle lsst::afw::geom::SkyWcs::getPixelScale ( Point2D const &  pixel) const

Get the pixel scale at the specified pixel position.

The scale is the square root of the area of the specified pixel on the sky.

◆ getPixelScale() [2/2]

Angle lsst::afw::geom::SkyWcs::getPixelScale ( ) const

Get the pixel scale at the pixel origin.

The scale is the square root of the area of the specified pixel on the sky.

◆ getShortClassName()

static std::string lsst::afw::geom::SkyWcs::getShortClassName ( )
static

◆ getSkyOrigin()

coord::IcrsCoord lsst::afw::geom::SkyWcs::getSkyOrigin ( ) const

Get CRVAL, the sky origin or celestial fiducial point.

◆ getTanWcs()

SkyWcs lsst::afw::geom::SkyWcs::getTanWcs ( Point2D const &  pixel) const

Get a local TAN WCS approximation to this WCS at the specified pixel position.

◆ getToEndpoint()

template<class FromEndpoint, class ToEndpoint>
ToEndpoint lsst::afw::geom::Transform< FromEndpoint, ToEndpoint >::getToEndpoint ( ) const
inlineinherited

Get the "to" endpoint.

Definition at line 139 of file Transform.h.

◆ hasForward()

template<class FromEndpoint, class ToEndpoint>
bool lsst::afw::geom::Transform< FromEndpoint, ToEndpoint >::hasForward ( ) const
inlineinherited

Test if this method has a forward transform.

Exception Safety
Provides basic exception safety.

Definition at line 117 of file Transform.h.

◆ hasInverse()

template<class FromEndpoint, class ToEndpoint>
bool lsst::afw::geom::Transform< FromEndpoint, ToEndpoint >::hasInverse ( ) const
inlineinherited

Test if this method has an inverse transform.

Exception Safety
Provides basic exception safety.

Definition at line 124 of file Transform.h.

◆ operator=() [1/2]

SkyWcs& lsst::afw::geom::SkyWcs::operator= ( SkyWcs const &  )
delete

◆ operator=() [2/2]

SkyWcs& lsst::afw::geom::SkyWcs::operator= ( SkyWcs &&  )
delete

◆ pixelToSky() [1/3]

std::pair<Angle, Angle> lsst::afw::geom::SkyWcs::pixelToSky ( double  x,
double  y 
) const

Compute sky position(s) from pixel position(s)

This is another name for applyForward, plus an overload that takes a pair of doubles.

◆ pixelToSky() [2/3]

coord::IcrsCoord lsst::afw::geom::SkyWcs::pixelToSky ( Point2D const &  pixel) const
inline

Compute sky position(s) from pixel position(s)

This is another name for applyForward, plus an overload that takes a pair of doubles.

Definition at line 192 of file SkyWcs.h.

◆ pixelToSky() [3/3]

std::vector<coord::IcrsCoord> lsst::afw::geom::SkyWcs::pixelToSky ( std::vector< Point2D > const &  pixels) const
inline

Compute sky position(s) from pixel position(s)

This is another name for applyForward, plus an overload that takes a pair of doubles.

Definition at line 193 of file SkyWcs.h.

◆ readStream()

static SkyWcs lsst::afw::geom::SkyWcs::readStream ( std::istream &  is)
static

Deserialize a SkyWcs from an input stream.

Parameters
[in]isinput stream from which to deserialize this SkyWcs

◆ readString()

static SkyWcs lsst::afw::geom::SkyWcs::readString ( std::string &  str)
static

Deserialize a SkyWcs from a string, using the same format as readStream.

◆ skyToPixel() [1/3]

std::pair<double, double> lsst::afw::geom::SkyWcs::skyToPixel ( Angle const &  ra,
Angle const &  dec 
) const

Compute pixel position(s) from sky position(s)

This is another name for applyInverse, plus an overload that takes a pair of lsst:afw::geom::Angle.

◆ skyToPixel() [2/3]

Point2D lsst::afw::geom::SkyWcs::skyToPixel ( coord::IcrsCoord const &  sky) const
inline

Compute pixel position(s) from sky position(s)

This is another name for applyInverse, plus an overload that takes a pair of lsst:afw::geom::Angle.

Definition at line 205 of file SkyWcs.h.

◆ skyToPixel() [3/3]

std::vector<Point2D> lsst::afw::geom::SkyWcs::skyToPixel ( std::vector< coord::IcrsCoord > const &  sky) const
inline

Compute pixel position(s) from sky position(s)

This is another name for applyInverse, plus an overload that takes a pair of lsst:afw::geom::Angle.

Definition at line 206 of file SkyWcs.h.

◆ then()

template<class FromEndpoint, class ToEndpoint>
template<class NextToEndpoint >
Transform<FromEndpoint, NextToEndpoint> lsst::afw::geom::Transform< FromEndpoint, ToEndpoint >::then ( Transform< ToEndpoint, NextToEndpoint > const &  next) const
inherited

Concatenate two Transforms.

Template Parameters
NextToEndpointthe "to" Endpoint of next
Parameters
nextthe Transform to apply after this one
Returns
a Transform that first applies this transform to its input, and then next to the result. Its inverse shall first apply the inverse of next, and then the inverse of this transform.
Exceptions
pex::exceptions::InvalidParameterErrorThrown if getToEndpoint() and next.getFromEndpoint() do not have the same number of axes.
Exception Safety
Provides basic exception safety.

More than two Transforms can be combined in series. For example:

auto pixelsToSky = pixelsToFp.then(fpToField).then(fieldToSky);

◆ writeStream()

void lsst::afw::geom::SkyWcs::writeStream ( std::ostream &  os) const
overridevirtual

Serialize this SkyWcs to an output stream.

Version 1 format is as follows:

  • The version number (an integer)
  • A space
  • The short class name, as obtained from getShortClassName
  • A space
  • The contained ast::FrameSet written using FrameSet.show(os, false)
Parameters
[out]osoutput stream to which to serialize this SkyWcs

Reimplemented from lsst::afw::geom::Transform< FromEndpoint, ToEndpoint >.

◆ writeString()

std::string lsst::afw::geom::SkyWcs::writeString ( ) const
overridevirtual

Serialize this SkyWcs to a string, using the same format as writeStream.

Reimplemented from lsst::afw::geom::Transform< FromEndpoint, ToEndpoint >.


The documentation for this class was generated from the following file: