SpectralNoiseFactoryFFT

class hcipy.util.SpectralNoiseFactoryFFT(psd, output_grid, oversample=1)

Bases: SpectralNoiseFactory

A spectral noise factory based on FFTs.

The use of FFTs means that these spectral noises will wrap at the edge of the grid, i.e. they are continuous from one side of the grid to the other end. This means that the lowest frequencies of the PSD are not well represented and diminished in amplitude. The sampled spatial frequencies can be extended by increasing the oversample parameter at the cost of memory usage and computation time.

See SpectralNoiseFactoryMultiscale for an alternative if this wrapping should be avoided at only a minor computational cost.

Parameters:
psdField generator

The power spectral density of the noise.

output_gridGrid

The grid on which to compute the noise.

oversampleinteger

The amount by which to oversample to grid. For values higher than one, the spectral noise can be shifted by that fraction of the grid extent without wrapping.

Methods Summary

make_random([seed])

Make a single realization of the spectral noise.

Methods Documentation

make_random(seed=None)

Make a single realization of the spectral noise.

Parameters:
seedNone, int, array of ints, SeedSequence, BitGenerator, Generator

A seed to initialize the spectral noise. If None, then fresh, unpredictable entry will be pulled from the OS. If an int or array of ints, then it will be passed to a numpy.SeedSequency to derive the initial BitGenerator state. If a BitGenerator or Generator are passed, these will be wrapped and used instead. Default: None.

Returns:
SpectralNoiseFFT

A realization of the spectral noise, that can be shifted and evaluated.