LSSTApplications  19.0.0-14-gb0260a2+72efe9b372,20.0.0+7927753e06,20.0.0+8829bf0056,20.0.0+995114c5d2,20.0.0+b6f4b2abd1,20.0.0+bddc4f4cbe,20.0.0-1-g253301a+8829bf0056,20.0.0-1-g2b7511a+0d71a2d77f,20.0.0-1-g5b95a8c+7461dd0434,20.0.0-12-g321c96ea+23efe4bbff,20.0.0-16-gfab17e72e+fdf35455f6,20.0.0-2-g0070d88+ba3ffc8f0b,20.0.0-2-g4dae9ad+ee58a624b3,20.0.0-2-g61b8584+5d3db074ba,20.0.0-2-gb780d76+d529cf1a41,20.0.0-2-ged6426c+226a441f5f,20.0.0-2-gf072044+8829bf0056,20.0.0-2-gf1f7952+ee58a624b3,20.0.0-20-geae50cf+e37fec0aee,20.0.0-25-g3dcad98+544a109665,20.0.0-25-g5eafb0f+ee58a624b3,20.0.0-27-g64178ef+f1f297b00a,20.0.0-3-g4cc78c6+e0676b0dc8,20.0.0-3-g8f21e14+4fd2c12c9a,20.0.0-3-gbd60e8c+187b78b4b8,20.0.0-3-gbecbe05+48431fa087,20.0.0-38-ge4adf513+a12e1f8e37,20.0.0-4-g97dc21a+544a109665,20.0.0-4-gb4befbc+087873070b,20.0.0-4-gf910f65+5d3db074ba,20.0.0-5-gdfe0fee+199202a608,20.0.0-5-gfbfe500+d529cf1a41,20.0.0-6-g64f541c+d529cf1a41,20.0.0-6-g9a5b7a1+a1cd37312e,20.0.0-68-ga3f3dda+5fca18c6a4,20.0.0-9-g4aef684+e18322736b,w.2020.45
LSSTDataManagementBasePackage
Detector.cc
Go to the documentation of this file.
1 /*
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 
33 namespace lsst {
34 namespace afw {
35 namespace cameraGeom {
36 
37 namespace {
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.
44 template <typename Iter>
45 Iter 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 
82 bool Detector::hasTransform(CameraSys const &cameraSys) const { return _transformMap->contains(cameraSys); }
83 
84 bool Detector::hasTransform(CameraSysPrefix const &cameraSysPrefix) const {
85  return hasTransform(makeCameraSys(cameraSysPrefix));
86 }
87 
88 template <typename FromSysT, typename ToSysT>
90  ToSysT const &toSys) const {
91  return _transformMap->getTransform(makeCameraSys(fromSys), makeCameraSys(toSys));
92 }
93 
94 template <typename FromSysT, typename ToSysT>
95 lsst::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 
100 template <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 
110 namespace {
111 
112 void 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 
122 void 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 
140 Detector::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 
150 namespace {
151 
152 class PersistenceHelper {
153 public:
154 
155  static PersistenceHelper const & get() {
156  static PersistenceHelper const instance;
157  return instance;
158  }
159 
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;
169  table::Key<lsst::geom::Angle> yaw;
170  table::Key<lsst::geom::Angle> pitch;
171  table::Key<lsst::geom::Angle> roll;
172  table::Key<int> transformMap;
173  table::Key<table::Array<float>> crosstalk;
174  table::Key<std::string> physicalType;
175 
176  PersistenceHelper(table::Schema const & existing) :
177  schema(existing),
178  name(schema["name"]),
179  id(schema["id"]),
180  type(schema["type"]),
181  serial(schema["serial"]),
182  bbox(schema["bbox"]),
183  pixelSize(schema["pixelSize"]),
184  fpPosition(schema["fpPosition"]),
185  refPoint(schema["refPoint"]),
186  yaw(schema["yaw"]),
187  pitch(schema["pitch"]),
188  roll(schema["roll"]),
189  transformMap(schema["transformMap"]),
190  crosstalk(schema["crosstalk"])
191  {
192  auto setKeyIfPresent = [this](auto & key, std::string const & name) {
193  try {
194  key = schema[name];
195  } catch (pex::exceptions::NotFoundError &) {}
196  };
197  // This field was not part of the original Detector minimal
198  // schema, but needed to be added
199  setKeyIfPresent(physicalType, "physicalType");
200  }
201 
202 private:
203 
204  PersistenceHelper() :
205  schema(),
206  name(schema.addField<std::string>("name", "Name of the detector", "", 0)),
207  id(schema.addField<int>("id", "Integer ID for the detector", "")),
208  type(schema.addField<int>("type", "Raw DetectorType enum value", "")),
209  serial(schema.addField<std::string>("serial", "Serial name of the detector", "", 0)),
210  bbox(table::Box2IKey::addFields(schema, "bbox", "Detector bounding box", "pixel")),
211  pixelSize(table::Point2DKey::addFields(schema, "pixelSize", "Physical pixel size", "mm")),
212  fpPosition(table::Point2DKey::addFields(schema, "fpPosition",
213  "Focal plane position of reference point", "mm")),
214  refPoint(table::Point2DKey::addFields(schema, "refPoint",
215  "Pixel position of reference point", "pixel")),
216  yaw(schema.addField<lsst::geom::Angle>("yaw", "Rotation about Z (X to Y), 1st rotation")),
217  pitch(schema.addField<lsst::geom::Angle>("pitch", "Rotation about Y' (Z'=Z to X'), 2nd rotation")),
218  roll(schema.addField<lsst::geom::Angle>("roll", "Rotation about X'' (Y''=Y' to Z''), 3rd rotation")),
219  transformMap(schema.addField<int>("transformMap", "Archive ID of TransformMap", "")),
220  crosstalk(schema.addField<table::Array<float>>("crosstalk", "Crosstalk matrix, flattened", "", 0)),
221  physicalType(schema.addField<std::string>("physicalType", "Physical type of the detector", "", 0))
222  {}
223 
224  PersistenceHelper(PersistenceHelper const &) = delete;
225  PersistenceHelper(PersistenceHelper &&) = delete;
226 
227  PersistenceHelper & operator=(PersistenceHelper const &) = delete;
228  PersistenceHelper & operator=(PersistenceHelper &&) = delete;
229 
230 };
231 
232 } // anonymous
233 
235 public:
236 
237  Factory() : PersistableFactory("Detector") {}
238 
240  CatalogVector const& catalogs) const override {
241  // N.b. can't use "auto const keys" as cctor is deleted
242  auto const & keys = PersistenceHelper(catalogs.front().getSchema());
243 
244  LSST_ARCHIVE_ASSERT(catalogs.size() == 2u);
245  LSST_ARCHIVE_ASSERT(catalogs.front().getSchema() == keys.schema);
246  LSST_ARCHIVE_ASSERT(catalogs.front().size() == 1u);
247  auto const & record = catalogs.front().front();
248 
249  AmpVector amps;
250  amps.reserve(catalogs.back().size());
251  for (auto const & record : catalogs.back()) {
252  amps.push_back(Amplifier::Builder::fromRecord(record).finish());
253  }
254 
255  auto flattenedMatrix = record.get(keys.crosstalk);
256  ndarray::Array<float, 2, 2> crosstalk;
257  if (!flattenedMatrix.isEmpty()) {
258  crosstalk = ndarray::allocate(amps.size(), amps.size());
259  ndarray::flatten<1>(crosstalk) = flattenedMatrix;
260  }
261 
262  // get values for not-always-present fields if present
263  const auto physicalType = keys.physicalType.isValid() ? record.get(keys.physicalType) : "";
264  Fields fields = {
265  record.get(keys.name),
266  record.get(keys.id),
267  static_cast<DetectorType>(record.get(keys.type)),
268  record.get(keys.serial),
269  record.get(keys.bbox),
270  Orientation(
271  record.get(keys.fpPosition),
272  record.get(keys.refPoint),
273  record.get(keys.yaw),
274  record.get(keys.pitch),
275  record.get(keys.roll)
276  ),
277  lsst::geom::Extent2D(record.get(keys.pixelSize)),
278  crosstalk,
280  };
281 
283  new Detector(
284  std::move(fields),
285  archive.get<TransformMap>(record.get(keys.transformMap)),
286  std::move(amps)
287  )
288  );
289  }
290 
291  static Factory const registration;
292 
293 };
294 
296 
297 std::string Detector::getPersistenceName() const {
298  return "Detector";
299 }
300 
301 std::string Detector::getPythonModule() const {
302  return "lsst.afw.cameraGeom";
303 }
304 
305 void Detector::write(OutputArchiveHandle& handle) const {
306  auto const & keys = PersistenceHelper::get();
307 
308  auto cat = handle.makeCatalog(keys.schema);
309  auto record = cat.addNew();
310  record->set(keys.name, getName());
311  record->set(keys.id, getId());
312  record->set(keys.type, static_cast<int>(getType()));
313  record->set(keys.serial, getSerial());
314  record->set(keys.bbox, getBBox());
315  record->set(keys.pixelSize, lsst::geom::Point2D(getPixelSize()));
316  auto orientation = getOrientation();
317  record->set(keys.fpPosition, orientation.getFpPosition());
318  record->set(keys.refPoint, orientation.getReferencePoint());
319  record->set(keys.yaw, orientation.getYaw());
320  record->set(keys.pitch, orientation.getPitch());
321  record->set(keys.roll, orientation.getRoll());
322  record->set(keys.transformMap, handle.put(getTransformMap()));
323 
324  auto flattenMatrix = [](ndarray::Array<float const, 2> const & matrix) {
325  // copy because the original isn't guaranteed to have
326  // row-major contiguous elements
327  ndarray::Array<float, 2, 2> copied = ndarray::copy(matrix);
328  // make a view to the copy
329  ndarray::Array<float, 1, 1> flattened = ndarray::flatten<1>(copied);
330  return flattened;
331  };
332 
333  record->set(keys.crosstalk, flattenMatrix(getCrosstalk()));
334  record->set(keys.physicalType, getPhysicalType());
335  handle.saveCatalog(cat);
336 
337  auto ampCat = handle.makeCatalog(Amplifier::getRecordSchema());
338  ampCat.reserve(getAmplifiers().size());
339  for (auto const & amp : getAmplifiers()) {
340  auto record = ampCat.addNew();
341  amp->toRecord(*record);
342  }
343  handle.saveCatalog(ampCat);
344 }
345 
346 
348  return *findAmpIterByName(_amplifiers.begin(), _amplifiers.end(), name);
349 }
350 
352  _amplifiers.push_back(std::move(builder));
353 }
354 
356  Detector const & detector
357 ) {
359  result.reserve(detector.size());
360  for (auto const & ampPtr : detector) {
361  result.push_back(std::make_shared<Amplifier::Builder>(*ampPtr));
362  }
363  return result;
364 }
365 
367  _fields.name = name;
368  _fields.id = id;
369 }
370 
371 Detector::Builder::~Builder() noexcept = default;
372 
373 AmpVector Detector::Builder::finishAmplifiers() const {
374  AmpVector result;
375  result.reserve(_amplifiers.size());
376  for (auto const & ampBuilderPtr : _amplifiers) {
377  result.push_back(ampBuilderPtr->finish());
378  }
379  return result;
380 }
381 
382 
384  Builder(detector._fields, rebuildAmplifiers(detector)),
385  _transformMap(detector.getTransformMap())
386 {}
387 
389  return std::shared_ptr<Detector>(new Detector(getFields(), _transformMap, finishAmplifiers()));
390 }
391 
392 
393 namespace {
394 
395 // Return the first connection in the given range that has toSys as its "to"
396 // endpoint.
397 //
398 // @tparam Iter Iterator that dereferences to `Connection const &`.
399 //
400 template <typename Iter>
401 Iter findConnection(Iter first, Iter last, CameraSys const & toSys) {
402  return std::find_if(
403  first, last,
404  [&toSys](auto const & connection) {
405  return connection.toSys == toSys;
406  }
407  );
408 }
409 
410 } // anonymous
411 
412 
414  CameraSysPrefix const & toSys,
416 ) {
417  return setTransformFromPixelsTo(makeCameraSys(toSys), std::move(transform));
418 }
419 
421  CameraSys const & toSys,
423 ) {
424  if (toSys.getDetectorName() != getName()) {
425  throw LSST_EXCEPT(
427  (boost::format("Cannot add coordinate system for detector '%s' to detector '%s'.") %
428  toSys.getDetectorName() % getName()).str()
429  );
430  }
431  auto iter = findConnection(_connections.begin(), _connections.end(), toSys);
432  if (iter == _connections.end()) {
433  _connections.push_back(
435  );
436  } else {
437  iter->transform = transform;
438  }
439 }
440 
442  return discardTransformFromPixelsTo(makeCameraSys(toSys));
443 }
444 
446  if (toSys.getDetectorName() != getName()) {
447  throw LSST_EXCEPT(
449  (boost::format("Cannot add coordinate system for detector '%s' to detector '%s'.") %
450  toSys.getDetectorName() % getName()).str()
451  );
452  }
453  auto iter = findConnection(_connections.begin(), _connections.end(), toSys);
454  if (iter != _connections.end()) {
455  _connections.erase(iter);
456  return true;
457  }
458  return false;
459 }
460 
461 
462 Detector::InCameraBuilder::InCameraBuilder(Detector const & detector) :
463  Builder(detector.getFields(), rebuildAmplifiers(detector))
464 {}
465 
466 Detector::InCameraBuilder::InCameraBuilder(std::string const & name, int id) :
467  Builder(name, id)
468 {}
469 
470 
471 std::shared_ptr<Detector const> Detector::InCameraBuilder::finish(
473 ) const {
474  auto amplifiers = finishAmplifiers();
476  new Detector(getFields(), std::move(transformMap), std::move(amplifiers))
477  );
478 }
479 
480 
481 //
482 // Explicit instantiations
483 //
484 #define INSTANTIATE(FROMSYS, TOSYS) \
485  template std::shared_ptr<geom::TransformPoint2ToPoint2> Detector::getTransform(FROMSYS const &, \
486  TOSYS const &) const; \
487  template lsst::geom::Point2D Detector::transform(lsst::geom::Point2D const &, FROMSYS const &, \
488  TOSYS const &) const; \
489  template std::vector<lsst::geom::Point2D> Detector::transform(std::vector<lsst::geom::Point2D> const &, \
490  FROMSYS const &, TOSYS const &) const;
491 
492 INSTANTIATE(CameraSys, CameraSys);
493 INSTANTIATE(CameraSys, CameraSysPrefix);
494 INSTANTIATE(CameraSysPrefix, CameraSys);
495 INSTANTIATE(CameraSysPrefix, CameraSysPrefix);
496 
497 } // namespace cameraGeom
498 
499 namespace table {
500 namespace io {
501 
502 template class PersistableFacade<cameraGeom::Detector>;
503 
504 } // namespace io
505 } // namespace table
506 
507 
508 } // namespace afw
509 } // namespace lsst
lsst::afw::cameraGeom::DetectorBase::getType
DetectorType getType() const
Return the purpose of this detector.
Definition: Detector.h:70
crosstalk
table::Key< table::Array< float > > crosstalk
Definition: Detector.cc:173
lsst::afw::cameraGeom::DetectorBase::getSerial
std::string getSerial() const
Get the detector serial "number".
Definition: Detector.h:73
fpPosition
table::Point2DKey fpPosition
Definition: Detector.cc:167
std::string
STL class.
std::shared_ptr
STL class.
lsst::afw::cameraGeom::Detector::Factory::read
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:239
std::move
T move(T... args)
lsst::afw::cameraGeom::Detector::Factory
Definition: Detector.cc:234
std::unordered_set
STL class.
lsst::afw::cameraGeom::Detector::getCenter
lsst::geom::Point2D getCenter(CameraSys const &cameraSys) const
Get the center of the detector in the specified camera coordinate system.
Definition: Detector.cc:72
lsst::afw::cameraGeom::DetectorBase::getPhysicalType
std::string getPhysicalType() const
Get the detector's physical type.
Definition: Detector.h:82
lsst::sphgeom::orientation
int orientation(UnitVector3d const &a, UnitVector3d const &b, UnitVector3d const &c)
orientation computes and returns the orientations of 3 unit vectors a, b and c.
Definition: orientation.cc:135
lsst::afw::cameraGeom::Detector::Builder::append
void append(std::shared_ptr< Amplifier::Builder > builder)
Append a new amplifier.
Definition: Detector.cc:351
std::vector
STL class.
std::find_if
T find_if(T... args)
std::vector::size
T size(T... args)
lsst::afw::cameraGeom::DetectorBase::getNativeCoordSys
CameraSys getNativeCoordSys() const
The "native" coordinate system of this detector.
Definition: Detector.h:123
lsst::afw::table._match.first
first
Definition: _match.py:74
yaw
table::Key< lsst::geom::Angle > yaw
Definition: Detector.cc:169
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
lsst::afw::cameraGeom::Detector::getTransformMap
std::shared_ptr< TransformMap const > getTransformMap() const
Get the transform registry.
Definition: Detector.h:267
schema
table::Schema schema
Definition: Detector.cc:160
astshim.keyMap.keyMapContinued.keys
def keys(self)
Definition: keyMapContinued.py:6
CatalogVector.h
lsst::afw::cameraGeom::Detector::hasTransform
bool hasTransform(CameraSys const &cameraSys) const
Can this object convert between PIXELS and the specified camera coordinate system?
Definition: Detector.cc:82
std::vector::back
T back(T... args)
lsst.pex.config.history.format
def format(config, name=None, writeSourceLine=True, prefix="", verbose=False)
Definition: history.py:174
INSTANTIATE
#define INSTANTIATE(FROMSYS, TOSYS)
Definition: Detector.cc:484
aggregates.h
lsst::afw::cameraGeom::Detector::InCameraBuilder::setTransformFromPixelsTo
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:413
lsst::afw::table::Point2DKey
PointKey< double > Point2DKey
Definition: aggregates.h:118
std::vector::front
T front(T... args)
roll
table::Key< lsst::geom::Angle > roll
Definition: Detector.cc:171
lsst::afw::cameraGeom::DetectorBase::CrosstalkMatrix
ndarray::Array< float const, 2 > CrosstalkMatrix
Definition: Detector.h:59
transformMap
table::Key< int > transformMap
Definition: Detector.cc:172
lsst::afw::table::io::PersistableFactory::PersistableFactory
PersistableFactory(std::string const &name)
Constructor for the factory.
Definition: Persistable.cc:74
lsst::geom::Box2D::getCorners
std::vector< Point2D > getCorners() const
Get the corner points.
Definition: Box.cc:496
lsst::afw::cameraGeom::DetectorType
DetectorType
Type of imaging detector.
Definition: Detector.h:44
lsst::afw::cameraGeom::Detector::rebuild
std::shared_ptr< PartialRebuilder > rebuild() const
Return a Builder object initialized with the state of this Detector.
Definition: Detector.cc:58
lsst::afw::cameraGeom::DetectorBase::getBBox
lsst::geom::Box2I getBBox() const
Get the bounding box.
Definition: Detector.h:85
lsst::afw::cameraGeom::Detector::Builder::rebuildAmplifiers
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:355
lsst::afw::cameraGeom::Detector::InCameraBuilder::discardTransformFromPixelsTo
bool discardTransformFromPixelsTo(CameraSysPrefix const &toSys)
Remove any transformation from PIXELS to the given coordinate system.
Definition: Detector.cc:441
lsst::afw::table::Angle
lsst::geom::Angle Angle
Definition: misc.h:33
lsst::afw::table::Box2IKey
BoxKey< lsst::geom::Box2I > Box2IKey
Definition: aggregates.h:201
lsst::afw::cameraGeom::DetectorBase::getPixelSize
lsst::geom::Extent2D getPixelSize() const
Get size of pixel along (mm)
Definition: Detector.h:91
id
table::Key< int > id
Definition: Detector.cc:162
lsst::afw::cameraGeom::Detector::Factory::Factory
Factory()
Definition: Detector.cc:237
lsst::afw::cameraGeom::Detector::getFields
Fields const & getFields() const override
Return a reference to a Fields struct.
Definition: Detector.h:306
physicalType
table::Key< std::string > physicalType
Definition: Detector.cc:174
lsst::afw::cameraGeom::DetectorBase::hasCrosstalk
bool hasCrosstalk() const
Have we got crosstalk coefficients?
Definition: Detector.h:94
lsst::afw::cameraGeom::Detector::Factory::registration
static Factory const registration
Definition: Detector.cc:291
lsst::afw::table::io::CatalogVector
A vector of catalogs used by Persistable.
Definition: CatalogVector.h:29
lsst::afw::cameraGeom::DetectorBase::getOrientation
Orientation getOrientation() const
Get detector's orientation in the focal plane.
Definition: Detector.h:88
lsst::afw::table::io::PersistableFactory
A base class for factory classes used to reconstruct objects from records.
Definition: Persistable.h:228
serial
table::Key< std::string > serial
Definition: Detector.cc:164
ptr
uint64_t * ptr
Definition: RangeSet.cc:88
result
py::object result
Definition: _schema.cc:429
lsst::afw::cameraGeom::Detector::operator[]
std::shared_ptr< Amplifier const > operator[](size_t i) const
Get the amplifier specified by index.
Definition: Detector.h:287
refPoint
table::Point2DKey refPoint
Definition: Detector.cc:168
lsst
A base class for image defects.
Definition: imageAlgorithm.dox:1
LSST_EXCEPT
#define LSST_EXCEPT(type,...)
Create an exception with a given type.
Definition: Exception.h:48
lsst::afw::cameraGeom::Orientation
Describe a detector's orientation in the focal plane.
Definition: Orientation.h:52
lsst::afw::cameraGeom::Detector::Builder::Builder
Builder(Builder const &)=delete
name
table::Key< std::string > name
Definition: Detector.cc:161
std::ostringstream
STL class.
lsst::geom
Definition: AffineTransform.h:36
os
std::ostream * os
Definition: Schema.cc:746
lsst::afw::cameraGeom::DetectorBase::Fields::id
int id
Definition: Detector.h:133
lsst.pex::exceptions::InvalidParameterError
Reports invalid arguments.
Definition: Runtime.h:66
lsst::afw::cameraGeom::Detector::getCorners
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::afw::cameraGeom::Amplifier::getRecordSchema
static table::Schema getRecordSchema()
Return the schema used in the afw.table representation of amplifiers.
Definition: Amplifier.cc:267
std
STL namespace.
LSST_ARCHIVE_ASSERT
#define LSST_ARCHIVE_ASSERT(EXPR)
An assertion macro used to validate the structure of an InputArchive.
Definition: Persistable.h:48
type
table::Key< int > type
Definition: Detector.cc:163
lsst::afw::cameraGeom::CameraSys::getDetectorName
std::string getDetectorName() const
Get detector name, or "" if not a detector-specific coordinate system.
Definition: CameraSys.h:120
std::unordered_set::insert
T insert(T... args)
lsst::afw::cameraGeom::DetectorBase::getName
std::string getName() const
Get the detector name.
Definition: Detector.h:64
detector
table::Key< int > detector
Definition: DetectorCollection.cc:172
key
Key< U > key
Definition: Schema.cc:281
lsst::geom::Point< double, 2 >
lsst::afw::cameraGeom::DetectorBase::Fields
Definition: Detector.h:131
lsst::afw::cameraGeom::Detector::Builder::~Builder
~Builder() noexcept override=0
Persistable.cc
lsst::geom::Extent2D
Extent< double, 2 > Extent2D
Definition: Extent.h:400
lsst::afw::cameraGeom::Detector::PartialRebuilder::PartialRebuilder
PartialRebuilder(Detector const &detector)
Construct a PartialRebuilder initialized to the state of the given Detector.
Definition: Detector.cc:383
lsst::afw::cameraGeom::Detector::getTransform
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,...
lsst::afw::cameraGeom::DetectorBase::getCrosstalk
CrosstalkMatrix getCrosstalk() const
Get the crosstalk coefficients.
Definition: Detector.h:100
lsst::afw::cameraGeom::DetectorBase::Fields::name
std::string name
Definition: Detector.h:132
InputArchive.h
std::size_t
lsst::afw::cameraGeom::Detector::size
std::size_t size() const
Get the number of amplifiers.
Definition: Detector.h:299
lsst::geom::Box2D::getCenter
Point2D const getCenter() const noexcept
Return true if the box contains no points.
Definition: Box.h:549
lsst::afw::cameraGeom::Detector::getAmplifiers
std::vector< std::shared_ptr< Amplifier const > > const & getAmplifiers() const
Return the sequence of Amplifiers directly.
Definition: Detector.h:270
lsst::afw::cameraGeom::DetectorBase::makeCameraSys
CameraSys makeCameraSys(CameraSys const &cameraSys) const
Get a coordinate system from a coordinate system (return input unchanged and untested)
Definition: Detector.h:110
lsst::afw::cameraGeom::Detector::Builder
A helper class for Detector that allows amplifiers and most fields to be modified.
Definition: Detector.h:362
lsst::afw::cameraGeom::Detector::Builder::operator[]
std::shared_ptr< Amplifier::Builder > operator[](size_t i) const
Get the amplifier builder specified by index.
Definition: Detector.h:435
lsst::geom::Box2D
A floating-point coordinate rectangle geometry.
Definition: Box.h:413
lsst::afw::cameraGeom::Detector::PartialRebuilder::finish
std::shared_ptr< Detector const > finish() const
Construct a new Detector from the current state of the Builder.
Definition: Detector.cc:388
pitch
table::Key< lsst::geom::Angle > pitch
Definition: Detector.cc:170
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
lsst::afw::cameraGeom::CameraSysPrefix
Camera coordinate system prefix.
Definition: CameraSys.h:44
lsst::afw::cameraGeom::PIXELS
CameraSysPrefix const PIXELS
Pixel coordinates: Nominal position on the entry surface of a given detector (x, y unbinned pixels).
Definition: CameraSys.cc:34
astshim.fitsChanContinued.iter
def iter(self)
Definition: fitsChanContinued.py:88
bbox
table::Box2IKey bbox
Definition: Detector.cc:165
lsst::afw::cameraGeom::Detector::transform
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
pixelSize
table::Point2DKey pixelSize
Definition: Detector.cc:166
lsst::afw::cameraGeom::DetectorBase::getId
int getId() const
Get the detector ID.
Definition: Detector.h:67
Detector.h
OutputArchive.h
lsst::afw::cameraGeom::Detector
A representation of a detector in a mosaic camera.
Definition: Detector.h:185
lsst::afw::cameraGeom::Amplifier::Builder::fromRecord
static Builder fromRecord(table::BaseRecord const &record)
Construct a new Builder object from the fields in the given record.
Definition: Amplifier.cc:286
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