1 '''Defines the BeamSplitter class for theia.'''
2
3
4
5
6
7
8 import numpy as np
9 from ..helpers import settings, geometry
10 from ..helpers.units import deg, cm, pi
11 from .optic import Optic
12
14 '''
15
16 Beamsplitter class.
17
18 This class represents beam splitters composed of two faces (HR, AR)
19 and with a wedge angle. These are the objects with which the beams will
20 interact during the ray tracing. Please see the documentation for details
21 on the geometric construction of these optics.
22
23 Beam Splitters behave exactly like mirrors, except that:
24 * The default values for transmittances and reflectivities are different
25 * Beam splitters never increase the order upon interaction of beams.
26
27 Actions:
28 * T on HR: 0
29 * R on HR: 0
30 * T on AR: 0
31 * R on AR: 0
32
33 *=== Additional attributes with respect to the Optic class ===*
34
35 None
36
37 *=== Name ===*
38
39 BeamSplitter
40
41 **Note**: the curvature of any surface is positive for a concave surface
42 (coating inside the sphere).
43 Thus kurv*HRNorm/|kurv| always points to the center
44 of the sphere of the surface, as is the convention for the lineSurfInter of
45 geometry module. Same for AR.
46
47 ******* HRK > 0 and ARK > 0 ******* HRK > 0 and ARK < 0
48 ***** ******** and |ARK| > |HRK|
49 H***A H*********A
50 ***** ********
51 ******* *******
52
53 '''
54
55 Name = "BeamSplitter"
56 - def __init__(self, Wedge = 0., Alpha = 0., X = 0., Y = 0., Z = 0.,
57 Theta = pi/2., Phi = 0., Diameter = 10.e-2,
58 HRr = .5, HRt = .5, ARr = .1, ARt = .9,
59 HRK = 0., ARK = 0, Thickness = 2.e-2,
60 N = 1.4585, KeepI = False, Ref = None):
61 '''BeamSplitter initializer.
62
63 Parameters are the attributes.
64
65 Returns a beam splitter.
66
67 '''
68
69
70 TonHR = 0
71 RonHR = 0
72 TonAR = 0
73 RonAR = 0
74
75
76 N = float(N)
77 Wedge = float(Wedge)
78 Alpha = float(Alpha)
79 Theta = float(Theta)
80 Phi = float(Phi)
81 Diameter = float(Diameter)
82 Thickness = float(Thickness)
83 HRK = float(HRK)
84 ARK = float(ARK)
85 HRt = float(HRt)
86 HRr = float(HRr)
87 ARt = float(ARt)
88 ARr = float(ARr)
89
90
91 HRNorm = np.array([np.sin(Theta)*np.cos(Phi),
92 np.sin(Theta) * np.sin(Phi),
93 np.cos(Theta)], dtype = np.float64)
94
95 HRCenter = np.array([X, Y, Z], dtype = np.float64)
96
97
98 ARCenter = HRCenter\
99 - (Thickness + .5 * np.tan(Wedge) * Diameter) * HRNorm
100
101 a,b = geometry.basis(HRNorm)
102 ARNorm = -np.cos(Wedge) * HRNorm\
103 + np.sin(Wedge) * (np.cos(Alpha) * a\
104 + np.sin(Alpha) * b)
105
106 super(BeamSplitter, self).__init__(ARCenter = ARCenter, ARNorm = ARNorm,
107 N = N, HRK = HRK, ARK = ARK, ARr = ARr, ARt = ARt, HRr = HRr, HRt = HRt,
108 KeepI = KeepI, HRCenter = HRCenter, HRNorm = HRNorm,
109 Thickness = Thickness, Diameter = Diameter,
110 Wedge = Wedge, Alpha = Alpha,
111 TonHR = TonHR, RonHR = RonHR, TonAR = TonAR, RonAR = RonAR,
112 Ref = Ref)
113
114
115 if settings.warning:
116 self.geoCheck("beam splitter")
117
119 '''Returns the list of lines necessary to print the object.'''
120 sph = geometry.rectToSph(self.HRNorm)
121 return ["BeamSplitter: %s {" % str(self.Ref),
122 "Thick: %scm" % str(self.Thick/cm),
123 "Diameter: %scm" % str(self.Dia/cm) ,
124 "Wedge: %sdeg" % str(self.Wedge/deg) ,
125 "Alpha: %sdeg" % str(self.Alpha/deg),
126 "HRCenter: %s" % str(self.HRCenter),
127 "HRNorm: (%s, %s)deg" % (str(sph[0]/deg), str(sph[1]/deg)),
128 "Index: %s" % str(self.N),
129 "HRKurv, ARKurv: %s, %s" % (str(self.HRK), str(self.ARK)),
130 "HRr, HRt, ARr, ARt: %s, %s, %s, %s" \
131 % (str(self.HRr), str(self.HRt), str(self.ARr), str(self.ARt)),
132 "}"]
133