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 | List of all members
lsst::afw::cameraGeom::Detector::PartialRebuilder Class Referencefinal

A helper class that allows the properties of a single detector to be modified in isolation. More...

#include <Detector.h>

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

Public Types

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

Public Member Functions

 PartialRebuilder (Detector const &detector)
 Construct a PartialRebuilder initialized to the state of the given Detector. More...
 
std::shared_ptr< Detector const > finish () const
 Construct a new Detector from the current state of the Builder. 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...
 
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...
 

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...
 

Detailed Description

A helper class that allows the properties of a single detector to be modified in isolation.

Detector::PartialRebuilder can be used without access to the Camera instance the Detector was originally a part of (such as when the Detector was obtained from an Exposure or ExposureRecord). As this always creates a new Detector, the original Camera is never updated. PartialRebuilder prohibits changes to coordinate systems and transforms (including the orientation and pixel size fields that are used to define some transforms), as these cannot be done self-consistently without access to the full Camera.

Definition at line 520 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.

Constructor & Destructor Documentation

◆ PartialRebuilder()

lsst::afw::cameraGeom::Detector::PartialRebuilder::PartialRebuilder ( Detector const &  detector)

Construct a PartialRebuilder initialized to the state of the given Detector.

Definition at line 383 of file Detector.cc.

383  :
385  _transformMap(detector.getTransformMap())
386 {}
table::Key< int > detector
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

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(); }

◆ end()

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

Definition at line 427 of file Detector.h.

427 { return _amplifiers.end(); }

◆ finish()

std::shared_ptr< Detector const > lsst::afw::cameraGeom::Detector::PartialRebuilder::finish ( ) const

Construct a new Detector from the current state of the Builder.

Definition at line 388 of file Detector.cc.

388  {
389  return std::shared_ptr<Detector>(new Detector(getFields(), _transformMap, finishAmplifiers()));
390 }
Fields const & getFields() const override
Return a reference to a Fields struct.
Definition: Detector.h:476
std::vector< std::shared_ptr< Amplifier const > > finishAmplifiers() const
Create a vector of Amplifiers from the Amplifier::Builder sequence.
Definition: Detector.cc:373

◆ 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()); }
std::string getName() const
Get the detector name.
Definition: Detector.h:64
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 }

◆ 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::Builder::setOrientation ( Orientation const &  orientation)
inlineprotectedinherited

Set the orientation of the detector in the focal plane.

This is intended for use by InCameraBuilder only; the orientation is used to set the coordinate transform from FOCAL_PLANE to PIXELS, and hence cannot be modified unless the full Camera is being modified.

Definition at line 490 of file Detector.h.

490 { _fields.orientation = 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

◆ 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::Builder::setPixelSize ( lsst::geom::Extent2D const &  pixelSize)
inlineprotectedinherited

Set the pixel size (in mm).

This is intended for use by InCameraBuilder only; the pixel size is used to set the coordinate transform from FOCAL_PLANE to PIXELS, and hence cannot be modified unless the full Camera is being modified.

Definition at line 499 of file Detector.h.

499 { _fields.pixelSize = pixelSize; }
table::Point2DKey pixelSize
Definition: Detector.cc:166

◆ 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

◆ 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

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