Skip to content

Commit

Permalink
Stop using Detector.transform
Browse files Browse the repository at this point in the history
and update for Detector.getCenter returning a Point2D
isntead of a CameraPoint
  • Loading branch information
r-owen committed Feb 25, 2018
1 parent 96763ef commit eda09ef
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/shimCameraGeom.cc
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ afw::geom::LinearTransform makeScalingMmToPx(afw::geom::Extent2D const pSize) {

afw::geom::Point2D getCenterInFpPixels(CONST_PTR(afw::cameraGeom::Detector) det) {
auto scaling = makeScalingMmToPx(det->getPixelSize());
return scaling(det->getCenter(afw::cameraGeom::FOCAL_PLANE).getPoint());
return scaling(det->getCenter(afw::cameraGeom::FOCAL_PLANE));
}

afw::geom::Point2D getCenterInDetectorPixels(CONST_PTR(afw::cameraGeom::Detector) det) {
auto center = det->getCenter(afw::cameraGeom::PIXELS).getPoint();
auto center = det->getCenter(afw::cameraGeom::PIXELS);
if ((getNQuarter(det)%2) != 0) {
return afw::geom::Point2D(center.getY(), center.getX());
} else {
Expand All @@ -54,11 +54,9 @@ int getHeight(CONST_PTR(afw::cameraGeom::Detector) det) {
}

afw::geom::Point2D detPxToFpPx(CONST_PTR(afw::cameraGeom::Detector) det, afw::geom::Point2D const detPt) {
afw::geom::Point2D point;
point = detPt;
auto scaling = makeScalingMmToPx(det->getPixelSize());
return scaling(det->transform(det->makeCameraPoint(point, afw::cameraGeom::PIXELS),
afw::cameraGeom::FOCAL_PLANE).getPoint());
auto pixelsToFocalPlane = det->getTransform(afw::cameraGeom::PIXELS, afw::cameraGeom::FOCAL_PLANE);
return scaling(pixelsToFocalPlane.applyForward(detPt));
}

afw::geom::Point2D detPxToFpPxRot(CONST_PTR(afw::cameraGeom::Detector) det, afw::geom::Point2D const detPt) {
Expand Down

0 comments on commit eda09ef

Please sign in to comment.