CircularDetector.surface_deriv¶
- CircularDetector.surface_deriv(param)[source]¶
Return the surface derivative at
param
.The derivative at parameter
phi
is given byderiv = R * radius * (-sin(phi), -cos(phi))
where R is a rotation matrix.
- Parameters:
- paramfloat or
array-like
Parameter value(s) at which to evaluate.
- paramfloat or
- Returns:
- deriv
numpy.ndarray
Array representing the derivative vector(s) at
param
. Ifparam
is a single parameter, the returned array has shape(2,)
, otherwiseparam.shape + (2,)
.
- deriv
See also
Examples
The method works with a single parameter, resulting in a single vector:
>>> part = odl.uniform_partition(-np.pi / 2, np.pi / 2, 10) >>> det = CircularDetector(part, axis=[1, 0], radius=2) >>> det.surface_deriv(0) array([ 2., 0.])
It is also vectorized, i.e., it can be called with multiple parameters at once (or an n-dimensional array of parameters):
>>> np.round(det.surface_deriv([-np.pi / 2, 0, np.pi / 2]), 10) array([[ 0., 2.], [ 2., 0.], [ 0., -2.]])
>>> det.surface_deriv(np.zeros((4, 5))).shape (4, 5, 2)