summaryrefslogtreecommitdiff
path: root/src/phys.py
diff options
context:
space:
mode:
authorPaweł Redman <pawel.redman@gmail.com>2019-05-02 18:30:25 +0200
committerPaweł Redman <pawel.redman@gmail.com>2019-05-02 18:30:25 +0200
commit6db078cf4696289bb40169398ebe5f3b1f5e87bb (patch)
tree19faacba467acf04a1b257e3835b0c97c8ee42d7 /src/phys.py
parentd39c23895857ef9ae8080ddd125e845eaa1c8aa3 (diff)
Transmissivity
Diffstat (limited to 'src/phys.py')
-rw-r--r--src/phys.py11
1 files changed, 9 insertions, 2 deletions
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: