LSST Applications g02d81e74bb+86cf3d8bc9,g180d380827+7a4e862ed4,g2079a07aa2+86d27d4dc4,g2305ad1205+e1ca1c66fa,g29320951ab+012e1474a1,g295015adf3+341ea1ce94,g2bbee38e9b+0e5473021a,g337abbeb29+0e5473021a,g33d1c0ed96+0e5473021a,g3a166c0a6a+0e5473021a,g3ddfee87b4+c429d67c83,g48712c4677+f88676dd22,g487adcacf7+27e1e21933,g50ff169b8f+96c6868917,g52b1c1532d+585e252eca,g591dd9f2cf+b41db86c35,g5a732f18d5+53520f316c,g64a986408d+86cf3d8bc9,g858d7b2824+86cf3d8bc9,g8a8a8dda67+585e252eca,g99cad8db69+84912a7fdc,g9ddcbc5298+9a081db1e4,ga1e77700b3+15fc3df1f7,ga8c6da7877+a2b54eae19,gb0e22166c9+60f28cb32d,gba4ed39666+c2a2e4ac27,gbb8dafda3b+6681f309db,gc120e1dc64+f0fcc2f6d8,gc28159a63d+0e5473021a,gcf0d15dbbd+c429d67c83,gdaeeff99f8+f9a426f77a,ge6526c86ff+0433e6603d,ge79ae78c31+0e5473021a,gee10cc3b42+585e252eca,gff1a9f87cc+86cf3d8bc9,w.2024.17
LSST Data Management Base Package
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Protected Member Functions | Static Protected Member Functions | List of all members
lsst::afw::cameraGeom::Detector::Builder Class Referenceabstract

A helper class for Detector that allows amplifiers and most fields to be modified. More...

#include <Detector.h>

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

Public Types

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

Public Member Functions

 Builder (Builder const &)=delete
 
 Builder (Builder &&)=delete
 
Builderoperator= (Builder const &)=delete
 
Builderoperator= (Builder &&)=delete
 
 ~Builder () noexcept override=0
 
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

 Builder (std::string const &name, int id)
 Construct a Detector::Builder with no amplifiers and the given name and ID.
 
 Builder (Fields fields, std::vector< std::shared_ptr< Amplifier::Builder > > &&amplifiers)
 Construct a Detector::Builder with the given field values and amplifiers.
 
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.
 
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).
 

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.
 

Detailed Description

A helper class for Detector that allows amplifiers and most fields to be modified.

Because Detector is immutable, creation and modification always go through Builder, or more precisely, one of its two subclasses:

Detector::Builder itself provides functionality common to these:

The name and ID of a detector (but not its "serial" string) are set at initial construction and are an integral part of the relationship between it and its Camera, and can never be changed, even by Builders.

The fact that Amplifier::Builder inherits from Amplifier does not mean that a container of Amplifier::Builder can inherit from a container of Amplifier, and hence Detector::Builder (which has a container of Amplifer::Builder) cannot inherit directly from Detector (which has a container of Amplifier). But in both Python and templated C++ code, the container interfaces of Detector and Detector::Builder are identical (i.e. they're "duck type" equivalent), aside from the fact that Detector::Builder also permits addition and removal of amplifiers.

Definition at line 362 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

◆ Builder() [1/4]

lsst::afw::cameraGeom::Detector::Builder::Builder ( Builder const & )
delete

◆ Builder() [2/4]

lsst::afw::cameraGeom::Detector::Builder::Builder ( Builder && )
delete

◆ ~Builder()

lsst::afw::cameraGeom::Detector::Builder::~Builder ( )
overridepure virtualdefaultnoexcept

◆ Builder() [3/4]

lsst::afw::cameraGeom::Detector::Builder::Builder ( std::string const & name,
int id )
protected

Construct a Detector::Builder with no amplifiers and the given name and ID.

Definition at line 391 of file Detector.cc.

391 {
392 _fields.name = name;
393 _fields.id = id;
394}
table::Key< std::string > name
Definition Amplifier.cc:116
table::Key< int > id
Definition Detector.cc:162

◆ Builder() [4/4]

lsst::afw::cameraGeom::Detector::Builder::Builder ( Fields fields,
std::vector< std::shared_ptr< Amplifier::Builder > > && amplifiers )
inlineprotected

Construct a Detector::Builder with the given field values and amplifiers.

Definition at line 471 of file Detector.h.

471 :
472 _fields(std::move(fields)),
473 _amplifiers(std::move(amplifiers))
474 {}
T move(T... args)

Member Function Documentation

◆ append()

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

Append a new amplifier.

Definition at line 376 of file Detector.cc.

376 {
377 _amplifiers.push_back(std::move(builder));
378}

◆ begin()

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

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 ( )
inline

Remove all amplifiers.

Definition at line 448 of file Detector.h.

448{ _amplifiers.clear(); }

◆ end()

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

Definition at line 427 of file Detector.h.

427{ return _amplifiers.end(); }

◆ finishAmplifiers()

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

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
inline

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
inlineoverrideprotectedvirtual

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.

67{ return getFields().id; }

◆ getName()

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

Get the detector name.

Definition at line 64 of file Detector.h.

64{ return getFields().name; }

◆ 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

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

Builder & lsst::afw::cameraGeom::Detector::Builder::operator= ( Builder && )
delete

◆ operator=() [2/2]

Builder & lsst::afw::cameraGeom::Detector::Builder::operator= ( Builder const & )
delete

◆ operator[]() [1/2]

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

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

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)
staticprotected

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)
inline

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)
inline

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

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.

◆ setPhysicalType()

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

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

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)
inline

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)
inline

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
inline

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 ( )
inline

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: