|
lsst.afw
14.0-17-gfc02bf727
|
Transform LSST spatial data, such as Point2D and IcrsCoord, using an AST transform. More...
#include <Transform.h>
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 | |
| Transform (Transform const &)=default | |
| Transform (Transform &&)=default | |
| Transform & | operator= (Transform const &)=delete |
| Transform & | operator= (Transform &&)=delete |
| Transform (ast::Mapping const &mapping, bool simplify=true) | |
| Construct a Transform from a deep copy of an ast::Mapping. More... | |
| Transform (ast::FrameSet const &frameSet, bool simplify=true) | |
| Construct a Transform from a deep copy of a FrameSet. More... | |
| virtual | ~Transform () |
| 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... | |
| virtual void | writeStream (std::ostream &os) const |
| Serialize this Transform to an output stream. More... | |
| virtual std::string | writeString () const |
| Serialize this Transform to a string, using the same format as writeStream. More... | |
Static Public Member Functions | |
| static std::string | getShortClassName () |
| Return a short version of the class name with no punctuation. More... | |
| static Transform< FromEndpoint, ToEndpoint > | readStream (std::istream &is) |
| Deserialize a Transform of this type from an input stream. More... | |
| static Transform< FromEndpoint, ToEndpoint > | readString (std::string &str) |
| Deserialize a Transform of this type from a string, using the same format as readStream. More... | |
Protected Member Functions | |
| Transform (std::shared_ptr< ast::FrameSet > &&frameSet) | |
| Construct a Transform from a shared pointer to a FrameSet. More... | |
Transform LSST spatial data, such as Point2D and IcrsCoord, using an AST transform.
This class contains two Endpoints, to specify the "from" and "to" LSST data type, and an ast::FrameSet or ast::Mapping to specify the transformation. In the case of a FrameSet the transformation is from the BASE frame to the CURRENT frame. The endpoints convert the data between the LSST Form (e.g. Point2D) and the form used by astshim.
Depending on the ast::FrameSet or ast::Mapping used to define it, a Transform may provide either a forward transform, an inverse transform, or both. In particular, the inverse of a forward-only transform is an inverse-only transform. The hasForward and hasInverse methods can be used to check which transforms are available.
Unless otherwise stated, all constructors and methods may throw std::runtime_error to indicate internal errors within AST.
applyForward and applyInverse are not available because data must be copied when converting from LSST data types to the type used by astshim, so it didn't seem worth the bother. Definition at line 64 of file Transform.h.
| using lsst::afw::geom::Transform< FromEndpoint, ToEndpoint >::FromArray = typename FromEndpoint::Array |
Definition at line 66 of file Transform.h.
| using lsst::afw::geom::Transform< FromEndpoint, ToEndpoint >::FromPoint = typename FromEndpoint::Point |
Definition at line 67 of file Transform.h.
| using lsst::afw::geom::Transform< FromEndpoint, ToEndpoint >::ToArray = typename ToEndpoint::Array |
Definition at line 68 of file Transform.h.
| using lsst::afw::geom::Transform< FromEndpoint, ToEndpoint >::ToPoint = typename ToEndpoint::Point |
Definition at line 69 of file Transform.h.
|
default |
|
default |
|
explicit |
Construct a Transform from a deep copy of an ast::Mapping.
The internal FrameSet consists of a frame constructed by each endpoint connected by the mapping.
| [in] | mapping | ast::Mapping describing the desired transformation |
| [in] | simplify | Simplify the mapping? This combines component mappings and removes redundant components where possible. |
|
explicit |
Construct a Transform from a deep copy of a FrameSet.
The result transforms from the "base" frame to the "current" frame. The "from" endpoint is used to normalize the "base" frame and the "to" endpoint is used to normalize the "current" frame.
This is pickier than the constructor that takes an ast::Mapping in that:
| [in] | frameSet | ast::FrameSet describing the desired transformation in the usual way: from "base" frame to "current" frame |
| [in] | simplify | Simplify the frame set? This simplifies each mapping in the frame set by combining component mappings and removing redundant components where possible. However it does not remove any frames. |
|
inlinevirtual |
Definition at line 110 of file Transform.h.
|
explicitprotected |
Construct a Transform from a shared pointer to a FrameSet.
| ToPoint lsst::afw::geom::Transform< FromEndpoint, ToEndpoint >::applyForward | ( | FromPoint const & | point | ) | const |
Transform one point in the forward direction ("from" to "to")
| ToArray lsst::afw::geom::Transform< FromEndpoint, ToEndpoint >::applyForward | ( | FromArray const & | array | ) | const |
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...
| FromPoint lsst::afw::geom::Transform< FromEndpoint, ToEndpoint >::applyInverse | ( | ToPoint const & | point | ) | const |
Transform one point in the inverse direction ("to" to "from")
| FromArray lsst::afw::geom::Transform< FromEndpoint, ToEndpoint >::applyInverse | ( | ToArray const & | array | ) | const |
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...
|
inline |
Get the contained frameset.
Definition at line 134 of file Transform.h.
|
inline |
Get the "from" endpoint.
Definition at line 129 of file Transform.h.
| Transform<ToEndpoint, FromEndpoint> lsst::afw::geom::Transform< FromEndpoint, ToEndpoint >::getInverse | ( | ) | const |
| Eigen::MatrixXd lsst::afw::geom::Transform< FromEndpoint, ToEndpoint >::getJacobian | ( | FromPoint const & | x | ) | const |
The Jacobian matrix of this Transform.
The matrix is defined only if this object has a forward transform.
| x | the position at which the Jacobian shall be evaluated |
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.x. If the implementation requires interpolation, computation of the Jacobian may require hundreds of evaluations of applyForward.
|
static |
Return a short version of the class name with no punctuation.
Used as the Python class name and for persistence as a string
Returns "Transform" + fromEndpoint.getClassPrefix() + "To" + toEndpoint.getClassPrefix(), for example "TransformPoint2ToIcrsCoord" or "TransformPoint2ToGeneric".
|
inline |
Get the "to" endpoint.
Definition at line 139 of file Transform.h.
|
inline |
Test if this method has a forward transform.
Definition at line 117 of file Transform.h.
|
inline |
Test if this method has an inverse transform.
Definition at line 124 of file Transform.h.
|
delete |
|
delete |
|
static |
|
static |
Deserialize a Transform of this type from a string, using the same format as readStream.
| Transform<FromEndpoint, NextToEndpoint> lsst::afw::geom::Transform< FromEndpoint, ToEndpoint >::then | ( | Transform< ToEndpoint, NextToEndpoint > const & | next | ) | const |
Concatenate two Transforms.
| NextToEndpoint | the "to" Endpoint of next |
| next | the Transform to apply after this one |
next to the result. Its inverse shall first apply the inverse of next, and then the inverse of this transform.| pex::exceptions::InvalidParameterError | Thrown if getToEndpoint() and next.getFromEndpoint() do not have the same number of axes. |
More than two Transforms can be combined in series. For example:
auto pixelsToSky = pixelsToFp.then(fpToField).then(fieldToSky);
|
virtual |
Serialize this Transform to an output stream.
Version 1 format is as follows:
| [out] | os | outpu stream to which to serialize this Transform |
Reimplemented in lsst::afw::geom::SkyWcs.
|
virtual |
Serialize this Transform to a string, using the same format as writeStream.
Reimplemented in lsst::afw::geom::SkyWcs.
1.8.13