Parallel2dGeometry.det_axis¶
- Parallel2dGeometry.det_axis(angle)[source]¶
Return the detector axis (axes) at
angle
.- Parameters:
- anglefloat or
array-like
Angle(s) in radians describing the counter-clockwise rotation of the detector.
- anglefloat or
- Returns:
- axis
numpy.ndarray
Unit vector(s) along which the detector is aligned. If
angle
is a single parameter, the returned array has shape(2,)
, otherwiseangle.shape + (2,)
.
- axis
Examples
Calling the method with a single angle produces a single vector:
>>> apart = odl.uniform_partition(0, np.pi, 10) >>> dpart = odl.uniform_partition(-1, 1, 20) >>> geom = Parallel2dGeometry(apart, dpart) >>> geom.det_axis(0) array([ 1., 0.]) >>> np.allclose(geom.det_axis(np.pi / 2), [0, 1]) True
The method is vectorized, i.e., it can be called with multiple angles at once (or n-dimensional arrays of parameters):
>>> np.allclose(geom.det_axis([0, np.pi / 2]), [[1, 0], ... [0, 1]]) True >>> geom.det_axis(np.zeros((4, 5))).shape (4, 5, 2)