Class TransformMap¶
Defined in File TransformMap.h
Nested Relationships¶
Inheritance Relationships¶
Base Types¶
public lsst::afw::table::io::PersistableFacade< TransformMap >
(Template Class PersistableFacade)public lsst::afw::table::io::Persistable
(Class Persistable)
Class Documentation¶
-
class
TransformMap
: public lsst::afw::table::io::PersistableFacade<TransformMap>, public lsst::afw::table::io::Persistable¶ A registry of 2-dimensional coordinate transforms for a specific camera.
Represents the interrelationships between camera coordinate systems for a particular camera. It can be seen as a mapping between a pair of CameraSys and a Transform between them (though it does not conform to either the C++ map or Python dictionary APIs).
TransformMap supports:
Transforming between any two supported CameraSys using the transform methods.
Retrieving a transform between any two supported CameraSys using getTransform.
Iteration over supported CameraSys using begin and end in C++ and standard Python iteration in Python.
TransformMap is immutable and must always be held by shared_ptr; this is enforced by making all non-deleted constructors private, and instead providing static
make
member functions for construction (in Python, these are exposed as regular constructors).Unless otherwise specified, all methods guarantee only basic exception safety.
Unnamed Group
-
TransformMap
(TransformMap const &other)¶ TransformMap is immutable, so both moving and copying are prohibited. It is also always held by shared_ptr, so there is no good reason to copy it.
-
TransformMap
(TransformMap &&other)¶
-
TransformMap &
operator=
(TransformMap const&)¶
-
TransformMap &
operator=
(TransformMap&&)¶
Public Types
-
using
Transforms
= std::unordered_map<CameraSys, std::shared_ptr<geom::TransformPoint2ToPoint2>>¶
Public Functions
-
~TransformMap
()¶
-
lsst::geom::Point2D
transform
(lsst::geom::Point2D const &point, CameraSys const &fromSys, CameraSys const &toSys) const¶ Convert a point from one camera coordinate system to another.
- Return
the transformed value. Equivalent to
getTransform(fromSys, toSys).applyForward(point)
.- Parameters
point
: Point from which to transformfromSystoSys
: Camera coordinate systems between which to transform
- Exceptions
lsst::pex::exceptions::InvalidParameterError
: Thrown if eitherfromSys
ortoSys
is not supported.
-
std::vector<lsst::geom::Point2D>
transform
(std::vector<lsst::geom::Point2D> const &pointList, CameraSys const &fromSys, CameraSys const &toSys) const¶ Convert a list of points from one coordinate system to another.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
-
CameraSysIterator
begin
() const¶
-
CameraSysIterator
end
() const¶
-
bool
contains
(CameraSys const &system) const¶ Can this transform to and from the specified coordinate system?
Shall not throw exceptions.
- Return
true
ifsystem
is supported,false
otherwise- Parameters
system
: The coordinate system to search for
-
std::shared_ptr<geom::TransformPoint2ToPoint2>
getTransform
(CameraSys const &fromSys, CameraSys const &toSys) const¶ Get a Transform from one camera coordinate system to another.
- Return
a Transform that converts from
fromSys
totoSys
in the forward direction. The Transform will be invertible.- Parameters
fromSystoSys
: Camera coordinate systems between which to transform
- Exceptions
lsst::pex::exceptions::InvalidParameterError
: Thrown if eitherfromSys
ortoSys
is not supported.
-
size_t
size
() const¶ Get the number of supported coordinate systems.
Shall not throw exceptions.
-
std::vector<Connection>
getConnections
() const¶ Return the sequence of connections used to construct this Transform.
The order of the connections may differ from the original order, but is guaranteed to yield the same
TransformMap
when passed tomake
with the same reference system.
-
bool
isPersistable
() const¶ TransformMaps should always be Persistable.
Public Static Functions
-
static std::shared_ptr<TransformMap const>
make
(CameraSys const &reference, Transforms const &transforms)¶ Construct a TransformMap with all transforms relative to a single reference CameraSys.
This method is wrapped as a regular constructor in Python.
- Parameters
reference
: Coordinate system from which each Transform intransforms
converts.transforms
: A map whose keys are camera coordinate systems, and whose values point to Transforms that convert fromreference
to the corresponding key. All Transforms must be invertible.
- Exceptions
lsst::pex::exceptions::InvalidParameterError
: Thrown iftransforms
contains thereference
camera system as a key, or if any Transform is not invertible.
-
static std::shared_ptr<TransformMap const>
make
(CameraSys const &reference, std::vector<Connection> const &connections)¶ Construct a TransformMap from a sequence of Connections.
This method is wrapped as a regular constructor in Python.
- Parameters
reference
: Initial coordinate system that must be connected to all other coordinate systems in the map.connections
: Sequence of Connection structs, each of which relates two CameraSys via the Transform that connects them.
- Exceptions
-
struct
Connection
¶ Representation of a single edge in the graph defined by a TransformMap.
Public Functions
-
void
reverse
()¶ Reverse the connection, by swapping fromSys and toSys and inverting the transform.
-
void