summaryrefslogtreecommitdiff
path: root/src/phys.py
diff options
context:
space:
mode:
authorPaweł Redman <pawel.redman@gmail.com>2019-05-02 19:54:26 +0200
committerPaweł Redman <pawel.redman@gmail.com>2019-05-02 19:59:49 +0200
commit6fcef36d90a66afd7c974748af7de2017f4f5792 (patch)
tree8859f434423fc7355f7c8c1e5b246ee2a6a516b6 /src/phys.py
parentb35ade41339ea95ec3c59eb45b813273304682e7 (diff)
Input intensity
Diffstat (limited to 'src/phys.py')
-rw-r--r--src/phys.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/phys.py b/src/phys.py
index cf30667..4e78fe2 100644
--- a/src/phys.py
+++ b/src/phys.py
@@ -94,6 +94,7 @@ class Polarizer:
class System:
def __init__(self):
self.elements = list()
+ self.input_intensity = 1
def recalculate(system):
system.states = [None] * len(system.elements)
@@ -102,6 +103,10 @@ class System:
state = None
for i, pol in enumerate(system.elements):
if pol.enable:
- state = pol.mul(state)
+ new_state = pol.mul(state)
+ if state is None and new_state is not None:
+ state = new_state * np.sqrt(system.input_intensity)
+ else:
+ state = new_state
system.states[i] = state
system.ellipses.append(Ellipse(state))