LSSTApplications  10.0+286,10.0+36,10.0+46,10.0-2-g4f67435,10.1+152,10.1+37,11.0,11.0+1,11.0-1-g47edd16,11.0-1-g60db491,11.0-1-g7418c06,11.0-2-g04d2804,11.0-2-g68503cd,11.0-2-g818369d,11.0-2-gb8b8ce7
LSSTDataManagementBasePackage
Public Member Functions | Private Attributes | List of all members
lsst::afw::cameraGeom::Orientation Class Reference

#include <Orientation.h>

Public Member Functions

 Orientation (geom::Point2D const fpPosition=geom::Point2D(0, 0), geom::Point2D const refPoint=geom::Point2D(-0.5,-0.5), geom::Angle const yaw=geom::Angle(0), geom::Angle const pitch=geom::Angle(0), geom::Angle const roll=geom::Angle(0))
 
geom::Point2D getFpPosition () const
 Return focal plane position of detector reference point (mm) More...
 
geom::Point2D getReferencePoint () const
 Return detector reference point (pixels) More...
 
geom::Angle getYaw () const
 Return the yaw angle. More...
 
lsst::afw::geom::Angle getPitch () const
 Return the pitch angle. More...
 
geom::Angle getRoll () const
 Return the roll angle. More...
 
int getNQuarter () const
 Return the number of quarter turns (rounded to the closest quarter) More...
 
geom::AffineXYTransform makePixelFpTransform (geom::Extent2D const pixelSizeMm) const
 Generate an XYTransform from pixel to focal plane coordinates. More...
 
geom::AffineXYTransform makeFpPixelTransform (geom::Extent2D const pixelSizeMm) const
 Generate an XYTransform from focal plane to pixel coordinates. More...
 

Private Attributes

geom::Point2D _fpPosition
 focal plane position of reference point on detector More...
 
geom::Point2D _refPoint
 reference point on detector More...
 
lsst::afw::geom::Angle _yaw
 yaw More...
 
lsst::afw::geom::Angle _pitch
 pitch More...
 
lsst::afw::geom::Angle _roll
 roll More...
 
Eigen::Matrix< double,
2, 2, Eigen::DontAlign > 
_rotMat
 

Detailed Description

Describe a detector's orientation in the focal plane

All rotations are about the reference point on the detector. Rotations are intrinsic, meaning each rotation is applied in the coordinates system produced by the previous rotation. Rotations are applied in this order: yaw (Z), pitch (Y'), and roll (X'').

Warning
: default refPoint is -0.5, -0.5 (the lower left corner of a detector). This means that the default-constructed Orientation is not a unity transform, but instead includes a 1/2 pixel shift.

Definition at line 53 of file Orientation.h.

Constructor & Destructor Documentation

lsst::afw::cameraGeom::Orientation::Orientation ( geom::Point2D const  fpPosition = geom::Point2D(0, 0),
geom::Point2D const  refPoint = geom::Point2D(-0.5, -0.5),
geom::Angle const  yaw = geom::Angle(0),
geom::Angle const  pitch = geom::Angle(0),
geom::Angle const  roll = geom::Angle(0) 
)
explicit
Parameters
fpPositionFocal plane position of detector reference point (mm)
refPointReference point on detector (pixels). Offset is measured to this point and all all rotations are about this point. The default value (-0.5, -0.5) is the lower left corner of the detector.
yawyaw: rotation about Z (X to Y), 1st rotation
pitchpitch: rotation about Y' (Z'=Z to X'), 2nd rotation
rollroll: rotation about X'' (Y''=Y' to Z''), 3rd rotation

Definition at line 29 of file Orientation.cc.

35  :
36  _fpPosition(fpPosition),
37  _refPoint(refPoint),
38  _yaw(yaw),
39  _pitch(pitch),
40  _roll(roll),
41  _rotMat()
42  {
43  double cosYaw = std::cos(_yaw);
44  double sinYaw = std::sin(_yaw);
45  double cosPitch = std::cos(_pitch);
46  double sinPitch = std::sin(_pitch);
47  double cosRoll = std::cos(_roll);
48  double sinRoll = std::sin(_roll);
49 
50  // This comes from the rotation matrix written down here:
51  // http://en.wikipedia.org/wiki/Euler_angles
52  // for Tait-Bryan angles Z_1Y_2X_3
53  // _rotMat = coeffA coeffB
54  // coeffD coeffE
55  _rotMat << cosYaw*cosPitch, cosYaw*sinPitch*sinRoll - cosRoll*sinYaw,
56  cosPitch*sinYaw, cosYaw*cosRoll + sinYaw*sinPitch*sinRoll;
57 
58  }
lsst::afw::geom::Angle _pitch
pitch
Definition: Orientation.h:108
lsst::afw::geom::Angle _roll
roll
Definition: Orientation.h:109
lsst::afw::geom::Angle _yaw
yaw
Definition: Orientation.h:107
geom::Point2D _refPoint
reference point on detector
Definition: Orientation.h:105
geom::Point2D _fpPosition
focal plane position of reference point on detector
Definition: Orientation.h:104
Eigen::Matrix< double, 2, 2, Eigen::DontAlign > _rotMat
Definition: Orientation.h:113

Member Function Documentation

geom::Point2D lsst::afw::cameraGeom::Orientation::getFpPosition ( ) const
inline

Return focal plane position of detector reference point (mm)

Definition at line 68 of file Orientation.h.

68 { return _fpPosition; }
geom::Point2D _fpPosition
focal plane position of reference point on detector
Definition: Orientation.h:104
int lsst::afw::cameraGeom::Orientation::getNQuarter ( ) const

Return the number of quarter turns (rounded to the closest quarter)

Definition at line 61 of file Orientation.cc.

61  {
62  float yawDeg = _yaw.asDegrees();
63  while (yawDeg < 0.) {
64  yawDeg += 360.;
65  }
66  return std::floor((yawDeg + 45.)/90.);
67  }
double asDegrees() const
Definition: Angle.h:124
lsst::afw::geom::Angle _yaw
yaw
Definition: Orientation.h:107
Extent< int, N > floor(Extent< double, N > const &input)
lsst::afw::geom::Angle lsst::afw::cameraGeom::Orientation::getPitch ( ) const
inline

Return the pitch angle.

Definition at line 77 of file Orientation.h.

77 { return _pitch; }
lsst::afw::geom::Angle _pitch
pitch
Definition: Orientation.h:108
geom::Point2D lsst::afw::cameraGeom::Orientation::getReferencePoint ( ) const
inline

Return detector reference point (pixels)

Definition at line 71 of file Orientation.h.

71 { return _refPoint; }
geom::Point2D _refPoint
reference point on detector
Definition: Orientation.h:105
geom::Angle lsst::afw::cameraGeom::Orientation::getRoll ( ) const
inline

Return the roll angle.

Definition at line 80 of file Orientation.h.

80 { return _roll; }
lsst::afw::geom::Angle _roll
roll
Definition: Orientation.h:109
geom::Angle lsst::afw::cameraGeom::Orientation::getYaw ( ) const
inline

Return the yaw angle.

Definition at line 74 of file Orientation.h.

74 { return _yaw; }
lsst::afw::geom::Angle _yaw
yaw
Definition: Orientation.h:107
geom::AffineXYTransform lsst::afw::cameraGeom::Orientation::makeFpPixelTransform ( geom::Extent2D const  pixelSizeMm) const

Generate an XYTransform from focal plane to pixel coordinates.

Returns
lsst::afw::geom::AffineXYTransform from focal plane to pixel coordinates
Parameters
pixelSizeMmSize of the pixel in mm in X and Y

Definition at line 84 of file Orientation.cc.

86  {
87  return geom::AffineXYTransform(makePixelFpTransform(pixelSizeMm).getReverseTransform());
88  }
geom::AffineXYTransform makePixelFpTransform(geom::Extent2D const pixelSizeMm) const
Generate an XYTransform from pixel to focal plane coordinates.
Definition: Orientation.cc:69
Wrap an AffineTransform.
Definition: XYTransform.h:152
geom::AffineXYTransform lsst::afw::cameraGeom::Orientation::makePixelFpTransform ( geom::Extent2D const  pixelSizeMm) const

Generate an XYTransform from pixel to focal plane coordinates.

Returns
lsst::afw::geom::AffineXYTransform from pixel to focal plane coordinates
Parameters
pixelSizeMmSize of the pixel in mm in X and Y

Definition at line 69 of file Orientation.cc.

71  {
72  // jacobian = coeffA*pixelSizeMmX, coeffB*pixelSizeMmY,
73  // coeffD*pixelSizeMmX, coeffE*pixelSizeMmY
74  Eigen::Matrix2d jacobian = _rotMat.array() \
75  * (Eigen::Vector2d::Ones() * pixelSizeMm.asEigen().transpose()).array();
76 
77  Eigen::Vector2d refMm = pixelSizeMm.asEigen().array() * _refPoint.asEigen().array();
78  Eigen::Vector2d translation = _fpPosition.asEigen() - (_rotMat * refMm);
79 
80  geom::AffineTransform affineTransform = geom::AffineTransform(jacobian, translation);
81  return geom::AffineXYTransform(affineTransform);
82  }
An affine coordinate transformation consisting of a linear transformation and an offset.
geom::Point2D _refPoint
reference point on detector
Definition: Orientation.h:105
EigenVector const & asEigen() const
Return a fixed-size Eigen representation of the coordinate object.
geom::Point2D _fpPosition
focal plane position of reference point on detector
Definition: Orientation.h:104
Wrap an AffineTransform.
Definition: XYTransform.h:152
Eigen::Matrix< double, 2, 2, Eigen::DontAlign > _rotMat
Definition: Orientation.h:113

Member Data Documentation

geom::Point2D lsst::afw::cameraGeom::Orientation::_fpPosition
private

focal plane position of reference point on detector

Definition at line 104 of file Orientation.h.

lsst::afw::geom::Angle lsst::afw::cameraGeom::Orientation::_pitch
private

pitch

Definition at line 108 of file Orientation.h.

geom::Point2D lsst::afw::cameraGeom::Orientation::_refPoint
private

reference point on detector

Definition at line 105 of file Orientation.h.

lsst::afw::geom::Angle lsst::afw::cameraGeom::Orientation::_roll
private

roll

Definition at line 109 of file Orientation.h.

Eigen::Matrix<double,2,2,Eigen::DontAlign> lsst::afw::cameraGeom::Orientation::_rotMat
private

Definition at line 113 of file Orientation.h.

lsst::afw::geom::Angle lsst::afw::cameraGeom::Orientation::_yaw
private

yaw

Definition at line 107 of file Orientation.h.


The documentation for this class was generated from the following files: