Class Detector

Inheritance Relationships

Base Types

Class Documentation

class Detector : public lsst::afw::cameraGeom::DetectorBase, public lsst::afw::table::io::PersistableFacade<Detector>, public Storable

A representation of a detector in a mosaic camera.

Detector holds both simple data fields (see DetectorBase) and a set of related coordinate systems and transforms, and acts as a container of Amplifier objects.

Detector is immutable, but copies can be modified via one of its Builder classes. A Detector must be created initially as part of a Camera (see Camera::Builder::add), but can then be modified either individually (see Detector::rebuild and Detector::PartialRebuilder) or as part of modifying the full Camera (see Detector::InCameraBuilder).

The coordinate systems and transforms known to a Detector are shared with its parent Camera and all other Detectors in that Camera.

Unnamed Group

auto begin() const

An iterator range over amplifers.

Iterators dereference to shared_ptr<Amplifier const>.

auto end() const
std::shared_ptr<Amplifier const> operator[](size_t i) const

Get the amplifier specified by index.

Exceptions
  • std::out_of_range: if index is out of range.

std::shared_ptr<Amplifier const> operator[](std::string const &name) const

Get the amplifier specified by name.

Exceptions
  • lsst::pex::exceptions::InvalidParameterError: if no such amplifier.

std::size_t size() const

Get the number of amplifiers. Renamed to __len__ in Python.

bool isPersistable() const

Detector is always persistable.

Fields const &getFields() const

Return a reference to a Fields struct.

Must be implemented by all subclasses.

Public Functions

std::shared_ptr<PartialRebuilder> rebuild() const

Return a Builder object initialized with the state of this Detector.

This is simply a shortcut for Detector::PartialRebuilder(*this).

std::vector<lsst::geom::Point2D> getCorners(CameraSys const &cameraSys) const

Get the corners of the detector in the specified camera coordinate system

std::vector<lsst::geom::Point2D> getCorners(CameraSysPrefix const &cameraSysPrefix) const

Get the corners of the detector in the specified camera coordinate system prefix

lsst::geom::Point2D getCenter(CameraSys const &cameraSys) const

Get the center of the detector in the specified camera coordinate system

lsst::geom::Point2D getCenter(CameraSysPrefix const &cameraSysPrefix) const

Get the center of the detector in the specified camera coordinate system prefix

bool hasTransform(CameraSys const &cameraSys) const

Can this object convert between PIXELS and the specified camera coordinate system?

bool hasTransform(CameraSysPrefix const &cameraSysPrefix) const

Can this object convert between PIXELS and the specified camera coordinate system prefix?

template<typename FromSysT, typename ToSysT>
std::shared_ptr<afw::geom::TransformPoint2ToPoint2> getTransform(FromSysT const &fromSys, ToSysT const &toSys) const

Get a Transform from one camera coordinate system, or camera coordinate system prefix, to another.

Return

a Transform that converts from fromSys to toSys in the forward direction. The Transform will be invertible.

Template Parameters
Parameters
  • fromSystoSys: camera coordinate systems or prefixes between which to transform

Exceptions
  • lsst::pex::exceptions::InvalidParameterError: Thrown if either fromSys or toSys is not supported.

template<typename FromSysT, typename ToSysT>
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

Return

The transformed point

Template Parameters
Parameters
  • [in] point: Camera point to transform

  • [in] fromSys: Camera coordinate system of point

  • [in] toSys: Camera coordinate system of returned point

Exceptions
  • pex::exceptions::InvalidParameterError: if fromSys or toSys is unknown

template<typename FromSysT, typename ToSysT>
std::vector<lsst::geom::Point2D> transform(std::vector<lsst::geom::Point2D> const &points, FromSysT const &fromSys, ToSysT const &toSys) const

Transform a vector of points from one camera system to another

Return

The transformed points

Template Parameters
Parameters
  • [in] points: Camera points to transform

  • [in] fromSys: Camera coordinate system of points

  • [in] toSys: Camera coordinate system of returned points

Exceptions
  • pex::exceptions::InvalidParameterError: if fromSys or toSys is unknown

std::shared_ptr<TransformMap const> getTransformMap() const

Get the transform registry

std::vector<std::shared_ptr<Amplifier const>> const &getAmplifiers() const

Return the sequence of Amplifiers directly.

class Builder : public lsst::afw::cameraGeom::DetectorBase

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:

  • setters for the simple data fields of Detector;

  • a container of Amplifier::Builders. It is not intended define an interface independent of its subclasses.

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.

Subclassed by lsst::afw::cameraGeom::Detector::InCameraBuilder, lsst::afw::cameraGeom::Detector::PartialRebuilder

Unnamed Group

auto begin()

An iterator range over amplifers.

Iterators dereference to shared_ptr<Amplifier::Builder>.

auto end()

Public Functions

Builder(Builder const&)
Builder(Builder&&)
Builder &operator=(Builder const&)
Builder &operator=(Builder&&)
~Builder() = 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.

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

void setCrosstalk(CrosstalkMatrix const &crosstalk)

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

void unsetCrosstalk()

Remove the crosstalk coefficient matrix.

std::vector<std::shared_ptr<Amplifier::Builder>> const &getAmplifiers() const

Return the sequence of Amplifier::Builders directly.

std::shared_ptr<Amplifier::Builder> operator[](size_t i) const

Get the amplifier builder specified by index

Exceptions
  • std::out_of_range: if index is out of range.

std::shared_ptr<Amplifier::Builder> operator[](std::string const &name) const

Get a builder for the amplifier specified by name.

Exceptions
  • lsst::pex::exceptions::InvalidParameterError: if no such amplifier.

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

Protected 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

Return a reference to a Fields struct.

Must be implemented by all subclasses.

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.

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.

void setPixelSize(lsst::geom::Extent2D const &pixelSize)

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.

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

class InCameraBuilder : public lsst::afw::cameraGeom::Detector::Builder

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.

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

If a transform already exists from PIXELS to

toSys, it is overwritten.
Parameters
  • toSys: Coordinate system prefix this transform returns points in.

  • transform: Transform from PIXELS to toSys.

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

Set the transformation from PIXELS to the given coordinate system.

If a transform already exists from PIXELS to

toSys, it is overwritten.
Parameters
  • toSys: Coordinate system prefix this transform returns points in. Must be associated with this detector.

  • transform: Transform from PIXELS to toSys.

Exceptions
  • pex::exceptions::InvalidParameterError: if toSys.getDetectorName() != this->getName().

bool discardTransformFromPixelsTo(CameraSysPrefix const &toSys)

Remove any transformation from PIXELS to the given coordinate system.

Return

true if a transform was removed; false otherwise.

Parameters
  • toSys: Coordinate system prefix this transform returns points in.

bool discardTransformFromPixelsTo(CameraSys const &toSys)

Remove any transformation from PIXELS to the given coordinate system.

Return

true if a transform was removed; false otherwise.

Parameters
  • toSys: Coordinate system prefix this transform returns points in. Must be associated with this detector.

Exceptions
  • pex::exceptions::InvalidParameterError: if toSys.getDetectorName() != this->getName().

void clearTransforms()

Remove all coordinate transforms.

class PartialRebuilder : public lsst::afw::cameraGeom::Detector::Builder

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.

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