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
finesse
pykat
Commits
12b5e783
Commit
12b5e783
authored
Nov 26, 2014
by
Daniel Brown
Browse files
fixing squeezing of output arrays
parent
903088e1
Changes
1
Hide whitespace changes
Inline
Side-by-side
pykat/finesse.py
View file @
12b5e783
...
...
@@ -182,21 +182,24 @@ class katRun(object):
def
__getitem__
(
self
,
value
):
idx
=
[
i
for
i
in
range
(
len
(
self
.
ylabels
))
if
self
.
ylabels
[
i
].
split
()[
0
]
==
str
(
value
)]
if
len
(
idx
)
>
0
:
out
=
self
.
y
[:,
idx
]
if
self
.
yaxis
==
"abs:deg"
:
out
=
self
.
y
[:,
idx
[
0
]]
*
np
.
exp
(
1j
*
math
.
pi
*
self
.
y
[:,
idx
[
1
]]
/
180.0
)
elif
self
.
yaxis
==
"re:im"
:
out
=
self
.
y
[:,
idx
[
0
]]
+
1j
*
self
.
y
[:,
idx
[
1
]]
out
.
squeeze
()
if
len
(
idx
)
==
1
:
if
self
.
yaxis
==
"abs:deg"
:
out
=
self
.
y
[:,
idx
[
0
]]
elif
self
.
yaxis
==
"re:im"
:
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
)
elif
self
.
yaxis
==
"re:im"
:
out
=
self
.
y
[:,
idx
[
0
]]
+
1j
*
self
.
y
[:,
idx
[
1
]]
if
out
.
size
==
1
:
return
out
[
0
]
return
out
[
0
]
.
squeeze
()
else
:
return
out
return
out
.
squeeze
()
else
:
raise
pkex
.
BasePyKatException
(
"No output by the name '{0}' found in the output"
.
format
(
str
(
value
)))
...
...
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