Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
pykat
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Sebastian Steinlechner
pykat
Commits
15650200
Commit
15650200
authored
10 years ago
by
Daniel Brown
Browse files
Options
Downloads
Patches
Plain Diff
romhom updates
parent
ade6bd5c
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
pykat/finesse.py
+16
-8
16 additions, 8 deletions
pykat/finesse.py
pykat/optics/knm.py
+4
-4
4 additions, 4 deletions
pykat/optics/knm.py
pykat/optics/maps.py
+2
-2
2 additions, 2 deletions
pykat/optics/maps.py
pykat/optics/romhom.py
+1
-1
1 addition, 1 deletion
pykat/optics/romhom.py
with
23 additions
and
15 deletions
pykat/finesse.py
+
16
−
8
View file @
15650200
...
...
@@ -30,6 +30,7 @@ import subprocess
import
tempfile
import
numpy
as
np
import
datetime
import
time
import
pickle
import
pykat
import
warnings
...
...
@@ -153,7 +154,8 @@ def f__lkat_trace_callback(lkat, trace_info, getCavities, getNodes, getSpaces):
class
katRun
(
object
):
def
__init__
(
self
):
self
.
runDateTime
=
datetime
.
datetime
.
now
()
self
.
runtime
=
None
self
.
StartDateTime
=
datetime
.
datetime
.
now
()
self
.
x
=
None
self
.
y
=
None
self
.
xlabel
=
None
...
...
@@ -162,10 +164,11 @@ class katRun(object):
self
.
katVersion
=
None
self
.
yaxis
=
None
def
plot
(
self
):
def
plot
(
self
,
logy
=
False
):
import
pylab
pylab
.
plot
(
self
.
x
,
self
.
y
)
pylab
.
legend
(
self
.
ylabels
,
0
)
pylab
.
xlabel
(
self
.
xlabel
)
pylab
.
show
()
...
...
@@ -209,7 +212,8 @@ class katRun(object):
class
katRun2D
(
object
):
def
__init__
(
self
):
self
.
runDateTime
=
datetime
.
datetime
.
now
()
self
.
runtime
self
.
startDateTime
=
datetime
.
datetime
.
now
()
self
.
x
=
None
self
.
y
=
None
self
.
z
=
None
...
...
@@ -956,6 +960,7 @@ class kat(object):
r
.
yaxis
=
self
.
yaxis
r
.
katScript
=
""
.
join
(
self
.
generateKatScript
())
r
.
katScript
+=
"
time
\n
"
if
(
plot
==
None
):
# ensure we don't do any plotting. That should be handled
...
...
@@ -1022,13 +1027,18 @@ class kat(object):
if
printerr
==
1
:
sys
.
stdout
.
write
(
"
\r
{0} {1}
"
.
format
(
action
,
prc
))
else
:
err
+=
line
[
out
,
errpipe
]
=
p
.
communicate
()
_out
=
out
.
split
(
"
\n
"
)
for
line
in
_out
[::
-
1
]:
if
line
.
lstrip
().
startswith
(
'
computation time:
'
):
r
.
runtime
=
float
(
line
.
split
(
"
:
"
)[
1
].
replace
(
"
s
"
,
""
))
if
printout
==
1
:
print
(
out
)
else
:
...
...
@@ -1039,8 +1049,6 @@ class kat(object):
ix2
=
out
.
find
(
'
)
'
,
ix
)
r
.
katVersion
=
out
[
ix
:
ix2
]
r
.
runDateTime
=
datetime
.
datetime
.
now
()
# If Finesse returned an error, just print that and exit!
if
p
.
returncode
!=
0
:
print
(
err
)
...
...
This diff is collapsed.
Click to expand it.
pykat/optics/knm.py
+
4
−
4
View file @
15650200
...
...
@@ -311,15 +311,15 @@ def ROM_HG_knm(weights, mode_in, mode_out, q1, q2, q1y=None, q2y=None, cache=Non
elif
n_mod_2
!=
m_mod_2
:
if
npr_mod_2
==
mpr_mod_2
:
k_ROQ
=
np
.
einsum
(
'
ij,ij
'
,
u_xy_nodes
,
w_ij_Q1Q4
)
+
np
.
einsum
(
'
ij,ij
'
,
-
u_xy_nodes
,
w_ij_Q2Q3
)
k_ROQ
=
np
.
einsum
(
'
ij,ij
'
,
u_xy_nodes
,
w_ij_Q1Q4
)
-
np
.
einsum
(
'
ij,ij
'
,
u_xy_nodes
,
w_ij_Q2Q3
)
else
:
k_ROQ
=
np
.
einsum
(
'
ij,ij
'
,
u_xy_nodes
,
w_ij_Q2Q4
)
+
np
.
einsum
(
'
ij,ij
'
,
-
u_xy_nodes
,
w_ij_Q1Q3
)
k_ROQ
=
np
.
einsum
(
'
ij,ij
'
,
u_xy_nodes
,
w_ij_Q2Q4
)
-
np
.
einsum
(
'
ij,ij
'
,
u_xy_nodes
,
w_ij_Q1Q3
)
elif
npr_mod_2
!=
mpr_mod_2
:
if
n_mod_2
==
m_mod_2
:
k_ROQ
=
np
.
einsum
(
'
ij,ij
'
,
u_xy_nodes
,
w_ij_Q3Q4
)
+
np
.
einsum
(
'
ij,ij
'
,
-
u_xy_nodes
,
w_ij_Q1Q2
)
k_ROQ
=
np
.
einsum
(
'
ij,ij
'
,
u_xy_nodes
,
w_ij_Q3Q4
)
-
np
.
einsum
(
'
ij,ij
'
,
u_xy_nodes
,
w_ij_Q1Q2
)
else
:
k_ROQ
=
np
.
einsum
(
'
ij,ij
'
,
u_xy_nodes
,
w_ij_Q2Q4
)
+
np
.
einsum
(
'
ij,ij
'
,
-
u_xy_nodes
,
w_ij_Q1Q3
)
k_ROQ
=
np
.
einsum
(
'
ij,ij
'
,
u_xy_nodes
,
w_ij_Q2Q4
)
-
np
.
einsum
(
'
ij,ij
'
,
u_xy_nodes
,
w_ij_Q1Q3
)
return
k_ROQ
...
...
This diff is collapsed.
Click to expand it.
pykat/optics/maps.py
+
2
−
2
View file @
15650200
...
...
@@ -293,7 +293,7 @@ class curvedmap(surfacemap):
class
tiltmap
(
surfacemap
):
def
__init__
(
self
,
name
,
size
,
step_size
,
tilt
):
surfacemap
.
__init__
(
self
,
name
,
"
phase
"
,
size
,
(
np
.
array
(
size
)
+
1
)
/
2.0
,
step_size
,
1e-9
)
surfacemap
.
__init__
(
self
,
name
,
"
phase
reflection
"
,
size
,
(
np
.
array
(
size
)
+
1
)
/
2.0
,
step_size
,
1e-9
)
self
.
tilt
=
tilt
@property
...
...
@@ -311,7 +311,7 @@ class tiltmap(surfacemap):
class
zernikemap
(
surfacemap
):
def
__init__
(
self
,
name
,
size
,
step_size
,
radius
,
scaling
=
1e-9
):
surfacemap
.
__init__
(
self
,
name
,
"
phase
"
,
size
,
(
np
.
array
(
size
)
+
1
)
/
2.0
,
step_size
,
scaling
)
surfacemap
.
__init__
(
self
,
name
,
"
phase
reflection
"
,
size
,
(
np
.
array
(
size
)
+
1
)
/
2.0
,
step_size
,
scaling
)
self
.
__zernikes
=
{}
self
.
radius
=
radius
...
...
This diff is collapsed.
Click to expand it.
pykat/optics/romhom.py
+
1
−
1
View file @
15650200
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment