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.ndarrayelement Array with white noise such that
space.element's can be created from it.
- noise_array
See also
noise_elementnoise_elementsodl.set.space.LinearSpace.examplesExamples of elements typical to the space.
Notes
This method is intended for internal testing purposes. For more explicit example elements see
odl.phantomsandLinearSpaceElement.examples.Examples
Create single noise array:
>>> space = odl.rn(3) >>> array = noise_array(space)