23#if !defined(LSST_AFW_CAMERAGEOM_DETECTOR_H)
24#define LSST_AFW_CAMERAGEOM_DETECTOR_H
28#include <unordered_map>
229 template <
typename FromSysT,
typename ToSysT>
231 ToSysT
const &toSys)
const;
245 template <
typename FromSysT,
typename ToSysT>
247 ToSysT
const &toSys)
const;
261 template <
typename FromSysT,
typename ToSysT>
263 FromSysT
const &fromSys, ToSysT
const &toSys)
const;
278 auto begin()
const {
return _amplifiers.begin(); }
279 auto end()
const {
return _amplifiers.end(); }
323 Fields
const _fields;
426 auto begin() {
return _amplifiers.begin(); }
427 auto end() {
return _amplifiers.end(); }
448 void clear() { _amplifiers.clear(); }
472 _fields(
std::move(fields)),
473 _amplifiers(
std::move(amplifiers))
table::Key< int > transformMap
table::Key< std::string > physicalType
table::Point2DKey pixelSize
table::Key< std::string > serial
table::Key< table::Array< float > > crosstalk
An immutable representation of a camera.
Camera coordinate system; used as a key in in TransformMap.
Camera coordinate system prefix.
A helper class for Detector that allows amplifiers and most fields to be modified.
Builder & operator=(Builder const &)=delete
auto begin()
An iterator range over amplifers.
Builder(Builder &&)=delete
void setSerial(std::string const &serial)
Set the detector serial "number".
void setBBox(lsst::geom::Box2I const &bbox)
Set the bounding box.
void setPhysicalType(std::string const &physicalType)
Set the detector's physical type.
Builder & operator=(Builder &&)=delete
~Builder() noexcept override=0
Builder(Builder const &)=delete
std::vector< std::shared_ptr< Amplifier const > > finishAmplifiers() const
Create a vector of Amplifiers from the Amplifier::Builder sequence.
void setPixelSize(lsst::geom::Extent2D const &pixelSize)
Set the pixel size (in mm).
static std::vector< std::shared_ptr< Amplifier::Builder > > rebuildAmplifiers(Detector const &detector)
Create a vector of Amplifier::Builders from the Amplifiers in a Detector.
Builder(Fields fields, std::vector< std::shared_ptr< Amplifier::Builder > > &&lifiers)
Construct a Detector::Builder with the given field values and amplifiers.
void setCrosstalk(CrosstalkMatrix const &crosstalk)
Set the crosstalk coefficients.
std::vector< std::shared_ptr< Amplifier::Builder > > const & getAmplifiers() const
Return the sequence of Amplifier::Builders directly.
void setType(DetectorType type)
Set the purpose of this detector.
Fields const & getFields() const override
Return a reference to a Fields struct.
void unsetCrosstalk()
Remove the crosstalk coefficient matrix.
void setOrientation(Orientation const &orientation)
Set the orientation of the detector in the focal plane.
void append(std::shared_ptr< Amplifier::Builder > builder)
Append a new amplifier.
std::size_t size() const
Return the number of amplifiers (renamed to len in Python).
std::shared_ptr< Amplifier::Builder > operator[](size_t i) const
Get the amplifier builder specified by index.
void clear()
Remove all amplifiers.
A helper class that allows the properties of a detector to be modified in the course of modifying a f...
void setOrientation(Orientation const &orientation)
Set the orientation of the detector in the focal plane.
void setTransformFromPixelsTo(CameraSysPrefix 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.
void setPixelSize(lsst::geom::Extent2D const &pixelSize)
Set the pixel size (in mm).
void clearTransforms()
Remove all coordinate transforms.
A helper class that allows the properties of a single detector to be modified in isolation.
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.
An abstract base class that provides common accessors for Detector and Detector::Builder.
DetectorBase(DetectorBase const &)=default
lsst::geom::Box2I getBBox() const
Get the bounding box.
DetectorBase(DetectorBase &&)=default
virtual ~DetectorBase() noexcept=default
DetectorBase & operator=(DetectorBase &&)=default
DetectorBase & operator=(DetectorBase const &)=default
DetectorBase()=default
DetectorBase has no state, and is hence default-constructable, copyable, and movable.
lsst::geom::Extent2D getPixelSize() const
Get size of pixel along (mm)
CameraSys makeCameraSys(CameraSysPrefix const &cameraSysPrefix) const
Get a coordinate system from a detector system prefix (add detector name)
std::string getName() const
Get the detector name.
CameraSys getNativeCoordSys() const
The "native" coordinate system of this detector.
virtual Fields const & getFields() const =0
Return a reference to a Fields struct.
bool hasCrosstalk() const
Have we got crosstalk coefficients?
int getId() const
Get the detector ID.
std::string getPhysicalType() const
Get the detector's physical type.
Orientation getOrientation() const
Get detector's orientation in the focal plane.
std::string getSerial() const
Get the detector serial "number".
CameraSys makeCameraSys(CameraSys const &cameraSys) const
Get a coordinate system from a coordinate system (return input unchanged and untested)
CrosstalkMatrix getCrosstalk() const
Get the crosstalk coefficients.
ndarray::Array< float const, 2 > CrosstalkMatrix
DetectorType getType() const
Return the purpose of this detector.
A representation of a detector in a mosaic camera.
std::vector< std::shared_ptr< Amplifier const > > const & getAmplifiers() const
Return the sequence of Amplifiers directly.
auto begin() const
An iterator range over amplifers.
bool hasTransform(CameraSys const &cameraSys) const
Can this object convert between PIXELS and the specified camera coordinate system?
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,...
std::string getPythonModule() const override
Return the fully-qualified Python module that should be imported to guarantee that its factory is reg...
std::size_t size() const
Get the number of amplifiers.
bool isPersistable() const noexcept override
Detector is always persistable.
std::shared_ptr< Amplifier const > operator[](size_t i) const
Get the amplifier specified by index.
std::string getPersistenceName() const override
Return the unique name used to persist this object and look up its factory.
std::shared_ptr< TransformMap const > getTransformMap() const
Get the transform registry.
Fields const & getFields() const override
Return a reference to a Fields struct.
void write(OutputArchiveHandle &handle) const override
Write the object to one or more catalogs.
std::vector< lsst::geom::Point2D > getCorners(CameraSys const &cameraSys) const
Get the corners of the detector in the specified camera coordinate system.
lsst::geom::Point2D getCenter(CameraSys const &cameraSys) const
Get the center of the detector in the specified camera coordinate system.
std::shared_ptr< PartialRebuilder > rebuild() const
Return a Builder object initialized with the state of this Detector.
Describe a detector's orientation in the focal plane.
A CRTP facade class for subclasses of Persistable.
io::OutputArchiveHandle OutputArchiveHandle
Interface supporting iteration over heterogenous containers.
An integer coordinate rectangle.
DetectorType
Type of imaging detector.
CrosstalkMatrix crosstalk
lsst::geom::Extent2D pixelSize