The MegaScreen() function

The MegaScreen() function has a large number of arguments/parameters as described in the docstring below. All the parameters have sensible defaults, but it is usually necessary to change a few of the parameters to suit any particular application. Advice on how to choose these parameter values is given in later sections.

Because of the large number of arguments, it is recommended that the parameters which are changed from their defaults are changed by using the keyword=value argument convention, rather than using positional arguments, both for readability and to reduce any chance of forward/backward compatibility problems.

MegaScreen.MegaScreen(r0=7.0, L0=7000.0, windowShape=(100, 100), dx=3.5, windowOrigins=((0.0, 0.0), ), pixelSize=1.0, theta=0.0, nfftWoofer=256, nfftTweeter=256, frequencyOverlap=4.0, fractionalSupport=1.0, debug=False, numIter=None)[source]

Generate a sequence of phase screens with a Von Karman spectrum.

Parameters
  • r0 (float) – Fried parameter \(r_0\) in tweeter pixel units.

  • L0 (float) – Outer scale of turbulence in tweeter pixel units.

  • windowShape (Tuple[int,int]) – Shape of rectangular output window grid (same for all windows).

  • dx (float) – Increment in the “x” coordinate of the tweeter phase screen between subsequent calls. Represents the “frozen turbulence” windspeed in tweeter pixels/iteration. Should be > 0. See note below about coordinate directions.

  • windowOrigins (Sequence[Tuple[float,float]]) – Relative coordinates of the rectangular windows in the window coordinate system - note that this coordinate system is scaled and rotated with respect to the to the coordinate system of the “woofer” and “tweeter” screens, and hence to the “wind” direction.

  • pixelSize (float) – Size of the window pixels in tweeter pixel units (typically <= 1.0).

  • theta (float) – Angle in radians between the output window “x” axis and the tweeter screen “x” axis. Used to simulate the wind travelling in a given direction with respect to the window coordinate axes. See note below about the coordinate convention used.

  • nfftWoofer (int) – Size of the square FFT used to produce the woofer screen.

  • nfftTweeter (int) – Size of the square FFT used to produce the tweeter screen.

  • frequencyOverlap (float) – The Nyquist frequency of the woofer spectrum in units of the fundamental frequency of the tweeter spectrum.

  • fractionalSupport (float) – Frequency above which woofer spectrum is zero (the “crossover frequency”), expressed as a fraction of the woofer Nyquist frequency.

  • debug (boolean) – If true, yield additional debugging information along with phase screens.

  • numIter (Optional[int]) – Number of iterations to stop after, or None to return an infinite, non-repeating sequence of phase screens.

Yields

screen (numpy.ndarray[float]) – Wavefront perturbation at each pixel in each of the output windows, in radians. If there is only one window this is a 2-D array, otherwise an array of 2-D arrays (i.e. a 3-D array) is returned.

Notes

The convention used in the above descriptions has the “x” coordinate corresponding to the leftmost index of the 2-D phase screen arrays. This is a FORTRAN-like convention, and when the phase screen is plotted in matplotlib.imshow() and similar image plotting functions, this coordinate appears as the “y” coordinate in the image (albeit by default the “y” coordinate is plotted increasing downwards).