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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Sebastian Steinlechner
pykat
Commits
97fb34f9
Commit
97fb34f9
authored
11 years ago
by
Daniel Brown
Browse files
Options
Downloads
Patches
Plain Diff
selection for which trace information to return
parent
5a10c5b2
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
examples/lkat_trace.py
+1
-1
1 addition, 1 deletion
examples/lkat_trace.py
pykat/finesse.py
+46
-37
46 additions, 37 deletions
pykat/finesse.py
with
47 additions
and
38 deletions
examples/lkat_trace.py
+
1
−
1
View file @
97fb34f9
This diff is collapsed.
Click to expand it.
pykat/finesse.py
+
46
−
37
View file @
97fb34f9
...
...
@@ -93,7 +93,7 @@ def f__lkat_process(callback, cmd, kwargs):
lkat
.
_pykat_finish
(
0
)
def
f__lkat_trace_callback
(
lkat
,
trace_info
):
def
f__lkat_trace_callback
(
lkat
,
trace_info
,
getCavities
,
getNodes
,
getSpaces
):
"""
lkat callback for computing the beam traces through a setup.
Returns a dictionary of nodes, spaces and cavities and the
...
...
@@ -106,6 +106,7 @@ def f__lkat_trace_callback(lkat, trace_info):
lkat
.
_pykat_step
()
if
getNodes
:
for
n
in
range
(
0
,
inter
.
num_nodes
):
node
=
inter
.
node_list
[
n
]
...
...
@@ -116,6 +117,7 @@ def f__lkat_trace_callback(lkat, trace_info):
trace_info
[
node
.
name
]
=
node_info
if
getCavities
:
for
c
in
range
(
0
,
inter
.
num_cavities
):
cav
=
inter
.
cavity_list
[
c
]
...
...
@@ -135,6 +137,7 @@ def f__lkat_trace_callback(lkat, trace_info):
trace_info
[
cav
.
name
]
=
cav_info
if
getSpaces
:
for
s
in
range
(
0
,
inter
.
num_spaces
):
space
=
inter
.
space_list
[
s
]
...
...
@@ -1187,7 +1190,13 @@ class kat(object):
return
rtn
def
lkat_trace
(
self
):
def
lkat_trace
(
self
,
getCavities
=
True
,
getNodes
=
True
,
getSpaces
=
True
):
"""
Given the current state of the kat object a new FINESSE process is called and just
the beam tracing routine is run. The object that is returned contains all the information
from the beam tracing routine for each node and space components defined as well as cavity
commands.
"""
if
lkat_location
==
None
:
raise
RuntimeError
(
"
Could not find shared library
'
libkat
'
, please install to a system location or copy to the same directory as this script
"
)
...
...
@@ -1197,15 +1206,15 @@ class kat(object):
self
.
maxtem
=
0
try
:
p
=
self
.
getProcess
(
f__lkat_trace_callback
,
trace_info
=
trace_info
)
p
=
self
.
getProcess
(
f__lkat_trace_callback
,
trace_info
=
trace_info
,
getCavities
=
getCavities
,
getNodes
=
getNodes
,
getSpaces
=
getSpaces
)
p
.
start
()
p
.
join
()
finally
:
self
.
maxtem
=
prev
# return a local copy of the trace information dictionary
return
dict
(
trace_info
)
finally
:
self
.
maxtem
=
prev
def
__add_detector
(
self
,
det
):
...
...
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