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:
- space
LinearSpace
Space from which to derive the array data type and size.
- space
- Returns:
- noise_array
numpy.ndarray
element Array with white noise such that
space.element
's can be created from it.
- noise_array
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
andLinearSpaceElement.examples
.Examples
Create single noise array:
>>> space = odl.rn(3) >>> array = noise_array(space)