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
a8ac6ee3
Commit
a8ac6ee3
authored
9 years ago
by
Daniel Brown
Browse files
Options
Downloads
Patches
Plain Diff
adding in styles argument
parent
9acf1206
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
bin/test_plot.py
+3
-3
3 additions, 3 deletions
bin/test_plot.py
pykat/finesse.py
+9
-5
9 additions, 5 deletions
pykat/finesse.py
with
12 additions
and
8 deletions
bin/test_plot.py
+
3
−
3
View file @
a8ac6ee3
import
pykat
import
pykat
pykat
.
init_pykat_plotting
()
#
pykat.init_pykat_plotting()
from
pykat
import
finesse
from
pykat
import
finesse
from
pykat.detectors
import
*
from
pykat.detectors
import
*
...
@@ -32,7 +32,7 @@ attr m1 Rc 1
...
@@ -32,7 +32,7 @@ attr m1 Rc 1
kat
=
finesse
.
kat
()
kat
=
finesse
.
kat
()
kat
.
parseCommands
(
code
)
kat
.
parseCommands
(
code
)
kat
.
add
(
xaxis
(
"
l
og
"
,
[
1
,
360
],
kat
.
m2
.
phi
,
500
))
kat
.
add
(
xaxis
(
"
l
in
"
,
[
1
,
360
],
kat
.
m2
.
phi
,
500
))
kat
.
m1
.
Rcx
=
-
1000.0
kat
.
m1
.
Rcx
=
-
1000.0
kat
.
m1
.
Rcy
=
-
1000.0
kat
.
m1
.
Rcy
=
-
1000.0
...
@@ -43,4 +43,4 @@ kat.maxtem = 0
...
@@ -43,4 +43,4 @@ kat.maxtem = 0
out
=
kat
.
run
()
out
=
kat
.
run
()
fig
=
out
.
plot
()
fig
=
out
.
plot
(
styles
=
{
'
circ
'
:
'
c:
'
},
yaxis
=
"
log abs:deg
"
)
\ No newline at end of file
\ No newline at end of file
This diff is collapsed.
Click to expand it.
pykat/finesse.py
+
9
−
5
View file @
a8ac6ee3
...
@@ -259,7 +259,7 @@ class katRun(object):
...
@@ -259,7 +259,7 @@ class katRun(object):
print
(
"
One xaxis used: %s
"
%
kat
.
xaxis
.
getFinesseText
())
print
(
"
One xaxis used: %s
"
%
kat
.
xaxis
.
getFinesseText
())
def
plot
(
self
,
detectors
=
None
,
filename
=
None
,
show
=
True
,
yaxis
=
None
,
legend
=
True
,
loc
=
0
,
title
=
None
):
def
plot
(
self
,
detectors
=
None
,
filename
=
None
,
show
=
True
,
yaxis
=
None
,
legend
=
True
,
loc
=
0
,
title
=
None
,
styles
=
None
):
"""
"""
This will generate a plot for the output data of this particular pykat run.
This will generate a plot for the output data of this particular pykat run.
It will attempt to generate a plot that shows all the various traces and plots
It will attempt to generate a plot that shows all the various traces and plots
...
@@ -275,6 +275,7 @@ class katRun(object):
...
@@ -275,6 +275,7 @@ class katRun(object):
legend: True | False - whether to include a legend
legend: True | False - whether to include a legend
loc: Location value for the legend, the usual matplotlib one.
loc: Location value for the legend, the usual matplotlib one.
title: Provide a title for the plot if required.
title: Provide a title for the plot if required.
styles: A dictionary which keys being the detector names and the value being a colour and linestyle of the sort
'
k:
'
"""
"""
import
matplotlib.pyplot
as
pyplot
import
matplotlib.pyplot
as
pyplot
import
pykat.plotting
as
plt
import
pykat.plotting
as
plt
...
@@ -349,12 +350,15 @@ class katRun(object):
...
@@ -349,12 +350,15 @@ class katRun(object):
for
det
in
detectors
:
for
det
in
detectors
:
if
not
getattr
(
kat
,
det
).
noplot
:
if
not
getattr
(
kat
,
det
).
noplot
:
if
not
dual_plot
:
if
dual_plot
:
plot_cmd1
(
self
.
x
,
_func1
(
self
[
det
]),
label
=
det
)
else
:
ax
=
pyplot
.
subplot
(
2
,
1
,
1
)
ax
=
pyplot
.
subplot
(
2
,
1
,
1
)
if
styles
is
not
None
and
det
in
styles
:
l
,
=
plot_cmd1
(
self
.
x
,
_func1
(
self
[
det
]),
styles
[
det
],
label
=
det
)
else
:
l
,
=
plot_cmd1
(
self
.
x
,
_func1
(
self
[
det
]),
label
=
det
)
l
,
=
plot_cmd1
(
self
.
x
,
_func1
(
self
[
det
]),
label
=
det
)
if
dual_plot
:
pyplot
.
subplot
(
2
,
1
,
2
)
pyplot
.
subplot
(
2
,
1
,
2
)
plot_cmd2
(
self
.
x
,
_func2
(
self
[
det
]),
color
=
l
.
get_color
(),
ls
=
l
.
get_linestyle
(),
label
=
det
)
plot_cmd2
(
self
.
x
,
_func2
(
self
[
det
]),
color
=
l
.
get_color
(),
ls
=
l
.
get_linestyle
(),
label
=
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