CircularDetector.surface_measure

CircularDetector.surface_measure(self, param)[source]

Return the arc length measure at param.

This is a constant function evaluating to radius everywhere.

Parameters
paramfloat or array-like

Parameter value(s) at which to evaluate.

Returns
measurefloat or numpy.ndarray

Constant value(s) of the arc length measure at param. If param is a single parameter, a float is returned, otherwise an array of shape param.shape.

Examples

The method works with a single parameter, resulting in a float:

>>> part = odl.uniform_partition(-np.pi / 2, np.pi / 2, 10)
>>> det = CircularDetector(part, axis=[1, 0], radius=2)
>>> det.surface_measure(0)
2.0
>>> det.surface_measure(np.pi / 2)
2.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_measure([0, np.pi / 2])
array([ 2.,  2.])
>>> det.surface_measure(np.zeros((4, 5))).shape
(4, 5)