LSST Applications g0265f82a02+d6b5cd48b5,g02d81e74bb+a41d3748ce,g1470d8bcf6+6be6c9203b,g2079a07aa2+14824f138e,g212a7c68fe+a4f2ea4efa,g2305ad1205+72971fe858,g295015adf3+ab2c85acae,g2bbee38e9b+d6b5cd48b5,g337abbeb29+d6b5cd48b5,g3ddfee87b4+31b3a28dff,g487adcacf7+082e807817,g50ff169b8f+5929b3527e,g52b1c1532d+a6fc98d2e7,g591dd9f2cf+b2918d57ae,g5a732f18d5+66d966b544,g64a986408d+a41d3748ce,g858d7b2824+a41d3748ce,g8a8a8dda67+a6fc98d2e7,g99cad8db69+7fe4acdf18,g9ddcbc5298+d4bad12328,ga1e77700b3+246acaaf9c,ga8c6da7877+84af8b3ff8,gb0e22166c9+3863383f4c,gb6a65358fc+d6b5cd48b5,gba4ed39666+9664299f35,gbb8dafda3b+d8d527deb2,gc07e1c2157+b2dbe6b631,gc120e1dc64+61440b2abb,gc28159a63d+d6b5cd48b5,gcf0d15dbbd+31b3a28dff,gdaeeff99f8+a38ce5ea23,ge6526c86ff+39927bb362,ge79ae78c31+d6b5cd48b5,gee10cc3b42+a6fc98d2e7,gf1cff7945b+a41d3748ce,v24.1.5.rc1
LSST Data Management Base Package
Loading...
Searching...
No Matches
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.
 
void setPixelSize (lsst::geom::Extent2D const &pixelSize)
 Set the pixel size (in mm).
 
void setTransformFromPixelsTo (CameraSysPrefix const &toSys, std::shared_ptr< afw::geom::TransformPoint2ToPoint2 const > transform)
 Set the transformation from PIXELS to the given coordinate system.
 
void setTransformFromPixelsTo (CameraSys const &toSys, std::shared_ptr< afw::geom::TransformPoint2ToPoint2 const > transform)
 Set the transformation from PIXELS to the given coordinate system.
 
bool discardTransformFromPixelsTo (CameraSysPrefix const &toSys)
 Remove any transformation from PIXELS to the given coordinate system.
 
bool discardTransformFromPixelsTo (CameraSys const &toSys)
 Remove any transformation from PIXELS to the given coordinate system.
 
void clearTransforms ()
 Remove all coordinate transforms.
 
void setBBox (lsst::geom::Box2I const &bbox)
 Set the bounding box.
 
void setType (DetectorType type)
 Set the purpose of this detector.
 
void setSerial (std::string const &serial)
 Set the detector serial "number".
 
void setPhysicalType (std::string const &physicalType)
 Set the detector's physical type.
 
void setCrosstalk (CrosstalkMatrix const &crosstalk)
 Set the crosstalk coefficients.
 
void unsetCrosstalk ()
 Remove the crosstalk coefficient matrix.
 
std::vector< std::shared_ptr< Amplifier::Builder > > const & getAmplifiers () const
 Return the sequence of Amplifier::Builders directly.
 
auto begin ()
 An iterator range over amplifers.
 
auto end ()
 
std::shared_ptr< Amplifier::Builderoperator[] (size_t i) const
 Get the amplifier builder specified by index.
 
std::shared_ptr< Amplifier::Builderoperator[] (std::string const &name) const
 Get a builder for the amplifier specified by name.
 
void append (std::shared_ptr< Amplifier::Builder > builder)
 Append a new amplifier.
 
void clear ()
 Remove all amplifiers.
 
std::size_t size () const
 Return the number of amplifiers (renamed to len in Python).
 
std::string getName () const
 Get the detector name.
 
int getId () const
 Get the detector ID.
 
DetectorType getType () const
 Return the purpose of this detector.
 
std::string getSerial () const
 Get the detector serial "number".
 
std::string getPhysicalType () const
 Get the detector's physical type.
 
lsst::geom::Box2I getBBox () const
 Get the bounding box.
 
Orientation getOrientation () const
 Get detector's orientation in the focal plane.
 
lsst::geom::Extent2D getPixelSize () const
 Get size of pixel along (mm)
 
bool hasCrosstalk () const
 Have we got crosstalk coefficients?
 
CrosstalkMatrix getCrosstalk () const
 Get the crosstalk coefficients.
 
CameraSys makeCameraSys (CameraSys const &cameraSys) const
 Get a coordinate system from a coordinate system (return input unchanged and untested)
 
CameraSys makeCameraSys (CameraSysPrefix const &cameraSysPrefix) const
 Get a coordinate system from a detector system prefix (add detector name)
 
CameraSys getNativeCoordSys () const
 The "native" coordinate system of this detector.
 

Protected Member Functions

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

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.
 

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 376 of file Detector.cc.

376 {
377 _amplifiers.push_back(std::move(builder));
378}
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 470 of file Detector.cc.

470 {
471 if (toSys.getDetectorName() != getName()) {
472 throw LSST_EXCEPT(
473 pex::exceptions::InvalidParameterError,
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}
#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

◆ 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 466 of file Detector.cc.

466 {
468}
bool discardTransformFromPixelsTo(CameraSysPrefix const &toSys)
Remove any transformation from PIXELS to the given coordinate system.
Definition Detector.cc:466
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 398 of file Detector.cc.

398 {
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}
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.

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

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

◆ 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 }

◆ 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 372 of file Detector.cc.

372 {
373 return *findAmpIterByName(_amplifiers.begin(), _amplifiers.end(), name);
374}

◆ 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 380 of file Detector.cc.

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}
T reserve(T... args)

◆ 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:174

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

561{ Detector::Builder::setOrientation(orientation); }
void setOrientation(Orientation const &orientation)
Set the orientation of the detector in the focal plane.
Definition Detector.h:490

◆ 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:175

◆ 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 445 of file Detector.cc.

448 {
449 if (toSys.getDetectorName() != getName()) {
450 throw LSST_EXCEPT(
451 pex::exceptions::InvalidParameterError,
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(
459 TransformMap::Connection{transform, getNativeCoordSys(), toSys}
460 );
461 } else {
462 iter->transform = transform;
463 }
464}
table::Key< int > transform
CameraSys getNativeCoordSys() const
The "native" coordinate system of this detector.
Definition Detector.h:123

◆ 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 438 of file Detector.cc.

441 {
442 return setTransformFromPixelsTo(makeCameraSys(toSys), std::move(transform));
443}
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

◆ 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 Symbol 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: