29 namespace cameraGeom {
40 _ampInfoCatalog(ampInfoCatalog),
42 _orientation(orientation),
43 _pixelSize(pixelSize),
70 i = _ampInfoCatalog.
size() + i;
72 return _ampInfoCatalog.
get(i);
76 _AmpInfoMap::const_iterator ampIter = _ampNameIterMap.find(name);
77 if (ampIter == _ampNameIterMap.end()) {
78 std::ostringstream os;
79 os <<
"Unknown amplifier \"" << name <<
"\"";
80 throw LSST_EXCEPT(pexExcept::InvalidParameterError, os.str());
82 return ampIter->second;
92 return _transformMap[cameraSys];
100 void Detector::_init() {
103 ampIter != _ampInfoCatalog.
end(); ++ampIter) {
104 _ampNameIterMap.insert(std::make_pair(ampIter->getName(), ampIter));
106 if (_ampNameIterMap.size() != _ampInfoCatalog.
size()) {
107 throw LSST_EXCEPT(pexExcept::InvalidParameterError,
108 "Invalid ampInfoCatalog: not all amplifier names are unique");
112 for (CameraTransformMap::Transforms::const_iterator trIter = _transformMap.
begin();
113 trIter != _transformMap.
end(); ++trIter) {
114 if (trIter->first.hasDetectorName() && trIter->first.getDetectorName() != _name) {
115 std::ostringstream os;
116 os <<
"Invalid transformMap: " << trIter->first <<
" detector name != \"" << _name <<
"\"";
117 throw LSST_EXCEPT(pexExcept::InvalidParameterError, os.str());
std::shared_ptr< RecordT > const get(size_type i) const
Return a pointer to the record at index i.
Camera coordinate system; used as a key in in TransformMap.
std::vector< geom::Point2D > getCorners(CameraSys const &cameraSys) const
Get the corners of the detector in the specified camera coordinate system.
std::string const & _name
Geometry and electronic information about raw amplifier images.
A custom container class for records, based on std::vector.
CameraSysPrefix const PIXELS
Nominal pixels on the detector (unbinned) This ignores manufacturing imperfections, "tree ring" distortions and all other such effects.
lsst::afw::table::AmpInfoRecord const & operator[](size_t i) const
Get the amplifier specified by index.
CameraPoint transform(CameraPoint const &fromCameraPoint, CameraSys const &toSys) const
Convert a CameraPoint from one coordinate system to another.
CameraPoint getCenter(CameraSys const &cameraSys) const
Get the center of the detector in the specified camera coordinate system.
size_type size() const
Return the number of elements in the catalog.
An integer coordinate rectangle.
Describe a detector's orientation in the focal plane.
std::shared_ptr< afw::geom::XYTransform const > getTransform(CameraSys const &cameraSys) const
Get an XYTransform that transforms from cameraSys to the native system in the forward direction...
iterator end()
Iterator access.
geom::Box2I const & _bbox
CameraSys const makeCameraSys(CameraSys const &cameraSys) const
Get a coordinate system from a coordinate system (return input unchanged and untested) ...
Iterator class for CatalogT.
table::Key< std::string > name
Detector(std::string const &name, int id, DetectorType type, std::string const &serial, geom::Box2I const &bbox, lsst::afw::table::AmpInfoCatalog const &InfoCatalog, Orientation const &orientation, geom::Extent2D const &pixelSize, CameraTransformMap::Transforms const &transforms)
Make a Detector.
std::vector< Point2D > getCorners() const
Get the corner points.
CameraPoint makeCameraPoint(geom::Point2D const &point, CameraSys const &cameraSys) const
Make a CameraPoint from a point and a camera system.
bool hasTransform(CameraSys const &cameraSys) const
Does the specified camera coordinate system exist in the transform registry?
Camera coordinate system prefix.
A Point2D with associated camera coordinate system.
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.
A floating-point coordinate rectangle geometry.
iterator begin()
Iterator access.
DetectorType
Type of imaging detector.