Skip to content
Snippets Groups Projects
Commit f1fe4b72 authored by Sean Leavey's avatar Sean Leavey
Browse files

Added check to make sure R, T and L add up to 1 for mirrors and beam splitters

parent b5e1105d
Branches master
No related tags found
No related merge requests found
Pipeline #
......@@ -340,6 +340,10 @@ class AbstractMirrorComponent(Component):
if T is not None: self.T.value = T
if L is not None: self.L.value = L
# check energy conservation
if self.R.value + self.T.value + self.L.value != 1:
raise pkex.BasePyKatException("The specified R, T and L values (%f, %f and %f) violate energy conservation" % (self.R.value, self.T.value, self.L.value))
@property
def z(self): return self.__z
@property
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment