InfiniteAtmosphericLayer

class hcipy.atmosphere.InfiniteAtmosphericLayer(input_grid, Cn_squared, L0=inf, velocity=0, height=0, stencil_length=2, use_interpolation=True, seed=None)

Bases: AtmosphericLayer

An atmospheric layer that can be infinitely extended in any direction.

This is an implementation of [Assemat2006]. Contrary to the FiniteAtmosphericLayer class, this atmospheric layer uses an autoregressive model for extending the phase screen by one column or row in any direction. Each new row/column is based on a stencil, which contains the last few rows/columns in addition to a few pixels spread out more into the phase screen to capture the low-order aberrations.

[Assemat2006]

François Assémat, Richard W. Wilson, and Eric Gendron, “Method for simulating infinitely long and non stationary phase screens with optimized memory storage,” Opt. Express 14, 988-999 (2006)

Note

This algorithm does not work well with large outer scales. This is an inherent flaw in the algorithm and so cannot be avoided easily. It requires extremely large-scale correlations to be included in the correlation matrices. These correlation matrices are inverted by the algorithm, leading to ill-defined inversions.

Parameters:
input_gridGrid

The grid on which the incoming wavefront is defined.

Cn_squaredscalar

The integrated strength of the turbulence for this layer.

L0scalar

The outer scale for the atmospheric turbulence of this layer. The default is infinity.

velocityscalar or array_like

The wind speed for this atmospheric layer. If this is a scalar, the wind will be along x. If this is a 2D array, then the values are interpreted as the wind speed along x and y. The default is zero.

heightscalar

The height of the atmospheric layer. By itself, this value has no influence, but it’ll be used by the AtmosphericModel to perform inter-layer propagations.

stencil_lengthinteger

The number of columns/rows to use for the extrapolation of the phase along a column/row. Additionally, the stencil will contain one more pixel a little away from these initial columns/rows. Note, do not modify this parameter unless you know what you are doing. This parameter can be unintuitive. The default value of 2 is usually sufficient in most instances.

use_interpolationboolean

whether to use sub-pixel interpolation of the phase screen. Bilinear interpolation is used. Without interpolation, for short integration times or fast loop speeds, the phase screen may stay on the same pixel for multiple frames. With interpolation, these discrete pixel transitions are smoothed out. The default is True.

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.

Raises:
ValueError

When the input grid is not cartesian, regularly spaced and two-dimensional.

Attributes Summary

Cn_squared

The integrated strength of the turbulence for this layer.

L0

The outer scale of the turbulence for this layer.

outer_scale

The outer scale of the turbulence for this layer.

Methods Summary

evolve_until(t)

Evolve the atmospheric layer until a certain time.

phase_for(wavelength)

Compute the phase at a certain wavelength.

reset([make_independent_realization])

Reset the atmospheric layer to t=0.

Attributes Documentation

Cn_squared

The integrated strength of the turbulence for this layer.

L0

The outer scale of the turbulence for this layer.

outer_scale

The outer scale of the turbulence for this layer.

Methods Documentation

evolve_until(t)

Evolve the atmospheric layer until a certain time.

Note

Backwards evolution is not allowed. The information about previous parts of the phase screen are inherently lost. If you want to replay the same atmospheric noise again, please use reset() to reset the layer to its starting position.

Parameters:
tscalar

The new time to evolve the phase screen to. This should be larger or equal to the current time of the atmospheric layer.

Raises:
ValueError

When the time t is smaller than the current time of the layer.

phase_for(wavelength)

Compute the phase at a certain wavelength.

Parameters:
wavelengthscalar

The wavelength of the light for which to compute the phase screen.

Returns:
Field

The computed phase screen.

reset(make_independent_realization=False)

Reset the atmospheric layer to t=0.

Parameters:
make_independent_realizationboolean

Whether to start an independent realization of the noise for the atmospheric layer or not. When this is False, the exact same phase screens will be generated as in the first run, as long as the Cn^2 and outer scale are the same. This allows for testing of multiple runs of a control system with different control parameters. When this is True, an independent realization of the atmospheric layer will be generated. This is useful for Monte-Carlo-style computations. The default is False.