Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Sebastian Steinlechner
pykat
Commits
ed941460
Commit
ed941460
authored
Feb 17, 2015
by
Daniel Brown
Browse files
moving math to maths so doesn't conflict with builtin module, tidy up of utilities folder
parent
5c22976b
Changes
12
Hide whitespace changes
Inline
Side-by-side
examples/optivis_aligo_ex.py
View file @
ed941460
...
...
@@ -2,6 +2,5 @@ import pykat
kat
=
pykat
.
finesse
.
kat
(
kat_file
=
"LLO_matched.kat"
)
kat
.
optivis
().
show
()
pykat/finesse.py
View file @
ed941460
...
...
@@ -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
.
name
]
=
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
]]
else
:
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
,
pykat
.
components
.
space
):
continue
print
(
"Adding %s"
%
c
.
name
)
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
,
no
.
name
,
a
[
1
].
name
,
ni
.
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
)
...
...
pykat/math/__init__.py
→
pykat/math
s
/__init__.py
View file @
ed941460
File moved
pykat/math/hermite.py
→
pykat/math
s
/hermite.py
View file @
ed941460
File moved
pykat/math/zernike.py
→
pykat/math
s
/zernike.py
View file @
ed941460
File moved
pykat/optics/maps.py
View file @
ed941460
...
...
@@ -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.math
s
.zernike
import
*
class
surfacemap
(
object
):
def
__init__
(
self
,
name
,
maptype
,
size
,
center
,
step_size
,
scaling
,
data
=
None
):
...
...
pykat/optics/romhom.py
View file @
ed941460
...
...
@@ -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.math
s
.hermite
import
*
import
numpy
as
np
...
...
pykat/
utilities
/__init__.py
→
pykat/
tools/plotting
/__init__.py
View file @
ed941460
File moved
pykat/
utilitie
s/plotting/beamtrace.py
→
pykat/
tool
s/plotting/beamtrace.py
View file @
ed941460
File moved
pykat/
utilitie
s/plotting/colormap.py
→
pykat/
tool
s/plotting/colormap.py
View file @
ed941460
File moved
pykat/
utilitie
s/plotting/tools.py
→
pykat/
tool
s/plotting/tools.py
View file @
ed941460
File moved
pykat/utilities/plotting/__init__.py
deleted
100644 → 0
View file @
5c22976b
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment