noise_array

odl.core.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.

Notes

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

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.

Examples

Create single noise array:

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

See Also

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

typical to the space.