noise_array

odl.util.testutils.noise_array(space)[source]

Generate a white noise array that is compatible with space.

The array 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.

Parameters
spaceLinearSpace

Space from which to derive the array data type and size.

Returns
noise_arraynumpy.ndarray element

Array with white noise such that space.element’s can be created from it.

See also

noise_element
noise_elements
odl.set.space.LinearSpace.examples

Examples of elements typical to the space.

Notes

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

Examples

Create single noise array:

>>> space = odl.rn(3)
>>> array = noise_array(space)