LSST Applications  21.0.0-172-gfb10e10a+18fedfabac,22.0.0+297cba6710,22.0.0+80564b0ff1,22.0.0+8d77f4f51a,22.0.0+a28f4c53b1,22.0.0+dcf3732eb2,22.0.1-1-g7d6de66+2a20fdde0d,22.0.1-1-g8e32f31+297cba6710,22.0.1-1-geca5380+7fa3b7d9b6,22.0.1-12-g44dc1dc+2a20fdde0d,22.0.1-15-g6a90155+515f58c32b,22.0.1-16-g9282f48+790f5f2caa,22.0.1-2-g92698f7+dcf3732eb2,22.0.1-2-ga9b0f51+7fa3b7d9b6,22.0.1-2-gd1925c9+bf4f0e694f,22.0.1-24-g1ad7a390+a9625a72a8,22.0.1-25-g5bf6245+3ad8ecd50b,22.0.1-25-gb120d7b+8b5510f75f,22.0.1-27-g97737f7+2a20fdde0d,22.0.1-32-gf62ce7b1+aa4237961e,22.0.1-4-g0b3f228+2a20fdde0d,22.0.1-4-g243d05b+871c1b8305,22.0.1-4-g3a563be+32dcf1063f,22.0.1-4-g44f2e3d+9e4ab0f4fa,22.0.1-42-gca6935d93+ba5e5ca3eb,22.0.1-5-g15c806e+85460ae5f3,22.0.1-5-g58711c4+611d128589,22.0.1-5-g75bb458+99c117b92f,22.0.1-6-g1c63a23+7fa3b7d9b6,22.0.1-6-g50866e6+84ff5a128b,22.0.1-6-g8d3140d+720564cf76,22.0.1-6-gd805d02+cc5644f571,22.0.1-8-ge5750ce+85460ae5f3,master-g6e05de7fdc+babf819c66,master-g99da0e417a+8d77f4f51a,w.2021.48
LSST Data Management Base Package
Public Types | Public Member Functions | Protected Member Functions | Static Protected Member Functions | Friends | List of all members
lsst::afw::cameraGeom::Detector::InCameraBuilder Class Referencefinal

A helper class that allows the properties of a detector to be modified in the course of modifying a full camera. More...

#include <Detector.h>

Inheritance diagram for lsst::afw::cameraGeom::Detector::InCameraBuilder:
lsst::afw::cameraGeom::Detector::Builder lsst::afw::cameraGeom::DetectorBase

Public Types

using CrosstalkMatrix = ndarray::Array< float const, 2 >
 

Public Member Functions

void setOrientation (Orientation const &orientation)
 Set the orientation of the detector in the focal plane. More...
 
void setPixelSize (lsst::geom::Extent2D const &pixelSize)
 Set the pixel size (in mm). More...
 
void setTransformFromPixelsTo (CameraSysPrefix const &toSys, std::shared_ptr< afw::geom::TransformPoint2ToPoint2 const > transform)
 Set the transformation from PIXELS to the given coordinate system. More...
 
void setTransformFromPixelsTo (CameraSys const &toSys, std::shared_ptr< afw::geom::TransformPoint2ToPoint2 const > transform)
 Set the transformation from PIXELS to the given coordinate system. More...
 
bool discardTransformFromPixelsTo (CameraSysPrefix const &toSys)
 Remove any transformation from PIXELS to the given coordinate system. More...
 
bool discardTransformFromPixelsTo (CameraSys const &toSys)
 Remove any transformation from PIXELS to the given coordinate system. More...
 
void clearTransforms ()
 Remove all coordinate transforms. More...
 
void setBBox (lsst::geom::Box2I const &bbox)
 Set the bounding box. More...
 
void setType (DetectorType type)
 Set the purpose of this detector. More...
 
void setSerial (std::string const &serial)
 Set the detector serial "number". More...
 
void setPhysicalType (std::string const &physicalType)
 Set the detector's physical type. More...
 
void setCrosstalk (CrosstalkMatrix const &crosstalk)
 Set the crosstalk coefficients. More...
 
void unsetCrosstalk ()
 Remove the crosstalk coefficient matrix. More...
 
std::vector< std::shared_ptr< Amplifier::Builder > > const & getAmplifiers () const
 Return the sequence of Amplifier::Builders directly. More...
 
auto begin ()
 An iterator range over amplifers. More...
 
auto end ()
 
std::shared_ptr< Amplifier::Builderoperator[] (size_t i) const
 Get the amplifier builder specified by index. More...
 
std::shared_ptr< Amplifier::Builderoperator[] (std::string const &name) const
 Get a builder for the amplifier specified by name. More...
 
void append (std::shared_ptr< Amplifier::Builder > builder)
 Append a new amplifier. More...
 
void clear ()
 Remove all amplifiers. More...
 
std::size_t size () const
 Return the number of amplifiers (renamed to len in Python). More...
 
std::string getName () const
 Get the detector name. More...
 
int getId () const
 Get the detector ID. More...
 
DetectorType getType () const
 Return the purpose of this detector. More...
 
std::string getSerial () const
 Get the detector serial "number". More...
 
std::string getPhysicalType () const
 Get the detector's physical type. More...
 
lsst::geom::Box2I getBBox () const
 Get the bounding box. More...
 
Orientation getOrientation () const
 Get detector's orientation in the focal plane. More...
 
lsst::geom::Extent2D getPixelSize () const
 Get size of pixel along (mm) More...
 
bool hasCrosstalk () const
 Have we got crosstalk coefficients? More...
 
CrosstalkMatrix getCrosstalk () const
 Get the crosstalk coefficients. More...
 
CameraSys makeCameraSys (CameraSys const &cameraSys) const
 Get a coordinate system from a coordinate system (return input unchanged and untested) More...
 
CameraSys makeCameraSys (CameraSysPrefix const &cameraSysPrefix) const
 Get a coordinate system from a detector system prefix (add detector name) More...
 
CameraSys getNativeCoordSys () const
 The "native" coordinate system of this detector. More...
 

Protected Member Functions

Fields const & getFields () const override
 Return a reference to a Fields struct. More...
 
std::vector< std::shared_ptr< Amplifier const > > finishAmplifiers () const
 Create a vector of Amplifiers from the Amplifier::Builder sequence. More...
 

Static Protected Member Functions

static std::vector< std::shared_ptr< Amplifier::Builder > > rebuildAmplifiers (Detector const &detector)
 Create a vector of Amplifier::Builders from the Amplifiers in a Detector. More...
 

Friends

class Camera
 

Detailed Description

A helper class that allows the properties of a detector to be modified in the course of modifying a full camera.

Detector::InCameraBuilder can only be constructed via Camera::Builder, and all Detector::InCameraBuilder instances should always be owned by or shared with a Camera::Builder.

Unlike Detector::PartialRebuilder, InCameraBuilder can be used to set the orientation, pixel size, and more general coordinate systems associated with the detector.

The transformation from FOCAL_PLANE to PIXELS that relates this detector's coordinate systems to those of the full camera and other detectors is created from the orientation and pixel size fields, and need not (and cannot) be set explicitly.

Definition at line 555 of file Detector.h.

Member Typedef Documentation

◆ CrosstalkMatrix

using lsst::afw::cameraGeom::DetectorBase::CrosstalkMatrix = ndarray::Array<float const, 2>
inherited

Definition at line 59 of file Detector.h.

Member Function Documentation

◆ append()

void lsst::afw::cameraGeom::Detector::Builder::append ( std::shared_ptr< Amplifier::Builder builder)
inherited

Append a new amplifier.

Definition at line 351 of file Detector.cc.

351  {
352  _amplifiers.push_back(std::move(builder));
353 }
T move(T... args)

◆ begin()

auto lsst::afw::cameraGeom::Detector::Builder::begin ( )
inlineinherited

An iterator range over amplifers.

Iterators dereference to shared_ptr<Amplifier::Builder>.

Definition at line 426 of file Detector.h.

426 { return _amplifiers.begin(); }

◆ clear()

void lsst::afw::cameraGeom::Detector::Builder::clear ( )
inlineinherited

Remove all amplifiers.

Definition at line 448 of file Detector.h.

448 { _amplifiers.clear(); }

◆ clearTransforms()

void lsst::afw::cameraGeom::Detector::InCameraBuilder::clearTransforms ( )
inline

Remove all coordinate transforms.

Definition at line 623 of file Detector.h.

623 { _connections.clear(); }

◆ discardTransformFromPixelsTo() [1/2]

bool lsst::afw::cameraGeom::Detector::InCameraBuilder::discardTransformFromPixelsTo ( CameraSys const &  toSys)

Remove any transformation from PIXELS to the given coordinate system.

Parameters
toSysCoordinate system prefix this transform returns points in. Must be associated with this detector.
Returns
true if a transform was removed; false otherwise.
Exceptions
pex::exceptions::InvalidParameterErrorif toSys.getDetectorName() != this->getName().

Definition at line 445 of file Detector.cc.

445  {
446  if (toSys.getDetectorName() != getName()) {
447  throw LSST_EXCEPT(
448  pex::exceptions::InvalidParameterError,
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 }
#define LSST_EXCEPT(type,...)
Create an exception with a given type.
Definition: Exception.h:48
std::string getName() const
Get the detector name.
Definition: Detector.h:64
def format(config, name=None, writeSourceLine=True, prefix="", verbose=False)
Definition: history.py:174

◆ discardTransformFromPixelsTo() [2/2]

bool lsst::afw::cameraGeom::Detector::InCameraBuilder::discardTransformFromPixelsTo ( CameraSysPrefix const &  toSys)

Remove any transformation from PIXELS to the given coordinate system.

Parameters
toSysCoordinate system prefix this transform returns points in.
Returns
true if a transform was removed; false otherwise.

Definition at line 441 of file Detector.cc.

441  {
443 }
bool discardTransformFromPixelsTo(CameraSysPrefix const &toSys)
Remove any transformation from PIXELS to the given coordinate system.
Definition: Detector.cc:441
CameraSys makeCameraSys(CameraSys const &cameraSys) const
Get a coordinate system from a coordinate system (return input unchanged and untested)
Definition: Detector.h:110

◆ end()

auto lsst::afw::cameraGeom::Detector::Builder::end ( )
inlineinherited

Definition at line 427 of file Detector.h.

427 { return _amplifiers.end(); }

◆ finishAmplifiers()

AmpVector lsst::afw::cameraGeom::Detector::Builder::finishAmplifiers ( ) const
protectedinherited

Create a vector of Amplifiers from the Amplifier::Builder sequence.

Definition at line 373 of file Detector.cc.

373  {
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 }
py::object result
Definition: _schema.cc:429

◆ getAmplifiers()

std::vector<std::shared_ptr<Amplifier::Builder> > const& lsst::afw::cameraGeom::Detector::Builder::getAmplifiers ( ) const
inlineinherited

Return the sequence of Amplifier::Builders directly.

Definition at line 418 of file Detector.h.

418 { return _amplifiers; }

◆ getBBox()

lsst::geom::Box2I lsst::afw::cameraGeom::DetectorBase::getBBox ( ) const
inlineinherited

Get the bounding box.

Definition at line 85 of file Detector.h.

85 { return getFields().bbox; }
virtual Fields const & getFields() const =0
Return a reference to a Fields struct.

◆ getCrosstalk()

CrosstalkMatrix lsst::afw::cameraGeom::DetectorBase::getCrosstalk ( ) const
inlineinherited

Get the crosstalk coefficients.

Definition at line 100 of file Detector.h.

100 { return getFields().crosstalk; }

◆ getFields()

Fields const& lsst::afw::cameraGeom::Detector::Builder::getFields ( ) const
inlineoverrideprotectedvirtualinherited

Return a reference to a Fields struct.

Must be implemented by all subclasses.

Implements lsst::afw::cameraGeom::DetectorBase.

Definition at line 476 of file Detector.h.

476 { return _fields; }

◆ getId()

int lsst::afw::cameraGeom::DetectorBase::getId ( ) const
inlineinherited

Get the detector ID.

Definition at line 67 of file Detector.h.

◆ getName()

std::string lsst::afw::cameraGeom::DetectorBase::getName ( ) const
inlineinherited

Get the detector name.

Definition at line 64 of file Detector.h.

◆ getNativeCoordSys()

CameraSys lsst::afw::cameraGeom::DetectorBase::getNativeCoordSys ( ) const
inlineinherited

The "native" coordinate system of this detector.

Definition at line 123 of file Detector.h.

123 { return CameraSys(PIXELS, getName()); }
CameraSysPrefix const PIXELS
Pixel coordinates: Nominal position on the entry surface of a given detector (x, y unbinned pixels).
Definition: CameraSys.cc:34

◆ getOrientation()

Orientation lsst::afw::cameraGeom::DetectorBase::getOrientation ( ) const
inlineinherited

Get detector's orientation in the focal plane.

Definition at line 88 of file Detector.h.

◆ getPhysicalType()

std::string lsst::afw::cameraGeom::DetectorBase::getPhysicalType ( ) const
inlineinherited

Get the detector's physical type.

This may mean different things for different cameras; possibilities include the manufacturer ("ITL" vs "E2V") or fundamental technology ("CCD" vs "HgCdTe").

Definition at line 82 of file Detector.h.

◆ getPixelSize()

lsst::geom::Extent2D lsst::afw::cameraGeom::DetectorBase::getPixelSize ( ) const
inlineinherited

Get size of pixel along (mm)

Definition at line 91 of file Detector.h.

91 { return getFields().pixelSize; }

◆ getSerial()

std::string lsst::afw::cameraGeom::DetectorBase::getSerial ( ) const
inlineinherited

Get the detector serial "number".

Definition at line 73 of file Detector.h.

◆ getType()

DetectorType lsst::afw::cameraGeom::DetectorBase::getType ( ) const
inlineinherited

Return the purpose of this detector.

Definition at line 70 of file Detector.h.

70 { return getFields().type; }

◆ hasCrosstalk()

bool lsst::afw::cameraGeom::DetectorBase::hasCrosstalk ( ) const
inlineinherited

Have we got crosstalk coefficients?

Definition at line 94 of file Detector.h.

94  {
95  return !(getFields().crosstalk.isEmpty() ||
96  getFields().crosstalk.getShape() == ndarray::makeVector(0, 0));
97  }

◆ makeCameraSys() [1/2]

CameraSys lsst::afw::cameraGeom::DetectorBase::makeCameraSys ( CameraSys const &  cameraSys) const
inlineinherited

Get a coordinate system from a coordinate system (return input unchanged and untested)

Parameters
[in]cameraSysCamera coordinate system
Returns
cameraSys unchanged
Note
the CameraSysPrefix version needs the detector name, which is why this is not static.

Definition at line 110 of file Detector.h.

110 { return cameraSys; }

◆ makeCameraSys() [2/2]

CameraSys lsst::afw::cameraGeom::DetectorBase::makeCameraSys ( CameraSysPrefix const &  cameraSysPrefix) const
inlineinherited

Get a coordinate system from a detector system prefix (add detector name)

Parameters
[in]cameraSysPrefixCamera coordinate system prefix
Returns
cameraSysPrefix with the detector name added

Definition at line 118 of file Detector.h.

118  {
119  return CameraSys(cameraSysPrefix, getFields().name);
120  }
table::Key< std::string > name
Definition: Amplifier.cc:116

◆ operator[]() [1/2]

std::shared_ptr<Amplifier::Builder> lsst::afw::cameraGeom::Detector::Builder::operator[] ( size_t  i) const
inlineinherited

Get the amplifier builder specified by index.

Exceptions
std::out_of_rangeif index is out of range.

Definition at line 435 of file Detector.h.

435 { return _amplifiers.at(i); }

◆ operator[]() [2/2]

std::shared_ptr< Amplifier::Builder > lsst::afw::cameraGeom::Detector::Builder::operator[] ( std::string const &  name) const
inherited

Get a builder for the amplifier specified by name.

Exceptions
lsst::pex::exceptions::InvalidParameterErrorif no such amplifier.

Definition at line 347 of file Detector.cc.

347  {
348  return *findAmpIterByName(_amplifiers.begin(), _amplifiers.end(), name);
349 }
table::Key< std::string > name
Definition: Detector.cc:161

◆ rebuildAmplifiers()

std::vector< std::shared_ptr< Amplifier::Builder > > lsst::afw::cameraGeom::Detector::Builder::rebuildAmplifiers ( Detector const &  detector)
staticprotectedinherited

Create a vector of Amplifier::Builders from the Amplifiers in a Detector.

Definition at line 355 of file Detector.cc.

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 }
table::Key< int > detector

◆ setBBox()

void lsst::afw::cameraGeom::Detector::Builder::setBBox ( lsst::geom::Box2I const &  bbox)
inlineinherited

Set the bounding box.

Definition at line 375 of file Detector.h.

375 { _fields.bbox = bbox; }
AmpInfoBoxKey bbox
Definition: Amplifier.cc:117

◆ setCrosstalk()

void lsst::afw::cameraGeom::Detector::Builder::setCrosstalk ( CrosstalkMatrix const &  crosstalk)
inlineinherited

Set the crosstalk coefficients.

The shape of the crosstalk matrix must be consistent with the set of amplifiers, but is not checked until a Detector instance is actually constructed.

Setting with a zero-size matrix is equivalent to calling unsetCrosstalk().

Definition at line 400 of file Detector.h.

400 { _fields.crosstalk = crosstalk; }
table::Key< table::Array< float > > crosstalk
Definition: Detector.cc:173

◆ setOrientation()

void lsst::afw::cameraGeom::Detector::InCameraBuilder::setOrientation ( Orientation const &  orientation)
inline

Set the orientation of the detector in the focal plane.

Definition at line 561 of file Detector.h.

void setOrientation(Orientation const &orientation)
Set the orientation of the detector in the focal plane.
Definition: Detector.h:490
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

◆ setPhysicalType()

void lsst::afw::cameraGeom::Detector::Builder::setPhysicalType ( std::string const &  physicalType)
inlineinherited

Set the detector's physical type.

This may mean different things for different cameras; possibilities include the manufacturer ("ITL" vs "E2V") or fundamental technology ("CCD" vs "HgCdTe").

Definition at line 388 of file Detector.h.

388 { _fields.physicalType = physicalType; }
table::Key< std::string > physicalType
Definition: Detector.cc:174

◆ setPixelSize()

void lsst::afw::cameraGeom::Detector::InCameraBuilder::setPixelSize ( lsst::geom::Extent2D const &  pixelSize)
inline

Set the pixel size (in mm).

Definition at line 566 of file Detector.h.

table::Point2DKey pixelSize
Definition: Detector.cc:166
void setPixelSize(lsst::geom::Extent2D const &pixelSize)
Set the pixel size (in mm).
Definition: Detector.h:499

◆ setSerial()

void lsst::afw::cameraGeom::Detector::Builder::setSerial ( std::string const &  serial)
inlineinherited

Set the detector serial "number".

Definition at line 381 of file Detector.h.

381 { _fields.serial = serial; }
table::Key< std::string > serial
Definition: Detector.cc:164

◆ setTransformFromPixelsTo() [1/2]

void lsst::afw::cameraGeom::Detector::InCameraBuilder::setTransformFromPixelsTo ( CameraSys const &  toSys,
std::shared_ptr< afw::geom::TransformPoint2ToPoint2 const >  transform 
)

Set the transformation from PIXELS to the given coordinate system.

Parameters
toSysCoordinate system prefix this transform returns points in. Must be associated with this detector.
transformTransform from PIXELS to toSys.

If a transform already exists from PIXELS to toSys, it is overwritten.

Exceptions
pex::exceptions::InvalidParameterErrorif toSys.getDetectorName() != this->getName().

Definition at line 420 of file Detector.cc.

423  {
424  if (toSys.getDetectorName() != getName()) {
425  throw LSST_EXCEPT(
426  pex::exceptions::InvalidParameterError,
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(
434  TransformMap::Connection{transform, getNativeCoordSys(), toSys}
435  );
436  } else {
437  iter->transform = transform;
438  }
439 }
CameraSys getNativeCoordSys() const
The "native" coordinate system of this detector.
Definition: Detector.h:123
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

◆ setTransformFromPixelsTo() [2/2]

void lsst::afw::cameraGeom::Detector::InCameraBuilder::setTransformFromPixelsTo ( CameraSysPrefix const &  toSys,
std::shared_ptr< afw::geom::TransformPoint2ToPoint2 const >  transform 
)

Set the transformation from PIXELS to the given coordinate system.

Parameters
toSysCoordinate system prefix this transform returns points in.
transformTransform from PIXELS to toSys.

If a transform already exists from PIXELS to toSys, it is overwritten.

Definition at line 413 of file Detector.cc.

416  {
418 }
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

◆ setType()

void lsst::afw::cameraGeom::Detector::Builder::setType ( DetectorType  type)
inlineinherited

Set the purpose of this detector.

Definition at line 378 of file Detector.h.

378 { _fields.type = type; }
table::Key< int > type
Definition: Detector.cc:163

◆ size()

std::size_t lsst::afw::cameraGeom::Detector::Builder::size ( ) const
inlineinherited

Return the number of amplifiers (renamed to len in Python).

Definition at line 451 of file Detector.h.

451 { return _amplifiers.size(); }

◆ unsetCrosstalk()

void lsst::afw::cameraGeom::Detector::Builder::unsetCrosstalk ( )
inlineinherited

Remove the crosstalk coefficient matrix.

Definition at line 403 of file Detector.h.

403 { _fields.crosstalk = CrosstalkMatrix(); }
ndarray::Array< float const, 2 > CrosstalkMatrix
Definition: Detector.h:59

Friends And Related Function Documentation

◆ Camera

friend class Camera
friend

Definition at line 630 of file Detector.h.


The documentation for this class was generated from the following files: