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
Loading...
Searching...
No Matches
Detector.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 <utility>
24#include <unordered_set>
25
32
33namespace lsst {
34namespace afw {
35namespace cameraGeom {
36
37namespace {
38
40
41// Find the amplifier with the given name in an iterator range.
42//
43// @tparam Iter iterator that dererences to a [smart] pointer to Amplifier.
44template <typename Iter>
45Iter findAmpIterByName(Iter first, Iter last, std::string const & name) {
46 auto iter = std::find_if(first, last, [&name](auto const & ptr) { return ptr->getName() == name; });
47 if (iter == last) {
48 throw LSST_EXCEPT(
49 pex::exceptions::InvalidParameterError,
50 (boost::format("Amplifier with name %s not found.") % name).str()
51 );
52 }
53 return iter;
54}
55
56} // anonymous
57
59 return std::make_shared<PartialRebuilder>(*this);
60}
61
64 auto nativeToCameraSys = _transformMap->getTransform(getNativeCoordSys(), cameraSys);
65 return nativeToCameraSys->applyForward(nativeCorners);
66}
67
69 return getCorners(makeCameraSys(cameraSysPrefix));
70}
71
73 auto ctrPix = lsst::geom::Box2D(getBBox()).getCenter();
74 auto transform = getTransform(PIXELS, cameraSys);
75 return transform->applyForward(ctrPix);
76}
77
79 return getCenter(makeCameraSys(cameraSysPrefix));
80}
81
82bool Detector::hasTransform(CameraSys const &cameraSys) const { return _transformMap->contains(cameraSys); }
83
84bool Detector::hasTransform(CameraSysPrefix const &cameraSysPrefix) const {
85 return hasTransform(makeCameraSys(cameraSysPrefix));
86}
87
88template <typename FromSysT, typename ToSysT>
90 ToSysT const &toSys) const {
91 return _transformMap->getTransform(makeCameraSys(fromSys), makeCameraSys(toSys));
92}
93
94template <typename FromSysT, typename ToSysT>
95lsst::geom::Point2D Detector::transform(lsst::geom::Point2D const &point, FromSysT const &fromSys,
96 ToSysT const &toSys) const {
97 return _transformMap->transform(point, makeCameraSys(fromSys), makeCameraSys(toSys));
98}
99
100template <typename FromSysT, typename ToSysT>
102 FromSysT const &fromSys, ToSysT const &toSys) const {
103 return _transformMap->transform(points, makeCameraSys(fromSys), makeCameraSys(toSys));
104}
105
107 return *findAmpIterByName(_amplifiers.begin(), _amplifiers.end(), name);
108}
109
110namespace {
111
112void checkForDuplicateAmpNames(AmpVector const & amplifiers) {
113 std::unordered_set<std::string> amplifierNames;
114 for (auto const &ptr : amplifiers) {
115 if (!amplifierNames.insert(ptr->getName()).second) {
117 (boost::format("Multiple amplifiers with name %s") % ptr->getName()).str());
118 }
119 }
120}
121
122void checkCrosstalkShape(Detector::CrosstalkMatrix const & crosstalk, std::size_t nAmps,
123 std::string const & detectorName) {
124 auto shape = crosstalk.getShape();
125 assert(shape.size() == 2); // we've declared this as a 2D array
126 if (shape[0] != shape[1]) {
128 os << "Non-square crosstalk matrix: " << crosstalk << " for detector \"" << detectorName << "\"";
130 }
131 if (shape[0] != nAmps) {
133 os << "Wrong size crosstalk matrix: " << crosstalk << " for detector \"" << detectorName << "\"";
135 }
136}
137
138} // anonymous
139
140Detector::Detector(Fields fields, std::shared_ptr<TransformMap const> transformMap,
141 AmpVector &&amplifiers) :
142 _fields(std::move(fields)), _transformMap(std::move(transformMap)), _amplifiers(std::move(amplifiers))
143{
144 checkForDuplicateAmpNames(_amplifiers);
145 if (hasCrosstalk()) {
146 checkCrosstalkShape(getCrosstalk(), _amplifiers.size(), getName());
147 }
148}
149
150namespace {
151
152// Version history:
153// unversioned: original Detector schema
154// 1: physicalType added (version is implicit)
155// 2: fpPosition Point2D -> Point3D (version explicitly added to schema)
156int constexpr SERIALIZATION_VERSION = 2;
157
158class DetectorSchema {
159public:
160 table::Schema schema;
161 table::Key<std::string> name;
162 table::Key<int> id;
163 table::Key<int> type;
164 table::Key<std::string> serial;
167 table::Point2DKey fpPosition2; // needed for version < 2
170 table::Key<lsst::geom::Angle> yaw;
171 table::Key<lsst::geom::Angle> pitch;
172 table::Key<lsst::geom::Angle> roll;
173 table::Key<int> transformMap;
174 table::Key<table::Array<float>> crosstalk;
175 table::Key<std::string> physicalType;
176 table::Key<int> version;
177
178 // No copying
179 DetectorSchema(const DetectorSchema&) = delete;
180 DetectorSchema& operator=(const DetectorSchema&) = delete;
181
182 // No moving
183 DetectorSchema(DetectorSchema&&) = delete;
184 DetectorSchema& operator=(DetectorSchema&&) = delete;
185
186 DetectorSchema(int detectorVersion = SERIALIZATION_VERSION)
187 : schema(),
188 name(schema.addField<std::string>("name", "Name of the detector", "", 0)),
189 id(schema.addField<int>("id", "Integer ID for the detector", "")),
190 type(schema.addField<int>("type", "Raw DetectorType enum value", "")),
191 serial(schema.addField<std::string>("serial", "Serial name of the detector", "", 0)),
192 bbox(table::Box2IKey::addFields(schema, "bbox", "Detector bounding box", "pixel")),
193 pixelSize(table::Point2DKey::addFields(schema, "pixelSize", "Physical pixel size", "mm"))
194 {
195 if (detectorVersion >= 2) {
196 fpPosition = table::Point3DKey::addFields(
197 schema, "fpPosition", "Focal plane position of reference point", "mm"
198 );
199 } else {
201 schema, "fpPosition", "Focal plane position of reference point", "mm"
202 );
203 }
205 schema, "refPoint", "Pixel position of reference point", "pixel"
206 );
207 yaw = schema.addField<lsst::geom::Angle>("yaw", "Rotation about Z (X to Y), 1st rotation");
208 pitch = schema.addField<lsst::geom::Angle>("pitch", "Rotation about Y' (Z'=Z to X'), 2nd rotation");
209 roll = schema.addField<lsst::geom::Angle>("roll", "Rotation about X'' (Y''=Y' to Z''), 3rd rotation");
210 transformMap = schema.addField<int>("transformMap", "Archive ID of TransformMap", "");
211 crosstalk = schema.addField<table::Array<float>>("crosstalk", "Crosstalk matrix, flattened", "", 0);
212
213 if (detectorVersion >= 1) {
214 physicalType = schema.addField<std::string>("physicalType", "Physical type of the detector", "", 0);
215 }
216 if (detectorVersion >= 2) {
217 version = schema.addField<int>("version", "version of this Detector");
218 }
219 }
220
221};
222
223} // anonymous
224
226public:
227
228 explicit Factory(std::string const& name) : PersistableFactory(name) {}
229
231 InputArchive const& archive,
232 CatalogVector const& catalogs
233 ) const override {
234 LSST_ARCHIVE_ASSERT(catalogs.size() == 2u);
235 LSST_ARCHIVE_ASSERT(catalogs.front().size() == 1u);
236 auto const & record = catalogs.front().front();
237 int version = getVersion(catalogs);
238 if (version > SERIALIZATION_VERSION) {
239 throw LSST_EXCEPT(
241 "Cannot read Detector FITS version > " +
242 std::to_string(SERIALIZATION_VERSION)
243 );
244 }
245 auto const & keys = DetectorSchema(version);
246
247 AmpVector amps;
248 amps.reserve(catalogs.back().size());
249 for (auto const & record : catalogs.back()) {
250 amps.push_back(Amplifier::Builder::fromRecord(record).finish());
251 }
252
253 auto flattenedMatrix = record.get(keys.crosstalk);
254 ndarray::Array<float, 2, 2> crosstalk;
255 if (!flattenedMatrix.isEmpty()) {
256 crosstalk = ndarray::allocate(amps.size(), amps.size());
257 ndarray::flatten<1>(crosstalk) = flattenedMatrix;
258 }
259
260 // get values for not-always-present fields if present
261 const auto physicalType = (version >= 1) ? record.get(keys.physicalType) : "";
262
264 if (version >= 2) {
265 fpPosition = record.get(keys.fpPosition);
266 } else {
267 lsst::geom::Point2D fpPosition2(record.get(keys.fpPosition2));
269 }
270
271 Fields fields = {
272 record.get(keys.name),
273 record.get(keys.id),
274 static_cast<DetectorType>(record.get(keys.type)),
275 record.get(keys.serial),
276 record.get(keys.bbox),
279 record.get(keys.refPoint),
280 record.get(keys.yaw),
281 record.get(keys.pitch),
282 record.get(keys.roll)
283 ),
284 lsst::geom::Extent2D(record.get(keys.pixelSize)),
285 crosstalk,
287 };
288
290 new Detector(
291 std::move(fields),
292 archive.get<TransformMap>(record.get(keys.transformMap)),
293 std::move(amps)
294 )
295 );
296 }
297
298 static Factory const registration;
299
300private:
301 int getVersion(CatalogVector const& catalogs) const {
302 try {
303 auto const & record = catalogs.front().front();
304 // Don't assume version is at same index as in DetectorSchema
305 auto versionKey = record.getSchema().find<int>("version");
306 return record.get(versionKey.key);
307 } catch (pex::exceptions::NotFoundError const&) {
308 // version = find_physicalType ? 1 : 0
309 try {
310 catalogs.front().getSchema().find<std::string>("physicalType");
311 return 1;
312 } catch (pex::exceptions::NotFoundError const&) {
313 return 0;
314 }
315 }
316 }
317};
318
320 return "Detector";
321}
322
324
326 return "lsst.afw.cameraGeom";
327}
328
330 auto const & keys = DetectorSchema();
331
332 auto cat = handle.makeCatalog(keys.schema);
333 auto record = cat.addNew();
334 record->set(keys.name, getName());
335 record->set(keys.id, getId());
336 record->set(keys.type, static_cast<int>(getType()));
337 record->set(keys.serial, getSerial());
338 record->set(keys.bbox, getBBox());
339 record->set(keys.pixelSize, lsst::geom::Point2D(getPixelSize()));
340 auto orientation = getOrientation();
341 record->set(keys.fpPosition, orientation.getFpPosition3());
342 record->set(keys.refPoint, orientation.getReferencePoint());
343 record->set(keys.yaw, orientation.getYaw());
344 record->set(keys.pitch, orientation.getPitch());
345 record->set(keys.roll, orientation.getRoll());
346 record->set(keys.transformMap, handle.put(getTransformMap()));
347
348 auto flattenMatrix = [](ndarray::Array<float const, 2> const & matrix) {
349 // copy because the original isn't guaranteed to have
350 // row-major contiguous elements
351 ndarray::Array<float, 2, 2> copied = ndarray::copy(matrix);
352 // make a view to the copy
353 ndarray::Array<float, 1, 1> flattened = ndarray::flatten<1>(copied);
354 return flattened;
355 };
356
357 record->set(keys.crosstalk, flattenMatrix(getCrosstalk()));
358 record->set(keys.physicalType, getPhysicalType());
359 record->set(keys.version, SERIALIZATION_VERSION);
360 handle.saveCatalog(cat);
361
362 auto ampCat = handle.makeCatalog(Amplifier::getRecordSchema());
363 ampCat.reserve(getAmplifiers().size());
364 for (auto const & amp : getAmplifiers()) {
365 auto record = ampCat.addNew();
366 amp->toRecord(*record);
367 }
368 handle.saveCatalog(ampCat);
369}
370
371
373 return *findAmpIterByName(_amplifiers.begin(), _amplifiers.end(), name);
374}
375
377 _amplifiers.push_back(std::move(builder));
378}
379
381 Detector const & detector
382) {
384 result.reserve(detector.size());
385 for (auto const & ampPtr : detector) {
386 result.push_back(std::make_shared<Amplifier::Builder>(*ampPtr));
387 }
388 return result;
389}
390
392 _fields.name = name;
393 _fields.id = id;
394}
395
396Detector::Builder::~Builder() noexcept = default;
397
398AmpVector Detector::Builder::finishAmplifiers() const {
399 AmpVector result;
400 result.reserve(_amplifiers.size());
401 for (auto const & ampBuilderPtr : _amplifiers) {
402 result.push_back(ampBuilderPtr->finish());
403 }
404 return result;
405}
406
407
409 Builder(detector._fields, rebuildAmplifiers(detector)),
410 _transformMap(detector.getTransformMap())
411{}
412
414 return std::shared_ptr<Detector>(new Detector(getFields(), _transformMap, finishAmplifiers()));
415}
416
417
418namespace {
419
420// Return the first connection in the given range that has toSys as its "to"
421// endpoint.
422//
423// @tparam Iter Iterator that dereferences to `Connection const &`.
424//
425template <typename Iter>
426Iter findConnection(Iter first, Iter last, CameraSys const & toSys) {
427 return std::find_if(
428 first, last,
429 [&toSys](auto const & connection) {
430 return connection.toSys == toSys;
431 }
432 );
433}
434
435} // anonymous
436
437
439 CameraSysPrefix const & toSys,
441) {
442 return setTransformFromPixelsTo(makeCameraSys(toSys), std::move(transform));
443}
444
446 CameraSys const & toSys,
448) {
449 if (toSys.getDetectorName() != getName()) {
450 throw LSST_EXCEPT(
452 (boost::format("Cannot add coordinate system for detector '%s' to detector '%s'.") %
453 toSys.getDetectorName() % getName()).str()
454 );
455 }
456 auto iter = findConnection(_connections.begin(), _connections.end(), toSys);
457 if (iter == _connections.end()) {
458 _connections.push_back(
460 );
461 } else {
462 iter->transform = transform;
463 }
464}
465
467 return discardTransformFromPixelsTo(makeCameraSys(toSys));
468}
469
471 if (toSys.getDetectorName() != getName()) {
472 throw LSST_EXCEPT(
474 (boost::format("Cannot add coordinate system for detector '%s' to detector '%s'.") %
475 toSys.getDetectorName() % getName()).str()
476 );
477 }
478 auto iter = findConnection(_connections.begin(), _connections.end(), toSys);
479 if (iter != _connections.end()) {
480 _connections.erase(iter);
481 return true;
482 }
483 return false;
484}
485
486
487Detector::InCameraBuilder::InCameraBuilder(Detector const & detector) :
488 Builder(detector.getFields(), rebuildAmplifiers(detector))
489{}
490
491Detector::InCameraBuilder::InCameraBuilder(std::string const & name, int id) :
492 Builder(name, id)
493{}
494
495
496std::shared_ptr<Detector const> Detector::InCameraBuilder::finish(
498) const {
499 auto amplifiers = finishAmplifiers();
501 new Detector(getFields(), std::move(transformMap), std::move(amplifiers))
502 );
503}
504
505
506//
507// Explicit instantiations
508//
509#define INSTANTIATE(FROMSYS, TOSYS) \
510 template std::shared_ptr<geom::TransformPoint2ToPoint2> Detector::getTransform(FROMSYS const &, \
511 TOSYS const &) const; \
512 template lsst::geom::Point2D Detector::transform(lsst::geom::Point2D const &, FROMSYS const &, \
513 TOSYS const &) const; \
514 template std::vector<lsst::geom::Point2D> Detector::transform(std::vector<lsst::geom::Point2D> const &, \
515 FROMSYS const &, TOSYS const &) const;
516
517INSTANTIATE(CameraSys, CameraSys);
518INSTANTIATE(CameraSys, CameraSysPrefix);
519INSTANTIATE(CameraSysPrefix, CameraSys);
520INSTANTIATE(CameraSysPrefix, CameraSysPrefix);
521
522} // namespace cameraGeom
523
524namespace table {
525namespace io {
526
527template class PersistableFacade<cameraGeom::Detector>;
528
529} // namespace io
530} // namespace table
531
532
533} // namespace afw
534} // namespace lsst
py::object result
Definition _schema.cc:429
table::Key< std::string > name
Definition Amplifier.cc:116
AmpInfoBoxKey bbox
Definition Amplifier.cc:117
table::Key< int > transformMap
Definition Camera.cc:125
table::Key< int > id
Definition Detector.cc:162
table::Point2DKey refPoint
Definition Detector.cc:169
table::Point3DKey fpPosition
Definition Detector.cc:168
table::Key< lsst::geom::Angle > yaw
Definition Detector.cc:170
table::Point2DKey fpPosition2
Definition Detector.cc:167
table::Key< lsst::geom::Angle > roll
Definition Detector.cc:172
#define INSTANTIATE(FROMSYS, TOSYS)
Definition Detector.cc:509
table::Key< std::string > physicalType
Definition Detector.cc:175
table::Point2DKey pixelSize
Definition Detector.cc:166
table::Key< lsst::geom::Angle > pitch
Definition Detector.cc:171
table::Key< std::string > serial
Definition Detector.cc:164
table::Key< table::Array< float > > crosstalk
Definition Detector.cc:174
table::Key< int > detector
#define LSST_EXCEPT(type,...)
Create an exception with a given type.
Definition Exception.h:48
uint64_t * ptr
Definition RangeSet.cc:95
std::ostream * os
Definition Schema.cc:557
table::Key< int > transform
table::Key< std::string > detectorName
#define LSST_ARCHIVE_ASSERT(EXPR)
An assertion macro used to validate the structure of an InputArchive.
Definition Persistable.h:48
static Builder fromRecord(table::BaseRecord const &record)
Construct a new Builder object from the fields in the given record.
Definition Amplifier.cc:286
std::shared_ptr< Amplifier const > finish() const
Construct an immutable Amplifier with the same values as the Builder.
Definition Amplifier.cc:282
static table::Schema getRecordSchema()
Return the schema used in the afw.table representation of amplifiers.
Definition Amplifier.cc:267
Camera coordinate system; used as a key in in TransformMap.
Definition CameraSys.h:83
std::string getDetectorName() const
Get detector name, or "" if not a detector-specific coordinate system.
Definition CameraSys.h:120
Camera coordinate system prefix.
Definition CameraSys.h:44
A helper class for Detector that allows amplifiers and most fields to be modified.
Definition Detector.h:362
static std::vector< std::shared_ptr< Amplifier::Builder > > rebuildAmplifiers(Detector const &detector)
Create a vector of Amplifier::Builders from the Amplifiers in a Detector.
Definition Detector.cc:380
void append(std::shared_ptr< Amplifier::Builder > builder)
Append a new amplifier.
Definition Detector.cc:376
std::shared_ptr< Amplifier::Builder > operator[](size_t i) const
Get the amplifier builder specified by index.
Definition Detector.h:435
Factory(std::string const &name)
Definition Detector.cc:228
std::shared_ptr< table::io::Persistable > read(InputArchive const &archive, CatalogVector const &catalogs) const override
Construct a new object from the given InputArchive and vector of catalogs.
Definition Detector.cc:230
void setTransformFromPixelsTo(CameraSysPrefix const &toSys, std::shared_ptr< afw::geom::TransformPoint2ToPoint2 const > transform)
Set the transformation from PIXELS to the given coordinate system.
Definition Detector.cc:438
bool discardTransformFromPixelsTo(CameraSysPrefix const &toSys)
Remove any transformation from PIXELS to the given coordinate system.
Definition Detector.cc:466
PartialRebuilder(Detector const &detector)
Construct a PartialRebuilder initialized to the state of the given Detector.
Definition Detector.cc:408
std::shared_ptr< Detector const > finish() const
Construct a new Detector from the current state of the Builder.
Definition Detector.cc:413
lsst::geom::Box2I getBBox() const
Get the bounding box.
Definition Detector.h:85
lsst::geom::Extent2D getPixelSize() const
Get size of pixel along (mm)
Definition Detector.h:91
std::string getName() const
Get the detector name.
Definition Detector.h:64
CameraSys getNativeCoordSys() const
The "native" coordinate system of this detector.
Definition Detector.h:123
bool hasCrosstalk() const
Have we got crosstalk coefficients?
Definition Detector.h:94
int getId() const
Get the detector ID.
Definition Detector.h:67
std::string getPhysicalType() const
Get the detector's physical type.
Definition Detector.h:82
Orientation getOrientation() const
Get detector's orientation in the focal plane.
Definition Detector.h:88
std::string getSerial() const
Get the detector serial "number".
Definition Detector.h:73
CameraSys makeCameraSys(CameraSys const &cameraSys) const
Get a coordinate system from a coordinate system (return input unchanged and untested)
Definition Detector.h:110
CrosstalkMatrix getCrosstalk() const
Get the crosstalk coefficients.
Definition Detector.h:100
ndarray::Array< float const, 2 > CrosstalkMatrix
Definition Detector.h:59
DetectorType getType() const
Return the purpose of this detector.
Definition Detector.h:70
A representation of a detector in a mosaic camera.
Definition Detector.h:185
std::vector< std::shared_ptr< Amplifier const > > const & getAmplifiers() const
Return the sequence of Amplifiers directly.
Definition Detector.h:270
bool hasTransform(CameraSys const &cameraSys) const
Can this object convert between PIXELS and the specified camera coordinate system?
Definition Detector.cc:82
std::shared_ptr< afw::geom::TransformPoint2ToPoint2 > getTransform(FromSysT const &fromSys, ToSysT const &toSys) const
Get a Transform from one camera coordinate system, or camera coordinate system prefix,...
std::string getPythonModule() const override
Return the fully-qualified Python module that should be imported to guarantee that its factory is reg...
Definition Detector.cc:325
std::size_t size() const
Get the number of amplifiers.
Definition Detector.h:299
std::shared_ptr< Amplifier const > operator[](size_t i) const
Get the amplifier specified by index.
Definition Detector.h:287
std::string getPersistenceName() const override
Return the unique name used to persist this object and look up its factory.
Definition Detector.cc:319
std::shared_ptr< TransformMap const > getTransformMap() const
Get the transform registry.
Definition Detector.h:267
Fields const & getFields() const override
Return a reference to a Fields struct.
Definition Detector.h:306
void write(OutputArchiveHandle &handle) const override
Write the object to one or more catalogs.
Definition Detector.cc:329
lsst::geom::Point2D transform(lsst::geom::Point2D const &point, FromSysT const &fromSys, ToSysT const &toSys) const
Transform a point from one camera system to another.
Definition Detector.cc:95
std::vector< lsst::geom::Point2D > getCorners(CameraSys const &cameraSys) const
Get the corners of the detector in the specified camera coordinate system.
Definition Detector.cc:62
lsst::geom::Point2D getCenter(CameraSys const &cameraSys) const
Get the center of the detector in the specified camera coordinate system.
Definition Detector.cc:72
std::shared_ptr< PartialRebuilder > rebuild() const
Return a Builder object initialized with the state of this Detector.
Definition Detector.cc:58
Describe a detector's orientation in the focal plane.
Definition Orientation.h:51
A registry of 2-dimensional coordinate transforms for a specific camera.
std::shared_ptr< RecordT > addNew()
Create a new record, add it to the end of the catalog, and return a pointer to it.
Definition Catalog.h:489
void reserve(size_type n)
Increase the capacity of the catalog to the given size.
Definition Catalog.h:432
static PointKey addFields(Schema &schema, std::string const &name, std::string const &doc, std::string const &unit)
Add a pair of _x, _y fields to a Schema, and return a PointKey that points to them.
Definition aggregates.cc:36
A vector of catalogs used by Persistable.
A multi-catalog archive object used to load table::io::Persistable objects.
std::shared_ptr< Persistable > get(int id) const
Load the Persistable with the given ID and return it.
An object passed to Persistable::write to allow it to persist itself.
void saveCatalog(BaseCatalog const &catalog)
Save a catalog in the archive.
BaseCatalog makeCatalog(Schema const &schema)
Return a new, empty catalog with the given schema.
int put(Persistable const *obj, bool permissive=false)
Save an object to the archive and return a unique ID that can be used to retrieve it from an InputArc...
A base class for factory classes used to reconstruct objects from records.
A class representing an angle.
Definition Angle.h:128
A floating-point coordinate rectangle geometry.
Definition Box.h:413
Point2D const getCenter() const noexcept
Return true if the box contains no points.
Definition Box.h:549
std::vector< Point2D > getCorners() const
Get the corner points.
Definition Box.cc:496
Reports invalid arguments.
Definition Runtime.h:66
Reports attempts to access elements using an invalid key.
Definition Runtime.h:151
Reports errors from accepting an object of an unexpected or inappropriate type.
Definition Runtime.h:167
T find_if(T... args)
T insert(T... args)
T move(T... args)
DetectorType
Type of imaging detector.
Definition Detector.h:44
Point3Key< double > Point3DKey
Definition aggregates.h:200
BoxKey< lsst::geom::Box2I > Box2IKey
Definition aggregates.h:283
PointKey< double > Point2DKey
Definition aggregates.h:120
Extent< double, 2 > Extent2D
Definition Extent.h:400
Point< double, 3 > Point3D
Definition Point.h:325
STL namespace.
T reserve(T... args)
Representation of a single edge in the graph defined by a TransformMap.
T to_string(T... args)