LSST Applications g0265f82a02+c6dfa2ddaf,g1162b98a3f+b2075782a9,g2079a07aa2+1b2e822518,g2bbee38e9b+c6dfa2ddaf,g337abbeb29+c6dfa2ddaf,g3ddfee87b4+a60788ef87,g50ff169b8f+2eb0e556e8,g52b1c1532d+90ebb246c7,g555ede804d+a60788ef87,g591dd9f2cf+ba8caea58f,g5ec818987f+864ee9cddb,g858d7b2824+9ee1ab4172,g876c692160+a40945ebb7,g8a8a8dda67+90ebb246c7,g8cdfe0ae6a+4fd9e222a8,g99cad8db69+5e309b7bc6,g9ddcbc5298+a1346535a5,ga1e77700b3+df8f93165b,ga8c6da7877+aa12a14d27,gae46bcf261+c6dfa2ddaf,gb0e22166c9+8634eb87fb,gb3f2274832+d0da15e3be,gba4ed39666+1ac82b564f,gbb8dafda3b+5dfd9c994b,gbeb006f7da+97157f9740,gc28159a63d+c6dfa2ddaf,gc86a011abf+9ee1ab4172,gcf0d15dbbd+a60788ef87,gdaeeff99f8+1cafcb7cd4,gdc0c513512+9ee1ab4172,ge79ae78c31+c6dfa2ddaf,geb67518f79+ba1859f325,geb961e4c1e+f9439d1e6f,gee10cc3b42+90ebb246c7,gf1cff7945b+9ee1ab4172,w.2024.12
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::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.
 
std::shared_ptr< Detector const > finish () const
 Construct a new Detector from the current state of the Builder.
 
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.
 
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 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 408 of file Detector.cc.

408 :
409 Builder(detector._fields, rebuildAmplifiers(detector)),
410 _transformMap(detector.getTransformMap())
411{}
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:380

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

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

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

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

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

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