noise_element

odl.core.util.testutils.noise_element(space)[source]

Create a white noise element in space.

The element contains white noise with standard deviation 1 in the case of floating point dtypes and uniformly spaced values between -10 and 10 in the case of integer dtypes.

For product spaces the method is called recursively for all sub-spaces.

Notes

This method is intended for internal testing purposes. For more explicit example elements see odl.core.phantoms and LinearSpaceElement.examples.

Parameters

spaceLinearSpace

Space in which to create an element. The odl.core.set.space.LinearSpace.element method of the space needs to accept input of numpy.ndarray type.

Returns

noise_element : space element

Examples

Create single noise element:

>>> space = odl.rn(3)
>>> vector = noise_element(space)

See Also

noise_array noise_elements odl.core.set.space.LinearSpace.examples : Examples of elements typical

to the space.