-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path2022_08_25_relay_chromatic_shift.py
More file actions
82 lines (70 loc) · 2.27 KB
/
Copy path2022_08_25_relay_chromatic_shift.py
File metadata and controls
82 lines (70 loc) · 2.27 KB
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
"""
Test chromatic shift for relay consisting of
ACT508-100-B
at 532nm and 785nm
"""
import matplotlib.pyplot as plt
import numpy as np
import raytrace.raytrace as rt
from raytrace.materials import Vacuum, Nlak22, Nsf6, Nsf6ht
w1 = 0.785 # um
w2 = 0.532
nrays = 101 # must be odd
offset = 5
radius = 25.4
beam_rad = 5
# AC508-100-B-ML
# N-LAK22/N-SF6HT
t100c = 13.0
r100c = 65.8
r100i = -56.
t100f = 2.0
r100f = -280.6
wd100 = 88.7
bfl100 = 91.5
efl100 = 100
# AC508-180-AB-ML
# N-LAK22/N-SF6
t180c = 9.5
r180c = 144.4
r180i = -115.4
t180f = 4.0
r180f = -328.2
wd180 = 170.6
bfl180 = 173.52
efl180 = 180
z180 = 10
# z100 = (t180c + t180f) + bfl180 + 100
z100 = z180 + (t180c + t180f) + 264.85
zend = z100 + 30
system = rt.System([# AC508-180-AB-ML. Infinity focus to the left
rt.SphericalSurface.get_on_axis(r180c, z180, radius),
rt.SphericalSurface.get_on_axis(r180i, z180 + t180c, radius),
rt.SphericalSurface.get_on_axis(r180f, z180 + t180c + t180f, radius),
# AC508-100-B-ML. Infinity focus to the right
rt.SphericalSurface.get_on_axis(-r100f, z100, radius),
rt.SphericalSurface.get_on_axis(-r100i, z100 + t100f, radius),
rt.SphericalSurface.get_on_axis(-r100c, z100 + t100f + t100c, radius),
# final focal plane
rt.FlatSurface([0, 0, zend], [0, 0, 1], radius)
],
[Nlak22(), Nsf6(), Vacuum(), #AC508-180-AB-ML
Nsf6ht(), Nlak22(), Vacuum(), #AC508-100-B-ML
]
)
# do ray tracing
rays1 = rt.get_collimated_rays([0, 0, 0], beam_rad, nrays, w1)
rays2 = rt.get_collimated_rays([0, 0, 0], beam_rad, nrays, w2)
rays1 = system.ray_trace(rays1, Vacuum(), Vacuum())
rays2 = system.ray_trace(rays2, Vacuum(), Vacuum())
figh, ax = system.plot(rays1, colors="r", label=f"{w1 * 1e3:.1f}nm", figsize=(16, 8))
system.plot(rays2, colors="g", label=f"{w2 * 1e3:.1f}nm", ax=ax)
ax.legend()
plt.show()
figh = plt.figure()
ax = figh.add_subplot(1, 1, 1)
ax.plot(rays1[-2, :, 0], np.arctan2(rays1[-2, :, 3], rays1[-2, :, 5]) * 180/np.pi, '-x', label=f"{w1 * 1e3:.1f}nm")
ax.plot(rays2[-2, :, 0], np.arctan2(rays2[-2, :, 3], rays2[-2, :, 5]) * 180/np.pi, '-x', label=f"{w2 * 1e3:.1f}nm")
ax.set_xlabel("height (mm)")
ax.set_ylabel("angle(deg)")
ax.legend()