Commit ed941460 authored by Daniel Brown's avatar Daniel Brown
Browse files

moving math to maths so doesn't conflict with builtin module, tidy up of utilities folder

parent 5c22976b
......@@ -2,6 +2,5 @@ import pykat
kat = pykat.finesse.kat(kat_file="LLO_matched.kat")
......@@ -34,8 +34,7 @@ import time
import pickle
import pykat
import warnings
import re
import math
import re
import itertools
import ctypes
import ctypes.util
......@@ -43,8 +42,9 @@ import collections
import re
import copy
from collections import namedtuple, OrderedDict
from math import erfc, pi
from collections import namedtuple, OrderedDict
from pykat.node_network import NodeNetwork
from pykat.detectors import BaseDetector as Detector
from pykat.components import Component
......@@ -151,7 +151,13 @@ def f__lkat_trace_callback(lkat, trace_info, getCavities, getNodes, getSpaces):
trace_info[] = space_trace(gouyx = space.gouy_x,
gouyy = space.gouy_y)
def GUILength(L):
Should scale the lengths in some way to handle km and mm
return 10 * erfc(L/1e3) + 0.01
class katRun(object):
def __init__(self):
self.runtime = None
......@@ -196,7 +202,7 @@ class katRun(object):
out = self.y[:, idx[0]]
if self.yaxis == "abs:deg":
out = self.y[:, idx[0]] * np.exp(1j*math.pi*self.y[:, idx[1]]/180.0)
out = self.y[:, idx[0]] * np.exp(1j*pi*self.y[:, idx[1]]/180.0)
elif self.yaxis == "re:im":
out = self.y[:, idx[0]] + 1j*self.y[:, idx[1]]
......@@ -1467,7 +1473,7 @@ class kat(object):
# Run through once to add components, ignoring spaces
for c in self.getComponents():
if isinstance(c, continue
print("Adding %s" %
optivis_op = getattr(c, "getOptivisComponent", None)
# Run through again to add links
......@@ -1491,8 +1497,7 @@ class kat(object):
if no is None or ni is None:
raise pkex.BasePyKatException("Optivis node is None")
print("Link %s (%s) -> %s (%s)" %(a[0].name,, a[1].name,
scene.addLink(links.Link(no, ni, c.L.value))
scene.addLink(links.Link(no, ni, GUILength(c.L.value) ))
gui = canvas.Simple(scene=scene)
......@@ -17,7 +17,7 @@ from pykat.optics.romhom import makeReducedBasis, makeEmpiricalInterpolant, make
from scipy.interpolate import interp2d
import numpy as np
import math
from pykat.math.zernike import *
from pykat.maths.zernike import *
class surfacemap(object):
def __init__(self, name, maptype, size, center, step_size, scaling, data=None):
......@@ -8,7 +8,7 @@ from itertools import combinations_with_replacement as combinations
from pykat.optics.gaussian_beams import beam_param, HG_beam
from scipy.linalg import inv
from math import factorial
from pykat.math.hermite import *
from pykat.maths.hermite import *
import numpy as np
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment