Skip to content

Structure Function and Validation Routine

3beckjr edited this page Feb 1, 2017 · 3 revisions

WavePy possesses a both a function for generating a Kolmogorov structure function based upon generated phase screens with user defined qualities and a function for validating the structure function's accuracy. Both are relatively easy to implement. Sample code for using the structure function for a default WavePy instance is as follows:

import wavepy as wavepy
import numpy as np

test = wavepy.wavepy()
#Using the SetCn2Rytov function here can be useful for setting the 
#turbulence strength parameter when generating a structure function

phz_hi = test.PhaseScreen()
phz_lo = test.SubHarmonicComp(5)
phz = phz_lo + phz_lo

test.StructFunc(phz)

Using the Validate function is easier as it generates the phase screens for you. Sample code for this is as follows:

import wavepy as wavepy
import numpy as np

test = wavepy.wavepy()

#The 5 is simply a parameter to define how many 
#phase screens you would like to average together
test.Validate(5)

Matplotlib's imshow/plot commands can be used to display the outputs of both of these functions.

Clone this wiki locally