-
Notifications
You must be signed in to change notification settings - Fork 5
Source Generation
WavePy currently supports three types source generation for use within WavePy and external applications. The three types of sources are as follows: A Gaussian Beam, a point source/spherical source, and a plane wave. The following page will detail the instantiation, use, and parameters of each source type.
For the purpose of this demonstration wavepy is imported as such:
import wavepySpherical Source
This first example uses a spherical source, with necessary defined variables. This case uses a default instance of WavePy and parameters can be changed in a similar manner to the propagation test cases contained elsewhere in this wiki.
#Similar to the default case propagation example.
import matplotlib.pyplot as plt
SphereExample = wavepy.wavepy()
SphereExample.Source = wavepy.PointSource()
plt.imshow(np.abs(SphereExample.Source)**2)The above code generates a spherical point source with a resolution of 256x256, a radius of curvature equivalent to the propagation distance, and a central lobe width defined with respect to the wavelength, DROI, and propagation distance. Below is the graphical output of the source using the matplotlib utility.
Plane Wave
This example generates a Plane wave and uses a similar method of instantiation to the previous example.
import matplotlib.pyplot as plt
PlaneExample = wavepy.wavepy()
PlaneExample.Source = PlaneExample.PlaneSource()
plt.imshow(np.abs(PlaneExample.Source)**2)The above example generates a plane wave with a resolution of 256x256 with an amplitude of 1. Below is the graphical output which, unsurprisingly is fairly boring as it is a uniform plane wave...
Gaussian Beam
This example generates a Gaussian beam and again it uses the same method of instantiation as the other two examples.
import matplotlib.pyplot as plt
GausExample = wavepy.wavepy()
GausExample.Source = GausExample.CollimatedGaussian()
plt.imshow(np.abs(GausExample.Source)**2)The above example generates a gaussian beam with a resolution of 256x256 and uses a standard exponential gaussian equation. Below is the graphical output which is slightly more exciting than the plane wave.


