Flat1dDetector.surface¶
-
Flat1dDetector.
surface
(self, param)[source]¶ Return the detector surface point corresponding to
param
.For parameter value
p
, the surface point is given bysurf = p * axis
- Parameters
- paramfloat or
array-like
Parameter value(s) at which to evaluate.
- paramfloat or
- Returns
- point
numpy.ndarray
Vector(s) pointing from the origin to the detector surface point at
param
. Ifparam
is a single parameter, the returned array has shape(2,)
, otherwiseparam.shape + (2,)
.
- point
Examples
The method works with a single parameter, resulting in a single vector:
>>> part = odl.uniform_partition(0, 1, 10) >>> det = Flat1dDetector(part, axis=[1, 0]) >>> det.surface(0) array([ 0., 0.]) >>> det.surface(1) array([ 1., 0.])
It is also vectorized, i.e., it can be called with multiple parameters at once (or an n-dimensional array of parameters):
>>> det.surface([0, 1]) array([[ 0., 0.], [ 1., 0.]]) >>> det.surface(np.zeros((4, 5))).shape (4, 5, 2)