LSSTApplications
17.0+11,17.0+34,17.0+56,17.0+57,17.0+59,17.0+7,17.0-1-g377950a+33,17.0.1-1-g114240f+2,17.0.1-1-g4d4fbc4+28,17.0.1-1-g55520dc+49,17.0.1-1-g5f4ed7e+52,17.0.1-1-g6dd7d69+17,17.0.1-1-g8de6c91+11,17.0.1-1-gb9095d2+7,17.0.1-1-ge9fec5e+5,17.0.1-1-gf4e0155+55,17.0.1-1-gfc65f5f+50,17.0.1-1-gfc6fb1f+20,17.0.1-10-g87f9f3f+1,17.0.1-11-ge9de802+16,17.0.1-16-ga14f7d5c+4,17.0.1-17-gc79d625+1,17.0.1-17-gdae4c4a+8,17.0.1-2-g26618f5+29,17.0.1-2-g54f2ebc+9,17.0.1-2-gf403422+1,17.0.1-20-g2ca2f74+6,17.0.1-23-gf3eadeb7+1,17.0.1-3-g7e86b59+39,17.0.1-3-gb5ca14a,17.0.1-3-gd08d533+40,17.0.1-30-g596af8797,17.0.1-4-g59d126d+4,17.0.1-4-gc69c472+5,17.0.1-6-g5afd9b9+4,17.0.1-7-g35889ee+1,17.0.1-7-gc7c8782+18,17.0.1-9-gc4bbfb2+3,w.2019.22
LSSTDataManagementBasePackage
|
A registry of 2-dimensional coordinate transforms for a specific camera. More...
#include <TransformMap.h>
Classes | |
class | Builder |
Helper class used to incrementally construct TransformMap instances. 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. More... | |
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. More... | |
CameraSysIterator | begin () const |
CameraSysIterator | end () const |
bool | contains (CameraSys const &system) const noexcept |
Can this transform to and from the specified coordinate system? More... | |
std::shared_ptr< geom::TransformPoint2ToPoint2 > | getTransform (CameraSys const &fromSys, CameraSys const &toSys) const |
Get a Transform from one camera coordinate system to another. More... | |
size_t | size () const noexcept |
Get the number of supported coordinate systems. More... | |
bool | isPersistable () const noexcept override |
TransformMaps should always be Persistable. More... | |
void | writeFits (std::string const &fileName, std::string const &mode="w") const |
Write the object to a regular FITS file. More... | |
void | writeFits (fits::MemFileManager &manager, std::string const &mode="w") const |
Write the object to a FITS image in memory. More... | |
void | writeFits (fits::Fits &fitsfile) const |
Write the object to an already-open FITS object. More... | |
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. More... | |
static std::shared_ptr< TransformMap > | readFits (fits::Fits &fitsfile) |
Read an object from an already open FITS object. More... | |
static std::shared_ptr< TransformMap > | readFits (std::string const &fileName, int hdu=fits::DEFAULT_HDU) |
Read an object from a regular FITS file. More... | |
static std::shared_ptr< TransformMap > | readFits (fits::MemFileManager &manager, int hdu=fits::DEFAULT_HDU) |
Read an object from a FITS file in memory. More... | |
static std::shared_ptr< TransformMap > | dynamicCast (std::shared_ptr< Persistable > const &ptr) |
Dynamically cast a shared_ptr. More... | |
Protected Types | |
typedef io::OutputArchiveHandle | OutputArchiveHandle |
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. Simple TransformMaps in which all transforms are relative to a single CameraSys can be constructed via the make
static member function, while more general construction is provided by the Builder class.
Definition at line 64 of file TransformMap.h.
using lsst::afw::cameraGeom::TransformMap::CameraSysIterator = boost::transform_iterator<GetKey, CameraSysFrameIdMap::const_iterator> |
Definition at line 77 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 76 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 131 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 67 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 18 of file Persistable.cc.
|
inline |
Definition at line 133 of file TransformMap.h.
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 69 of file TransformMap.cc.
|
inlineoverridevirtualnoexcept |
TransformMaps should always be Persistable.
Reimplemented from lsst::afw::table::io::Persistable.
Definition at line 169 of file TransformMap.h.
|
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. |
Definition at line 42 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 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.
|
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.
|
noexcept |
Get the number of supported coordinate systems.
Definition at line 89 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 54 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 60 of file TransformMap.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.
|
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 an already-open FITS object.
[in] | fitsfile | Open FITS object to write to. |
Definition at line 18 of file Persistable.cc.