23 #if !defined(LSST_AFW_CAMERAGEOM_DETECTOR_H) 24 #define LSST_AFW_CAMERAGEOM_DETECTOR_H 28 #include <unordered_map> 39 namespace cameraGeom {
64 std::
string getName()
const {
return getFields().name; }
67 int getId()
const {
return getFields().id; }
95 return !(getFields().crosstalk.isEmpty() ||
96 getFields().crosstalk.getShape() == ndarray::makeVector(0, 0));
160 virtual Fields const & getFields()
const = 0;
212 bool hasTransform(
CameraSys const &cameraSys)
const;
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(); }
372 ~
Builder() noexcept
override = 0;
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))
476 Fields
const &
getFields()
const override {
return _fields; }
577 void setTransformFromPixelsTo(
594 void setTransformFromPixelsTo(
618 bool discardTransformFromPixelsTo(
CameraSys const & toSys);
A helper class that allows the properties of a single detector to be modified in isolation.
Orientation getOrientation() const
Get detector's orientation in the focal plane.
void setPixelSize(lsst::geom::Extent2D const &pixelSize)
Set the pixel size (in mm).
def write(self, patchRef, catalog)
Write the output.
lsst::geom::Box2I getBBox() const
Get the bounding box.
Camera coordinate system; used as a key in in TransformMap.
void setCrosstalk(CrosstalkMatrix const &crosstalk)
Set the crosstalk coefficients.
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.
An object passed to Persistable::write to allow it to persist itself.
lsst::geom::Extent2D getPixelSize() const
Get size of pixel along (mm)
auto end()
An iterator range over amplifers.
std::shared_ptr< Amplifier::Builder > operator[](size_t i) const
Get the amplifier builder specified by index.
Fields const & getFields() const override
An iterator range over amplifers.
CameraSysPrefix const PIXELS
Pixel coordinates: Nominal position on the entry surface of a given detector (x, y unbinned pixels)...
Interface supporting iteration over heterogenous containers.
Fields const & getFields() const override
Return a reference to a Fields struct.
An immutable representation of a camera.
DetectorType getType() const
Return the purpose of this detector.
CameraSys makeCameraSys(CameraSys const &cameraSys) const
Get a coordinate system from a coordinate system (return input unchanged and untested) ...
A helper class that allows the properties of a detector to be modified in the course of modifying a f...
CameraSys makeCameraSys(CameraSysPrefix const &cameraSysPrefix) const
Get a coordinate system from a detector system prefix (add detector name)
void clear()
Remove all amplifiers.
void setOrientation(Orientation const &orientation)
Set the orientation of the detector in the focal plane.
std::shared_ptr< FrameSet > append(FrameSet const &first, FrameSet const &second)
Construct a FrameSet that performs two transformations in series.
int getId() const
Get the detector ID.
std::string getPhysicalType() const
Get the detector's physical type.
Describe a detector's orientation in the focal plane.
std::string getSerial() const
Get the detector serial "number".
A helper class for Detector that allows amplifiers and most fields to be modified.
A base class for image defects.
CrosstalkMatrix getCrosstalk() const
Get the crosstalk coefficients.
std::shared_ptr< TransformMap const > getTransformMap() const
Get the transform registry.
void clearTransforms()
Remove all coordinate transforms.
void setType(DetectorType type)
Set the purpose of this detector.
table::Key< int > detector
void setPixelSize(lsst::geom::Extent2D const &pixelSize)
Set the pixel size (in mm).
table::Point2DKey pixelSize
void setBBox(lsst::geom::Box2I const &bbox)
Set the bounding box.
CrosstalkMatrix crosstalk
auto begin()
An iterator range over amplifers.
std::size_t size() const
Return the number of amplifiers (renamed to len in Python).
Camera coordinate system prefix.
void setSerial(std::string const &serial)
Set the detector serial "number".
table::Key< std::string > physicalType
A representation of a detector in a mosaic camera.
An abstract base class that provides common accessors for Detector and Detector::Builder.
std::vector< std::shared_ptr< Amplifier::Builder > > const & getAmplifiers() const
Return the sequence of Amplifier::Builders directly.
std::size_t size() const
Get the number of amplifiers.
void unsetCrosstalk()
Remove the crosstalk coefficient matrix.
bool hasCrosstalk() const
Have we got crosstalk coefficients?
Builder(Fields fields, std::vector< std::shared_ptr< Amplifier::Builder >> &&lifiers)
Construct a Detector::Builder with the given field values and amplifiers.
auto begin() const
An iterator range over amplifers.
CameraSys getNativeCoordSys() const
The "native" coordinate system of this detector.
std::shared_ptr< Amplifier const > operator[](size_t i) const
Get the amplifier specified by index.
table::Key< std::string > serial
std::vector< std::shared_ptr< Amplifier const > > const & getAmplifiers() const
Return the sequence of Amplifiers directly.
lsst::geom::Extent2D pixelSize
bool isPersistable() const noexcept override
Detector is always persistable.
table::Key< table::Array< float > > crosstalk
DetectorType
Type of imaging detector.
A CRTP facade class for subclasses of Persistable.
An integer coordinate rectangle.
ndarray::Array< float const, 2 > CrosstalkMatrix
void setOrientation(Orientation const &orientation)
Set the orientation of the detector in the focal plane.
void setPhysicalType(std::string const &physicalType)
Set the detector's physical type.
auto end() const
An iterator range over amplifers.