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
Jan Zelenka
prasopes
Commits
20fb193a
Commit
20fb193a
authored
May 20, 2020
by
3Yan
Browse files
Reactivity minor fix, hardening
* Empty parameters array handling routine to prevent crash.
parent
da91f65b
Changes
1
Hide whitespace changes
Inline
Side-by-side
prasopes/reactivitytools.py
View file @
20fb193a
...
...
@@ -18,7 +18,7 @@ import logging
matplotlib
.
use
(
"Qt5Agg"
)
logger
=
logging
.
getLogger
(
'
drl
Logger'
)
logger
=
logging
.
getLogger
(
'
reactivity
Logger'
)
def
update_parselect
(
augCanvas
,
parselect
):
index
=
parselect
.
currentIndex
()
...
...
@@ -53,10 +53,18 @@ def pop_dial(augCanvas, drls, graph, labels, parselect, coef1, coef2):
toavg
.
append
((
float
(
params
[
i
][
parselect
.
currentIndex
()])
-
coef1
.
value
())
*
coef2
.
value
())
lastpos
=
i
elif
float
(
params
[
i
][
0
])
>
time
:
elif
float
(
params
[
i
][
0
])
>
time
and
i
>
0
:
# i>0 condition to handle possibility of invalid first scan.
# (was observed in-wild on TSQ once)
break
if
len
(
toavg
)
!=
0
:
pressures
.
append
([
time
,
np
.
average
(
toavg
)])
if
len
(
pressures
)
==
0
:
QtWidgets
.
QMessageBox
.
critical
(
None
,
"No times loaded"
,
"Did not located any valid parameters.
\n
"
"It is either start of the acquisition,
\n
"
"or the timestamps has been corrupted."
)
return
nptpressures
=
np
.
asarray
(
pressures
).
T
[
0
]
goodtimes
=
np
.
where
([
t
in
nptpressures
for
t
in
times
])
for
i
in
range
(
1
,
len
(
intensities
)):
...
...
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