-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsampling.py
executable file
·49 lines (38 loc) · 1.01 KB
/
sampling.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Jan 10 15:27:46 2021
@author: vganapati
"""
from propagators import create_plane_wave
from functions import plot
# units are microns
dx = 0.3
dy = 0.3
Lx_max = 100
Ly_max = 100
wavelength = 0.6
extent = [-Lx_max, Lx_max-dx, -Ly_max, Ly_max-dy]
alpha_max = wavelength/(2*dx)
beta_max = wavelength/(2*dy)
# No aliasing
alpha = alpha_max*1
beta = 0
plane_wave = create_plane_wave(dx, dy,
Lx_max, Ly_max,
alpha, beta, wavelength)
# Aliasing example 1
plot(plane_wave, extent)
alpha = alpha_max*2
beta = 0
plane_wave = create_plane_wave(dx, dy,
Lx_max, Ly_max,
alpha, beta, wavelength)
plot(plane_wave, extent)
# Aliasing example 2
alpha = alpha_max*7
beta = 0
plane_wave = create_plane_wave(dx, dy,
Lx_max, Ly_max,
alpha, beta, wavelength)
plot(plane_wave, extent)