Skip to content

Commit fc1ec24

Browse files
author
Mika Pflüger
committed
tests more useful
1 parent 03f6063 commit fc1ec24

File tree

2 files changed

+14
-15
lines changed

2 files changed

+14
-15
lines changed

mm_numba.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -601,7 +601,8 @@ def prepared_fields_at_positions(evaluation_positions, rs, ts, k_z, Z):
601601
#print('ang_deg')
602602
#for _i in _ang_deg:
603603
# print(_i)
604-
_f = fields(_n, _wl, _ang, _thick, _rough)
604+
_r, _t = reflec_and_trans(_n, _wl, _ang, _thick, _rough)
605+
#_f = fields(_n, _wl, _ang, _thick, _rough)
605606
#_ar = np.abs(_r)**2
606607
#_at = np.abs(_t)**2
607608
#print('# ang_deg abs(r)**2 abs(t)**2 r.real r.imag t.real t.imag')

mm_pure_python.py

+12-14
Original file line numberDiff line numberDiff line change
@@ -131,17 +131,15 @@ def reflec_and_trans(n, lam, thetas, thick, rough):
131131

132132

133133
if __name__ == '__main__':
134-
n_layers = 101
135-
n = np.array([1] + [1-1e-5+1e-6j, 1-2e-5+2e-6j]*((n_layers-1)//2))
136-
thick = np.array([.1]*(n_layers-2))
137-
rough = np.array([.02]*(n_layers-1))
138-
wl = 0.15
139-
ang_deg = np.linspace(0.1, 2., 1001)
140-
ang = np.deg2rad(ang_deg)
141-
r, t = reflec_and_trans(n, wl, ang, thick, rough)
142-
print('r')
143-
for i in r:
144-
print(abs(i**2))
145-
print('t')
146-
for i in t:
147-
print(abs(i**2))
134+
_n_layers = 1001
135+
_n = np.array([1] + [1-1e-5+1e-6j, 1-2e-5+2e-6j]*int((_n_layers-1)/2))
136+
_thick = np.array([.1]*(_n_layers-2))
137+
_rough = np.array([.02]*(_n_layers-1))
138+
_wl = 0.15
139+
_ang_deg = np.linspace(0.1, 2., 10001)
140+
_ang = np.deg2rad(_ang_deg)
141+
#print('ang_deg')
142+
#for _i in _ang_deg:
143+
# print(_i)
144+
_r, _t = reflec_and_trans(_n, _wl, _ang, _thick, _rough)
145+

0 commit comments

Comments
 (0)