29 namespace cameraGeom {
35 Detector(name, id, type, serial, bbox, ampInfoCatalog, orientation, pixelSize,
49 _ampInfoCatalog(ampInfoCatalog),
51 _orientation(orientation),
52 _pixelSize(pixelSize),
54 _transformMap(
std::move(transformMap)),
58 for (
auto ampIter = _ampInfoCatalog.
begin(); ampIter != _ampInfoCatalog.
end(); ++ampIter) {
61 if (_ampNameIterMap.
size() != _ampInfoCatalog.
size()) {
63 "Invalid ampInfoCatalog: not all amplifier names are unique");
68 auto shape = _crosstalk.getShape();
69 assert(shape.size() == 2);
70 if (shape[0] != shape[1]) {
72 os <<
"Non-square crosstalk matrix: " << _crosstalk <<
" for detector \"" << _name <<
"\"";
75 if (shape[0] != _ampInfoCatalog.
size()) {
77 os <<
"Wrong size crosstalk matrix: " << _crosstalk <<
" for detector \"" << _name <<
"\"";
85 auto nativeToCameraSys = _transformMap->getTransform(_nativeSys, cameraSys);
86 return nativeToCameraSys->applyForward(nativeCorners);
107 i = _ampInfoCatalog.
size() + i;
109 return _ampInfoCatalog.
get(i);
113 _AmpInfoMap::const_iterator ampIter = _ampNameIterMap.
find(name);
114 if (ampIter == _ampNameIterMap.
end()) {
116 os <<
"Unknown amplifier \"" << name <<
"\"";
119 return ampIter->second;
128 template <
typename FromSysT,
typename ToSysT>
130 ToSysT
const &toSys)
const {
134 template <
typename FromSysT,
typename ToSysT>
136 ToSysT
const &toSys)
const {
140 template <
typename FromSysT,
typename ToSysT>
142 FromSysT
const &fromSys, ToSysT
const &toSys)
const {
149 #define INSTANTIATE(FROMSYS, TOSYS) \ 150 template std::shared_ptr<geom::TransformPoint2ToPoint2> Detector::getTransform(FROMSYS const &, \ 151 TOSYS const &) const; \ 152 template lsst::geom::Point2D Detector::transform(lsst::geom::Point2D const &, FROMSYS const &, \ 153 TOSYS const &) const; \ 154 template std::vector<lsst::geom::Point2D> Detector::transform(std::vector<lsst::geom::Point2D> const &, \ 155 FROMSYS const &, TOSYS const &) const; std::vector< Point2D > getCorners() const
Camera coordinate system; used as a key in in TransformMap.
Geometry and electronic information about raw amplifier images.
Point2D const getCenter() const noexcept
CameraSysPrefix const PIXELS
Nominal pixels on the detector (unbinned) This ignores manufacturing imperfections, "tree ring" distortions and all other such effects.
std::shared_ptr< lsst::afw::table::AmpInfoRecord const > _get(int i) const
Get the amplifier specified by index, returning a shared pointer to an AmpInfo record.
Describe a detector's orientation in the focal plane.
CameraSys const makeCameraSys(CameraSys const &cameraSys) const
Get a coordinate system from a coordinate system (return input unchanged and untested) ...
A base class for image defects.
iterator end()
Iterator access.
bool hasTransform(CameraSys const &cameraSys) const
Can this object convert between PIXELS and the specified camera coordinate system?
bool hasCrosstalk() const
Have we got crosstalk coefficients?
std::vector< lsst::geom::Point2D > getCorners(CameraSys const &cameraSys) const
Get the corners of the detector in the specified camera coordinate system.
#define INSTANTIATE(FROMSYS, TOSYS)
lsst::geom::Point2D getCenter(CameraSys const &cameraSys) const
Get the center of the detector in the specified camera coordinate system.
Camera coordinate system prefix.
#define LSST_EXCEPT(type,...)
Information about a CCD or other imaging detector.
std::shared_ptr< RecordT > const get(size_type i) const
Return a pointer to the record at index i.
size_type size() const
Return the number of elements in the catalog.
Detector(std::string const &name, int id, DetectorType type, std::string const &serial, lsst::geom::Box2I const &bbox, lsst::afw::table::AmpInfoCatalog const &InfoCatalog, Orientation const &orientation, lsst::geom::Extent2D const &pixelSize, TransformMap::Transforms const &transforms, CrosstalkMatrix const &crosstalk=CrosstalkMatrix())
Make a Detector.
iterator begin()
Iterator access.
lsst::afw::table::AmpInfoRecord const & operator[](size_t i) const
Get the amplifier specified by index.
DetectorType
Type of imaging detector.
ndarray::Array< float const, 2 > CrosstalkMatrix
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.
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.