29 namespace cameraGeom {
40 _ampInfoCatalog(ampInfoCatalog),
42 _orientation(orientation),
43 _pixelSize(pixelSize),
45 _transformMap(_nativeSys, transforms),
46 _crosstalk(crosstalk) {
55 auto nativeToCameraSys = _transformMap.
getTransform(_nativeSys, cameraSys);
56 return nativeToCameraSys->applyForward(nativeCorners);
77 i = _ampInfoCatalog.
size() + i;
79 return _ampInfoCatalog.
get(i);
83 _AmpInfoMap::const_iterator ampIter = _ampNameIterMap.
find(name);
84 if (ampIter == _ampNameIterMap.
end()) {
86 os <<
"Unknown amplifier \"" << name <<
"\"";
89 return ampIter->second;
98 template <
typename FromSysT,
typename ToSysT>
100 ToSysT
const &toSys)
const {
104 template <
typename FromSysT,
typename ToSysT>
106 ToSysT
const &toSys)
const {
110 template <
typename FromSysT,
typename ToSysT>
112 FromSysT
const &fromSys, ToSysT
const &toSys)
const {
116 void Detector::_init() {
119 ampIter != _ampInfoCatalog.
end(); ++ampIter) {
122 if (_ampNameIterMap.
size() != _ampInfoCatalog.
size()) {
124 "Invalid ampInfoCatalog: not all amplifier names are unique");
129 if (sys.hasDetectorName() && sys.getDetectorName() != _name) {
131 os <<
"Invalid transformMap: " << sys <<
" detector name != \"" << _name <<
"\"";
138 auto shape = _crosstalk.getShape();
139 assert(shape.size() == 2);
140 if (shape[0] != shape[1]) {
142 os <<
"Non-square crosstalk matrix: " << _crosstalk <<
" for detector \"" << _name <<
"\"";
145 if (shape[0] != _ampInfoCatalog.
size()) {
147 os <<
"Wrong size crosstalk matrix: " << _crosstalk <<
" for detector \"" << _name <<
"\"";
156 #define INSTANTIATE(FROMSYS, TOSYS) \ 157 template std::shared_ptr<geom::TransformPoint2ToPoint2> Detector::getTransform(FROMSYS const &, \ 158 TOSYS const &) const; \ 159 template lsst::geom::Point2D Detector::transform(lsst::geom::Point2D const &, FROMSYS const &, \ 160 TOSYS const &) const; \ 161 template std::vector<lsst::geom::Point2D> Detector::transform(std::vector<lsst::geom::Point2D> const &, \ 162 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.
Iterator class for CatalogT.
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.