From 6db078cf4696289bb40169398ebe5f3b1f5e87bb Mon Sep 17 00:00:00 2001 From: Paweł Redman Date: Thu, 2 May 2019 18:30:25 +0200 Subject: Transmissivity --- src/phys.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/phys.py') diff --git a/src/phys.py b/src/phys.py index 2109f28..96f3bad 100644 --- a/src/phys.py +++ b/src/phys.py @@ -57,6 +57,8 @@ class Polarizer: self.angle = 0 self.delta = delta self.ref = False # FIXME: move this to UI or System + self.t1 = 1 + self.t2 = 0 self.set_type(type) def set_type(self, type): @@ -74,12 +76,17 @@ class Polarizer: if state is None: if self.type == "linear": return np.dot(R(-self.angle - self.delta), \ - np.array([[1], [0]])) + np.array([[1], [0]])) * np.sqrt(self.t1) else: return None + if type == "linear": + A = np.sqrt(np.array([[self.t1, 0], [0, self.t2]])) + else: + A = np.sqrt(np.array([[self.t1, 0], [0, self.t1]])) + M = np.matmul(R(-self.angle - self.delta), \ - np.matmul(self.M, R(self.angle + self.delta))) + np.matmul(np.matmul(self.M, A), R(self.angle + self.delta))) return np.dot(M, state) class System: -- cgit