LSSTApplications  20.0.0
LSSTDataManagementBasePackage
TransformMap.cc
Go to the documentation of this file.
1 // -*- lsst-c++ -*-
2 /*
3  * Developed for the LSST Data Management System.
4  * This product includes software developed by the LSST Project
5  * (https://www.lsst.org).
6  * See the COPYRIGHT file at the top-level directory of this distribution
7  * for details of code ownership.
8  *
9  * This program is free software: you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation, either version 3 of the License, or
12  * (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program. If not, see <https://www.gnu.org/licenses/>.
21  */
22 #include <sstream>
23 #include <unordered_set>
24 
25 #include "lsst/log/Log.h"
26 #include "lsst/pex/exceptions.h"
32 
33 namespace lsst {
34 namespace afw {
35 namespace cameraGeom {
36 
37 namespace {
38 
39 // Allows conversions between LSST and AST data formats
40 static lsst::afw::geom::Point2Endpoint const POINT2_ENDPOINT;
41 
42 static auto LOGGER = LOG_GET("afw.cameraGeom.TransformMap");
43 
44 // Make an AST Frame name for a CameraSys.
45 std::string makeFrameName(CameraSys const & sys) {
46  std::string r = "Ident=" + sys.getSysName();
47  if (sys.hasDetectorName()) {
48  r += "_";
49  r += sys.getDetectorName();
50  }
51  return r;
52 }
53 
54 /*
55  * Make a vector of `Connection` instances that can be safely passed to
56  * TransformMap's private constructor.
57  *
58  * This guarantees that:
59  * - Connections are sorted according to their distance (in number of
60  * intermediate connections) from the given reference `CameraSys`;
61  * - The `fromSys` of each `Connection` is closer to the reference than the
62  * `toSys`.
63  *
64  * @param[in] reference Reference coordinate system. All systems must be
65  * (indirectly) connected to this system, and will be
66  * sorted according to the number of connections to it.
67  * @param[in] connections Vector of `Connection` instances. Passed by value so
68  * we can either move into it (avoiding a copy) or copy
69  * into it (when we have a const reference and a copy is
70  * unavoidable), depending on the context.
71  *
72  * @returns connections An updated version of the connections vector.
73  *
74  * @throws pex::exceptions::InvalidParameterError Thrown if the vector of
75  * connections graph is empty, contains cycles, is not fully connected, or
76  * includes any connections in which `fromSys == toSys`.
77  */
78 std::vector<TransformMap::Connection> standardizeConnections(
79  CameraSys const & reference,
81 ) {
82  if (connections.empty()) {
83  throw LSST_EXCEPT(
84  pex::exceptions::InvalidParameterError,
85  "Cannot create a TransformMap with no connections."
86  );
87  }
88  // Iterator to the first unprocessed connection in result; will be
89  // incremented as we proceed.
90  auto firstUnprocessed = connections.begin();
91  // All CameraSys whose associated Connections are already in the processed
92  // part of `connections`.
93  std::unordered_set<CameraSys> knownSystems = {reference};
94  // The set of CameraSys whose associated Connections are being processed
95  // in this iteration of the outer (while) loop. These are all some common
96  // distance N from the reference system (in number of connections), where
97  // N increases for each iteration (but is not tracked).
98  std::unordered_set<CameraSys> currentSystems = {reference};
99  // The set of CameraSys that will become currentSys at the next
100  // iteration.
101  std::unordered_set<CameraSys> nextSystems;
102  LOGLS_DEBUG(LOGGER, "Standardizing: starting with reference " << reference);
103  while (!currentSystems.empty()) {
104  LOGLS_DEBUG(LOGGER, "Standardizing: beginning iteration with currentSystems={ ");
105  for (auto const & sys : currentSystems) {
106  LOGLS_DEBUG(LOGGER, "Standardizing: " << sys << ", ");
107  }
108  LOGLS_DEBUG(LOGGER, "Standardizing: }");
109  // Iterate over all unsorted connections, looking for those associated
110  // with a CameraSys in currentSystems.
111  for (auto connection = firstUnprocessed; connection != connections.end(); ++connection) {
112  bool related = currentSystems.count(connection->fromSys) > 0;
113  if (!related && currentSystems.count(connection->toSys)) {
114  LOGLS_DEBUG(LOGGER, "Standardizing: reversing " << (*connection));
115  // Safe because `connections` is passed by value.
116  connection->reverse();
117  related = true;
118  }
119  if (related) {
120  if (connection->toSys == connection->fromSys) {
122  ss << "Identity connection found: " << (*connection) << ".";
123  throw LSST_EXCEPT(pex::exceptions::InvalidParameterError, ss.str());
124  }
125  if (knownSystems.count(connection->toSys)) {
127  ss << "Multiple paths between reference " << reference
128  << " and " << connection->toSys << ".";
129  throw LSST_EXCEPT(pex::exceptions::InvalidParameterError, ss.str());
130  }
131  LOGLS_DEBUG(LOGGER, "Standardizing: adding " << (*connection));
132  nextSystems.insert(connection->toSys);
133  knownSystems.insert(connection->toSys);
134  std::swap(*firstUnprocessed, *connection);
135  ++firstUnprocessed;
136  }
137  }
138  currentSystems.swap(nextSystems);
139  nextSystems.clear();
140  }
141  // Any connections we haven't processed yet must include only CameraSys
142  // we've never seen before.
143  if (firstUnprocessed != connections.end()) {
145  ss << "Disconnected connection(s) found: " << (*firstUnprocessed);
146  ++firstUnprocessed;
147  for (auto connection = firstUnprocessed; connection != connections.end(); ++connection) {
148  ss << ", " << (*connection);
149  }
150  ss << ".";
151  throw LSST_EXCEPT(pex::exceptions::InvalidParameterError, ss.str());
152  }
153  // No RVO, because this is a function argument, but it's still a move so we
154  // don't care.
155  return connections;
156 }
157 
158 // Return the reference coordinate system from an already-standardized vector of connections.
159 CameraSys getReferenceSys(std::vector<TransformMap::Connection> const & connections) {
160  return connections.front().fromSys;
161 }
162 
163 } // anonymous
164 
166  transform = transform->inverted();
167  toSys.swap(fromSys);
168 }
169 
171  return os << connection.fromSys << "->" << connection.toSys;
172 }
173 
175  CameraSys const & reference,
176  Transforms const & transforms
177 ) {
178  std::vector<Connection> connections;
179  connections.reserve(transforms.size());
180  for (auto const & pair : transforms) {
181  connections.push_back(Connection{pair.second, reference, pair.first});
182  }
183  // We can't use make_shared because TransformMap ctor is private.
185  new TransformMap(standardizeConnections(reference, std::move(connections)))
186  );
187 }
188 
190  CameraSys const &reference,
191  std::vector<Connection> const & connections
192 ) {
193  // We can't use make_shared because TransformMap ctor is private.
195  new TransformMap(standardizeConnections(reference, connections))
196  );
197 }
198 
199 
200 // All resources owned by value or by smart pointer
201 TransformMap::~TransformMap() noexcept = default;
202 
203 lsst::geom::Point2D TransformMap::transform(lsst::geom::Point2D const &point, CameraSys const &fromSys,
204  CameraSys const &toSys) const {
205  auto mapping = _getMapping(fromSys, toSys);
206  return POINT2_ENDPOINT.pointFromData(mapping->applyForward(POINT2_ENDPOINT.dataFromPoint(point)));
207 }
208 
210  CameraSys const &fromSys,
211  CameraSys const &toSys) const {
212  auto mapping = _getMapping(fromSys, toSys);
213  return POINT2_ENDPOINT.arrayFromData(mapping->applyForward(POINT2_ENDPOINT.dataFromArray(pointList)));
214 }
215 
216 bool TransformMap::contains(CameraSys const &system) const noexcept { return _frameIds.count(system) > 0; }
217 
219  CameraSys const &toSys) const {
220  return std::make_shared<geom::TransformPoint2ToPoint2>(*_getMapping(fromSys, toSys));
221 }
222 
223 int TransformMap::_getFrame(CameraSys const &system) const {
224  try {
225  return _frameIds.at(system);
226  } catch (std::out_of_range const &e) {
227  std::ostringstream buffer;
228  buffer << "Unsupported coordinate system: " << system;
230  }
231 }
232 
233 std::shared_ptr<ast::Mapping const> TransformMap::_getMapping(CameraSys const &fromSys,
234  CameraSys const &toSys) const {
235  return _frameSet->getMapping(_getFrame(fromSys), _getFrame(toSys));
236 }
237 
238 size_t TransformMap::size() const noexcept { return _frameIds.size(); }
239 
240 
242  _connections(std::move(connections))
243 {
244  // standardizeConnections must be run by anything that calls the
245  // constructor, and that should throw on all of the conditions we assert
246  // on below (which is why those are asserts).
247  assert(!_connections.empty());
248 
249  int nFrames = 0; // tracks frameSet->getNFrame() to avoid those (expensive) calls
250 
251  // Local helper function that creates a Frame, updates the nFrames counter,
252  // and adds an entry to the frameIds map. Returns the new Frame.
253  // Should always be called in concert with an update to frameSet.
254  auto addFrameForSys = [this, &nFrames](CameraSys const & sys) mutable -> ast::Frame {
255  #ifndef NDEBUG
256  auto r = // We only care about this return value for the assert below;
257  #endif
258  _frameIds.emplace(sys, ++nFrames);
259  assert(r.second); // this must actually insert something, not find an already-inserted CameraSys.
260  return ast::Frame(2, makeFrameName(sys));
261  };
262 
263  // FrameSet that manages all transforms; should always be updated in
264  // concert with a call to addFrameForSys.
265  _frameSet = std::make_unique<ast::FrameSet>(addFrameForSys(getReferenceSys(_connections)));
266 
267  for (auto const & connection : _connections) {
268  auto fromSysIdIter = _frameIds.find(connection.fromSys);
269  assert(fromSysIdIter != _frameIds.end());
270  _frameSet->addFrame(fromSysIdIter->second, *connection.transform->getMapping(),
271  addFrameForSys(connection.toSys));
272  }
273 
274  // We've maintained our own counter for frame IDs for performance and
275  // convenience reasons, but it had better match AST's internal counter.
276  assert(_frameSet->getNFrame() == nFrames);
277 }
278 
280 
281 
282 namespace {
283 
284 struct PersistenceHelper {
285 
286  static PersistenceHelper const & get() {
287  static PersistenceHelper const instance;
288  return instance;
289  }
290 
291  // Schema and keys for the catalog that stores Connection objects.
292  // Considered as a graph, 'from' and 'to' identify vertices, and
293  // 'transform' identifies an edge.
294  table::Schema schema;
295  table::Key<std::string> fromSysName;
296  table::Key<std::string> fromSysDetectorName;
297  table::Key<std::string> toSysName;
298  table::Key<std::string> toSysDetectorName;
299  table::Key<int> transform;
300 
301 private:
302 
303  PersistenceHelper() :
304  schema(),
305  fromSysName(schema.addField<std::string>("fromSysName",
306  "Camera coordinate system name.", "", 0)),
307  fromSysDetectorName(schema.addField<std::string>("fromSysDetectorName",
308  "Camera coordinate system detector name.", "", 0)),
309  toSysName(schema.addField<std::string>("toSysName",
310  "Camera coordinate system name.", "", 0)),
311  toSysDetectorName(schema.addField<std::string>("toSysDetectorName",
312  "Camera coordinate system detector name.", "", 0)),
313  transform(schema.addField<int>("transform", "Archive ID of the transform.", ""))
314  {}
315 
316  PersistenceHelper(PersistenceHelper const &) = delete;
317  PersistenceHelper(PersistenceHelper &&) = delete;
318 
319  PersistenceHelper & operator=(PersistenceHelper const &) = delete;
320  PersistenceHelper & operator=(PersistenceHelper &&) = delete;
321 
322 };
323 
324 
325 // PersistenceHelper for a previous format version; now only supported in
326 // reading.
327 struct OldPersistenceHelper {
328 
329  static OldPersistenceHelper const & get() {
330  static OldPersistenceHelper const instance;
331  return instance;
332  }
333 
334  // Schema and keys for the catalog that stores TransformMap._frameIds.
335  // Considered as a graph, this is a list of all of the vertices with the
336  // integers that identify them in the list of edges below.
337  table::Schema sysSchema;
338  table::Key<std::string> sysName;
339  table::Key<std::string> detectorName;
340  table::Key<int> id;
341 
342  // Schema and keys for the catalog that stores
343  // TransformMap._canonicalConnections entries and the associated Transform
344  // extracted from TransformMap._transforms.
345  // Considered as a graph, 'from' and 'to' identify vertices, and
346  // 'transform' identifies an edge.
347  table::Schema connectionSchema;
348  table::Key<int> from;
349  table::Key<int> to;
350  table::Key<int> transform;
351 
352  CameraSys makeCameraSys(table::BaseRecord const & record) const {
353  return CameraSys(record.get(sysName), record.get(detectorName));
354  }
355 
356 private:
357 
358  OldPersistenceHelper() :
359  sysSchema(),
360  sysName(sysSchema.addField<std::string>("sysName", "Camera coordinate system name", "", 0)),
361  detectorName(sysSchema.addField<std::string>("detectorName",
362  "Camera coordinate system detector name", "", 0)),
363  id(sysSchema.addField<int>("id", "AST ID of the Frame for the CameraSys", "")),
365  from(connectionSchema.addField<int>("from", "AST ID of the Frame this transform maps from.", "")),
366  to(connectionSchema.addField<int>("to", "AST ID of the Frame this transform maps to.", "")),
367  transform(connectionSchema.addField<int>("transform", "Archive ID of the transform.", ""))
368  {}
369 
370  OldPersistenceHelper(OldPersistenceHelper const &) = delete;
371  OldPersistenceHelper(OldPersistenceHelper &&) = delete;
372 
373  OldPersistenceHelper & operator=(OldPersistenceHelper const &) = delete;
374  OldPersistenceHelper & operator=(OldPersistenceHelper &&) = delete;
375 
376 };
377 
378 
379 } // namespace
380 
381 
382 std::string TransformMap::getPersistenceName() const {
383  return "TransformMap";
384 }
385 
386 std::string TransformMap::getPythonModule() const {
387  return "lsst.afw.cameraGeom";
388 }
389 
390 void TransformMap::write(OutputArchiveHandle& handle) const {
391  auto const & keys = PersistenceHelper::get();
392 
393  auto cat = handle.makeCatalog(keys.schema);
394  for (auto const & connection : _connections) {
395  auto record = cat.addNew();
396  record->set(keys.fromSysName, connection.fromSys.getSysName());
397  record->set(keys.fromSysDetectorName, connection.fromSys.getDetectorName());
398  record->set(keys.toSysName, connection.toSys.getSysName());
399  record->set(keys.toSysDetectorName, connection.toSys.getDetectorName());
400  record->set(keys.transform, handle.put(connection.transform));
401  }
402  handle.saveCatalog(cat);
403 }
404 
406 public:
407 
408  Factory() : PersistableFactory("TransformMap") {}
409 
411  CatalogVector const& catalogs) const {
412  auto const & keys = OldPersistenceHelper::get();
413 
414  LSST_ARCHIVE_ASSERT(catalogs.size() == 2u);
415  auto const & sysCat = catalogs[0];
416  auto const & connectionCat = catalogs[1];
417  LSST_ARCHIVE_ASSERT(sysCat.getSchema() == keys.sysSchema);
418  LSST_ARCHIVE_ASSERT(connectionCat.getSchema() == keys.connectionSchema);
419  LSST_ARCHIVE_ASSERT(sysCat.size() == connectionCat.size() + 1);
420  LSST_ARCHIVE_ASSERT(sysCat.isSorted(keys.id));
421 
423  for (auto const & sysRecord : sysCat) {
424  auto sys = keys.makeCameraSys(sysRecord);
425  sysById.emplace(sysRecord.get(keys.id), sys);
426  }
427 
428  auto const referenceSysIter = sysById.find(1);
429  LSST_ARCHIVE_ASSERT(referenceSysIter != sysById.end());
430  std::vector<Connection> connections;
431  for (auto const & connectionRecord : connectionCat) {
432  auto const fromSysIter = sysById.find(connectionRecord.get(keys.from));
433  LSST_ARCHIVE_ASSERT(fromSysIter != sysById.end());
434  auto const toSysIter = sysById.find(connectionRecord.get(keys.to));
435  LSST_ARCHIVE_ASSERT(toSysIter != sysById.end());
436  auto const transform = archive.get<geom::TransformPoint2ToPoint2>(
437  connectionRecord.get(keys.transform)
438  );
439 
440  connections.push_back(Connection{transform, fromSysIter->second, toSysIter->second});
441  }
442 
443  connections = standardizeConnections(referenceSysIter->second, std::move(connections));
444  return std::shared_ptr<TransformMap>(new TransformMap(std::move(connections)));
445  }
446 
448  CatalogVector const& catalogs) const override {
449  if (catalogs.size() == 2u) {
450  return readOld(archive, catalogs);
451  }
452 
453  auto const & keys = PersistenceHelper::get();
454 
455  LSST_ARCHIVE_ASSERT(catalogs.size() == 1u);
456  auto const & cat = catalogs[0];
457  LSST_ARCHIVE_ASSERT(cat.getSchema() == keys.schema);
458 
459  std::vector<Connection> connections;
460  for (auto const & record : cat) {
461  CameraSys const fromSys(record.get(keys.fromSysName), record.get(keys.fromSysDetectorName));
462  CameraSys const toSys(record.get(keys.toSysName), record.get(keys.toSysDetectorName));
463  auto const transform = archive.get<geom::TransformPoint2ToPoint2>(record.get(keys.transform));
464  connections.push_back(Connection{transform, fromSys, toSys});
465  }
466 
467  // Deserialized connections should already be standardized, but be
468  // defensive anyway.
469  auto const referenceSys = getReferenceSys(connections);
470  connections = standardizeConnections(referenceSys, std::move(connections));
471  return std::shared_ptr<TransformMap>(new TransformMap(std::move(connections)));
472  }
473 
474  static Factory const registration;
475 
476 };
477 
479 
480 } // namespace cameraGeom
481 
482 namespace table {
483 namespace io {
484 
485 template class PersistableFacade<cameraGeom::TransformMap>;
486 
487 } // namespace io
488 } // namespace table
489 
490 } // namespace afw
491 } // namespace lsst
lsst::afw::geom::Point2Endpoint::pointFromData
Point pointFromData(std::vector< double > const &data) const override
Get a single point from raw data.
Definition: Endpoint.cc:138
from
table::Key< int > from
Definition: TransformMap.cc:348
ast::FrameSet::getNFrame
int getNFrame() const
Get FrameSet_NFrame "NFrame": number of Frames in the FrameSet, starting from 1.
Definition: FrameSet.h:316
std::string
STL class.
std::shared_ptr
STL class.
std::move
T move(T... args)
schema
table::Schema schema
Definition: TransformMap.cc:294
std::unordered_set
STL class.
lsst::afw::cameraGeom::CameraSys::swap
void swap(CameraSys &other) noexcept
Definition: CameraSys.h:107
std::vector::reserve
T reserve(T... args)
std::vector
STL class.
std::unordered_map::find
T find(T... args)
std::unordered_map::size
T size(T... args)
Persistable.cc
sysName
table::Key< std::string > sysName
Definition: TransformMap.cc:338
toSysDetectorName
table::Key< std::string > toSysDetectorName
Definition: TransformMap.cc:298
lsst::afw
Definition: imageAlgorithm.dox:1
lsst::afw::table::io::InputArchive
A multi-catalog archive object used to load table::io::Persistable objects.
Definition: InputArchive.h:31
std::unordered_map::emplace
T emplace(T... args)
LOG_GET
#define LOG_GET(logger)
Definition: Log.h:75
lsst::afw::cameraGeom::operator<<
std::ostream & operator<<(std::ostream &os, CameraSysPrefix const &detSysPrefix)
Definition: CameraSys.cc:47
astshim.keyMap.keyMapContinued.keys
def keys(self)
Definition: keyMapContinued.py:6
lsst::afw::cameraGeom::TransformMap::TransformMap
TransformMap(TransformMap const &other)=delete
CatalogVector.h
lsst::afw::cameraGeom::TransformMap::~TransformMap
~TransformMap() noexcept
lsst::afw::geom::Point2Endpoint::dataFromPoint
std::vector< double > dataFromPoint(Point const &point) const override
Definition: Endpoint.cc:115
lsst::geom::Point2D
Point< double, 2 > Point2D
Definition: Point.h:324
lsst::afw::geom::Point2Endpoint
An endpoint for lsst::geom::Point2D.
Definition: Endpoint.h:261
std::vector::front
T front(T... args)
std::unordered_set::clear
T clear(T... args)
lsst::afw::table::io::PersistableFactory::PersistableFactory
PersistableFactory(std::string const &name)
Constructor for the factory.
Definition: Persistable.cc:74
std::vector::push_back
T push_back(T... args)
LSST_ARCHIVE_ASSERT
#define LSST_ARCHIVE_ASSERT(EXPR)
An assertion macro used to validate the structure of an InputArchive.
Definition: Persistable.h:48
lsst::afw::cameraGeom::TransformMap::make
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.
Definition: TransformMap.cc:174
lsst::afw::cameraGeom::TransformMap::transform
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.
Definition: TransformMap.cc:203
lsst::afw::cameraGeom::TransformMap::size
size_t size() const noexcept
Get the number of supported coordinate systems.
Definition: TransformMap.cc:238
lsst::afw::cameraGeom::TransformMap::getTransform
std::shared_ptr< geom::TransformPoint2ToPoint2 > getTransform(CameraSys const &fromSys, CameraSys const &toSys) const
Get a Transform from one camera coordinate system to another.
Definition: TransformMap.cc:218
ast::Frame
Frame is used to represent a coordinate system.
Definition: Frame.h:157
std::unordered_map::at
T at(T... args)
std::ostream
STL class.
connectionSchema
table::Schema connectionSchema
Definition: TransformMap.cc:347
std::throw_with_nested
T throw_with_nested(T... args)
lsst::afw::cameraGeom::TransformMap::Factory
Definition: TransformMap.cc:405
lsst::afw::cameraGeom::TransformMap::contains
bool contains(CameraSys const &system) const noexcept
Can this transform to and from the specified coordinate system?
Definition: TransformMap.cc:216
lsst::afw::table::io::CatalogVector
A vector of catalogs used by Persistable.
Definition: CatalogVector.h:29
lsst::afw::geom::TransformPoint2ToPoint2
Transform< Point2Endpoint, Point2Endpoint > TransformPoint2ToPoint2
Definition: Transform.h:300
lsst::afw::table::io::PersistableFactory
A base class for factory classes used to reconstruct objects from records.
Definition: Persistable.h:228
sysSchema
table::Schema sysSchema
Definition: TransformMap.cc:337
lsst
A base class for image defects.
Definition: imageAlgorithm.dox:1
lsst::afw::cameraGeom::TransformMap::Factory::read
std::shared_ptr< Persistable > read(InputArchive const &archive, CatalogVector const &catalogs) const override
Construct a new object from the given InputArchive and vector of catalogs.
Definition: TransformMap.cc:447
LSST_EXCEPT
#define LSST_EXCEPT(type,...)
Create an exception with a given type.
Definition: Exception.h:48
std::swap
T swap(T... args)
LOGLS_DEBUG
#define LOGLS_DEBUG(logger, message)
Definition: Log.h:608
std::ostringstream
STL class.
to
table::Key< int > to
Definition: TransformMap.cc:349
lsst::geom
Definition: geomOperators.dox:4
os
std::ostream * os
Definition: Schema.cc:746
lsst::afw::cameraGeom::TransformMap::getConnections
std::vector< Connection > getConnections() const
Return the sequence of connections used to construct this Transform.
Definition: TransformMap.cc:279
lsst::pex::exceptions::InvalidParameterError
Reports invalid arguments.
Definition: Runtime.h:66
ast::FrameSet::addFrame
virtual void addFrame(int iframe, Mapping const &map, Frame const &frame)
Add a new Frame and an associated Mapping to this FrameSet so as to define a new coordinate system,...
Definition: FrameSet.h:210
std::vector::begin
T begin(T... args)
lsst::afw::geom::Point2Endpoint::dataFromArray
ndarray::Array< double, 2, 2 > dataFromArray(Array const &arr) const override
Definition: Endpoint.cc:124
std
STL namespace.
std::unordered_set::insert
T insert(T... args)
lsst::afw::cameraGeom::TransformMap::Factory::readOld
std::shared_ptr< Persistable > readOld(InputArchive const &archive, CatalogVector const &catalogs) const
Definition: TransformMap.cc:410
lsst::afw::cameraGeom::TransformMap::Connection::transform
std::shared_ptr< geom::TransformPoint2ToPoint2 const > transform
Definition: TransformMap.h:81
TransformMap.h
std::unordered_set::count
T count(T... args)
toSysName
table::Key< std::string > toSysName
Definition: TransformMap.cc:297
std::vector::empty
T empty(T... args)
transform
table::Key< int > transform
Definition: TransformMap.cc:299
std::out_of_range
STL class.
std::ostringstream::str
T str(T... args)
InputArchive.h
lsst::afw::cameraGeom::TransformMap::Connection::reverse
void reverse()
Reverse the connection, by swapping fromSys and toSys and inverting the transform.
Definition: TransformMap.cc:165
std::vector::end
T end(T... args)
detectorName
table::Key< std::string > detectorName
Definition: TransformMap.cc:339
lsst::afw::cameraGeom::TransformMap
A registry of 2-dimensional coordinate transforms for a specific camera.
Definition: TransformMap.h:62
ast::FrameSet::getMapping
std::shared_ptr< Mapping > getMapping(int from=BASE, int to=CURRENT) const
Obtain a Mapping that converts between two Frames in a FrameSet.
Definition: FrameSet.h:304
lsst::afw::cameraGeom::TransformMap::Factory::Factory
Factory()
Definition: TransformMap.cc:408
lsst::afw::cameraGeom::TransformMap::Connection::fromSys
CameraSys fromSys
Definition: TransformMap.h:82
std::unordered_map
STL class.
Log.h
LSST DM logging module built on log4cxx.
fromSysDetectorName
table::Key< std::string > fromSysDetectorName
Definition: TransformMap.cc:296
OutputArchive.h
exceptions.h
lsst::afw::cameraGeom::TransformMap::Factory::registration
static Factory const registration
Definition: TransformMap.cc:474
lsst::afw::cameraGeom::TransformMap::Connection::toSys
CameraSys toSys
Definition: TransformMap.h:83
lsst::afw::cameraGeom::CameraSys
Camera coordinate system; used as a key in in TransformMap.
Definition: CameraSys.h:83
lsst::afw::cameraGeom::TransformMap::Connection
Representation of a single edge in the graph defined by a TransformMap.
Definition: TransformMap.h:80
lsst::afw::table::io::InputArchive::get
std::shared_ptr< Persistable > get(int id) const
Load the Persistable with the given ID and return it.
Definition: InputArchive.cc:182
lsst::afw::geom::Point2Endpoint::arrayFromData
Array arrayFromData(ndarray::Array< double, 2, 2 > const &data) const override
Get an array of points from raw data.
Definition: Endpoint.cc:148
fromSysName
table::Key< std::string > fromSysName
Definition: TransformMap.cc:295
id
table::Key< int > id
Definition: TransformMap.cc:340