LSST Applications 27.0.0,g0265f82a02+469cd937ee,g02d81e74bb+21ad69e7e1,g1470d8bcf6+cbe83ee85a,g2079a07aa2+e67c6346a6,g212a7c68fe+04a9158687,g2305ad1205+94392ce272,g295015adf3+81dd352a9d,g2bbee38e9b+469cd937ee,g337abbeb29+469cd937ee,g3939d97d7f+72a9f7b576,g487adcacf7+71499e7cba,g50ff169b8f+5929b3527e,g52b1c1532d+a6fc98d2e7,g591dd9f2cf+df404f777f,g5a732f18d5+be83d3ecdb,g64a986408d+21ad69e7e1,g858d7b2824+21ad69e7e1,g8a8a8dda67+a6fc98d2e7,g99cad8db69+f62e5b0af5,g9ddcbc5298+d4bad12328,ga1e77700b3+9c366c4306,ga8c6da7877+71e4819109,gb0e22166c9+25ba2f69a1,gb6a65358fc+469cd937ee,gbb8dafda3b+69d3c0e320,gc07e1c2157+a98bf949bb,gc120e1dc64+615ec43309,gc28159a63d+469cd937ee,gcf0d15dbbd+72a9f7b576,gdaeeff99f8+a38ce5ea23,ge6526c86ff+3a7c1ac5f1,ge79ae78c31+469cd937ee,gee10cc3b42+a6fc98d2e7,gf1cff7945b+21ad69e7e1,gfbcc870c63+9a11dc8c8f
LSST Data Management Base Package
|
A registry of 2-dimensional coordinate transforms for a specific camera. More...
#include <TransformMap.h>
Classes | |
struct | Connection |
Representation of a single edge in the graph defined by a TransformMap. More... | |
class | Factory |
Public Types | |
using | Transforms = std::unordered_map<CameraSys, std::shared_ptr<geom::TransformPoint2ToPoint2>> |
using | CameraSysIterator = boost::transform_iterator<GetKey, CameraSysFrameIdMap::const_iterator> |
Public Member Functions | |
~TransformMap () noexcept | |
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. | |
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. | |
CameraSysIterator | begin () const |
CameraSysIterator | end () const |
bool | contains (CameraSys const &system) const noexcept |
Can this transform to and from the specified coordinate system? | |
std::shared_ptr< geom::TransformPoint2ToPoint2 > | getTransform (CameraSys const &fromSys, CameraSys const &toSys) const |
Get a Transform from one camera coordinate system to another. | |
size_t | size () const noexcept |
Get the number of supported coordinate systems. | |
std::vector< Connection > | getConnections () const |
Return the sequence of connections used to construct this Transform. | |
bool | isPersistable () const noexcept override |
TransformMaps should always be Persistable. | |
void | writeFits (std::string const &fileName, std::string const &mode="w") const |
Write the object to a regular FITS file. | |
void | writeFits (fits::MemFileManager &manager, std::string const &mode="w") const |
Write the object to a FITS image in memory. | |
void | writeFits (fits::Fits &fitsfile) const |
Write the object to an already-open FITS object. | |
TransformMap (TransformMap const &other)=delete | |
TransformMap (TransformMap &&other)=delete | |
TransformMap & | operator= (TransformMap const &)=delete |
TransformMap & | operator= (TransformMap &&)=delete |
Static Public Member 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. | |
static std::shared_ptr< TransformMap const > | make (CameraSys const &reference, std::vector< Connection > const &connections) |
Construct a TransformMap from a sequence of Connections. | |
static std::shared_ptr< TransformMap > | readFits (fits::Fits &fitsfile) |
Read an object from an already open FITS object. | |
static std::shared_ptr< TransformMap > | readFits (std::string const &fileName, int hdu=fits::DEFAULT_HDU) |
Read an object from a regular FITS file. | |
static std::shared_ptr< TransformMap > | readFits (fits::MemFileManager &manager, int hdu=fits::DEFAULT_HDU) |
Read an object from a FITS file in memory. | |
static std::shared_ptr< TransformMap > | dynamicCast (std::shared_ptr< Persistable > const &ptr) |
Dynamically cast a shared_ptr. | |
Protected Types | |
using | OutputArchiveHandle = io::OutputArchiveHandle |
Private Member Functions | |
std::string | getPersistenceName () const override |
Return the unique name used to persist this object and look up its factory. | |
std::string | getPythonModule () const override |
Return the fully-qualified Python module that should be imported to guarantee that its factory is registered. | |
void | write (OutputArchiveHandle &handle) const override |
Write the object to one or more catalogs. | |
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:
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).
Definition at line 62 of file TransformMap.h.
using lsst::afw::cameraGeom::TransformMap::CameraSysIterator = boost::transform_iterator<GetKey, CameraSysFrameIdMap::const_iterator> |
Definition at line 75 of file TransformMap.h.
|
protectedinherited |
Definition at line 108 of file Persistable.h.
using lsst::afw::cameraGeom::TransformMap::Transforms = std::unordered_map<CameraSys, std::shared_ptr<geom::TransformPoint2ToPoint2>> |
Definition at line 74 of file TransformMap.h.
|
delete |
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.
|
delete |
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.
|
defaultnoexcept |
|
inline |
Definition at line 164 of file TransformMap.h.
|
noexcept |
Can this transform to and from the specified coordinate system?
system | The coordinate system to search for |
true
if system
is supported, false
otherwiseDefinition at line 215 of file TransformMap.cc.
|
staticinherited |
Dynamically cast a shared_ptr.
Dynamically cast a shared pointer and raise on failure.
You must provide an explicit template instantiation in the .cc file for each class that inherits from PersistableFacade. Designed to work around RTTI issues on macOS with hidden symbols;
lsst::pex::exceptions::LogicError | if the cast fails |
param[in] ptr The pointer to be cast.
lsst::pex::exceptions::TypeError | If the dynamic cast fails. |
Definition at line 218 of file Persistable.cc.
|
inline |
Definition at line 166 of file TransformMap.h.
std::vector< TransformMap::Connection > lsst::afw::cameraGeom::TransformMap::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 to make
with the same reference system.
Definition at line 278 of file TransformMap.cc.
|
overrideprivatevirtual |
Return the unique name used to persist this object and look up its factory.
Must be less than ArchiveIndexSchema::MAX_NAME_LENGTH characters.
Reimplemented from lsst::afw::table::io::Persistable.
Definition at line 381 of file TransformMap.cc.
|
overrideprivatevirtual |
Return the fully-qualified Python module that should be imported to guarantee that its factory is registered.
Must be less than ArchiveIndexSchema::MAX_MODULE_LENGTH characters.
Will be ignored if empty.
Reimplemented from lsst::afw::table::io::Persistable.
Definition at line 385 of file TransformMap.cc.
std::shared_ptr< geom::TransformPoint2ToPoint2 > lsst::afw::cameraGeom::TransformMap::getTransform | ( | CameraSys const & | fromSys, |
CameraSys const & | toSys ) const |
Get a Transform from one camera coordinate system to another.
fromSys,toSys | Camera coordinate systems between which to transform |
fromSys
to toSys
in the forward direction. The Transform will be invertible.lsst::pex::exceptions::InvalidParameterError | Thrown if either fromSys or toSys is not supported. |
Definition at line 217 of file TransformMap.cc.
|
inlineoverridevirtualnoexcept |
TransformMaps should always be Persistable.
Reimplemented from lsst::afw::table::io::Persistable.
Definition at line 210 of file TransformMap.h.
|
static |
Construct a TransformMap from a sequence of Connections.
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. |
lsst::pex::exceptions::InvalidParameterError | Thrown if the graph defined by the given connections does not define a single unique path (which may involve multiple Connections) between any CameraSys and the reference CameraSys. |
This method is wrapped as a regular constructor in Python.
Definition at line 188 of file TransformMap.cc.
|
static |
Construct a TransformMap with all transforms relative to a single reference CameraSys.
reference | Coordinate system from which each Transform in transforms converts. |
transforms | A map whose keys are camera coordinate systems, and whose values point to Transforms that convert from reference to the corresponding key. All Transforms must be invertible. |
lsst::pex::exceptions::InvalidParameterError | Thrown if transforms contains the reference camera system as a key, or if any Transform is not invertible. |
This method is wrapped as a regular constructor in Python.
Definition at line 173 of file TransformMap.cc.
|
delete |
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.
|
delete |
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.
|
inlinestaticinherited |
Read an object from an already open FITS object.
[in] | fitsfile | FITS object to read from, already positioned at the desired HDU. |
Definition at line 183 of file Persistable.h.
|
inlinestaticinherited |
Read an object from a FITS file in memory.
[in] | manager | Manager for the memory to read from. |
[in] | hdu | HDU to read, where 0 is the primary. The special value of afw::fits::DEFAULT_HDU skips the primary HDU if it is empty. |
Definition at line 205 of file Persistable.h.
|
inlinestaticinherited |
Read an object from a regular FITS file.
[in] | fileName | Name of the file to read. |
[in] | hdu | HDU to read, where 0 is the primary. The special value of afw::fits::DEFAULT_HDU skips the primary HDU if it is empty. |
Definition at line 194 of file Persistable.h.
|
noexcept |
Get the number of supported coordinate systems.
Definition at line 237 of file TransformMap.cc.
lsst::geom::Point2D lsst::afw::cameraGeom::TransformMap::transform | ( | lsst::geom::Point2D const & | point, |
CameraSys const & | fromSys, | ||
CameraSys const & | toSys ) const |
Convert a point from one camera coordinate system to another.
point | Point from which to transform |
fromSys,toSys | Camera coordinate systems between which to transform |
getTransform(fromSys, toSys).applyForward(point)
.lsst::pex::exceptions::InvalidParameterError | Thrown if either fromSys or toSys is not supported. |
Definition at line 202 of file TransformMap.cc.
std::vector< lsst::geom::Point2D > lsst::afw::cameraGeom::TransformMap::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.
Definition at line 208 of file TransformMap.cc.
|
overrideprivatevirtual |
Write the object to one or more catalogs.
The handle object passed to this function provides an interface for adding new catalogs and adding nested objects to the same archive (while checking for duplicates). See OutputArchiveHandle for more information.
Reimplemented from lsst::afw::table::io::Persistable.
Definition at line 389 of file TransformMap.cc.
|
inherited |
Write the object to an already-open FITS object.
[in] | fitsfile | Open FITS object to write to. |
Definition at line 18 of file Persistable.cc.
|
inherited |
Write the object to a FITS image in memory.
[in] | manager | Name of the file to write to. |
[in] | mode | If "w", any existing file with the given name will be overwritten. If "a", new HDUs will be appended to an existing file. |
Definition at line 29 of file Persistable.cc.
|
inherited |
Write the object to a regular FITS file.
[in] | fileName | Name of the file to write to. |
[in] | mode | If "w", any existing file with the given name will be overwritten. If "a", new HDUs will be appended to an existing file. |
Definition at line 24 of file Persistable.cc.