29 namespace cameraGeom {
40 _ampInfoCatalog(ampInfoCatalog),
42 _orientation(orientation),
43 _pixelSize(pixelSize),
45 _transformMap(_nativeSys, transforms) {
51 return _transformMap.
transform(fromVec, _nativeSys, cameraSys);
71 i = _ampInfoCatalog.
size() + i;
73 return _ampInfoCatalog.
get(i);
77 _AmpInfoMap::const_iterator ampIter = _ampNameIterMap.find(name);
78 if (ampIter == _ampNameIterMap.end()) {
79 std::ostringstream os;
80 os <<
"Unknown amplifier \"" << name <<
"\"";
81 throw LSST_EXCEPT(pexExcept::InvalidParameterError, os.str());
83 return ampIter->second;
92 template <
typename FromSysT,
typename ToSysT>
94 ToSysT
const &toSys)
const {
98 void Detector::_init() {
101 ampIter != _ampInfoCatalog.
end(); ++ampIter) {
102 _ampNameIterMap.insert(std::make_pair(ampIter->getName(), ampIter));
104 if (_ampNameIterMap.size() != _ampInfoCatalog.
size()) {
105 throw LSST_EXCEPT(pexExcept::InvalidParameterError,
106 "Invalid ampInfoCatalog: not all amplifier names are unique");
110 for (CameraSys sys : _transformMap) {
111 if (sys.hasDetectorName() && sys.getDetectorName() != _name) {
112 std::ostringstream os;
113 os <<
"Invalid transformMap: " << sys <<
" detector name != \"" << _name <<
"\"";
114 throw LSST_EXCEPT(pexExcept::InvalidParameterError, os.str());
122 #define INSTANTIATE(FROMSYS, TOSYS) \
123 template std::shared_ptr<geom::TransformPoint2ToPoint2> Detector::getTransform(FROMSYS const &, \
124 TOSYS const &) const;
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< 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.
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
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
Can this object convert between PIXELS and the specified camera coordinate system?
Camera coordinate system prefix.
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, TransformMap::Transforms const &transforms)
Make a Detector.
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.
#define INSTANTIATE(FROMSYS, TOSYS)