Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
pyBOAT
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
6
Issues
6
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Gregor Moenke
pyBOAT
Commits
4a921319
Commit
4a921319
authored
Aug 13, 2020
by
Gregor Moenke
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix ridge threshold batch processing
parent
008efaa6
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
10 deletions
+35
-10
CHANGELOG.md
CHANGELOG.md
+1
-0
pyboat/ensemble_measures.py
pyboat/ensemble_measures.py
+9
-4
pyboat/ui/batch_process.py
pyboat/ui/batch_process.py
+25
-6
No files found.
CHANGELOG.md
View file @
4a921319
#### Version 0.8.17
-
Fixed crashes during batch analysis with thresholded ridges
-
Warning and on-the-fly interpolation of non-contiguous missing values (NaNs)
#### Version 0.8.16
...
...
pyboat/ensemble_measures.py
View file @
4a921319
...
...
@@ -38,6 +38,7 @@ def average_power_distribution(ridge_results, signal_ids = None, exclude_coi = F
'''
powers
=
[]
ids
=
[]
if
signal_ids
is
None
:
signal_ids
=
np
.
arange
(
len
(
ridge_results
)
)
...
...
@@ -45,17 +46,21 @@ def average_power_distribution(ridge_results, signal_ids = None, exclude_coi = F
assert
len
(
signal_ids
)
==
len
(
ridge_results
)
# collect the time-averaged powers
for
rd
in
ridge_results
:
for
rd
,
_id
in
zip
(
ridge_results
,
signal_ids
)
:
if
exclude_coi
:
# take only ridge power outside of COI
i_left
,
i_right
=
find_COI_crossing
(
rd
)
mpower
=
(
rd
.
power
[
i_left
:
i_right
]).
mean
()
mpower
=
(
rd
.
power
[
i_left
:
i_right
]).
mean
()
else
:
mpower
=
rd
.
power
.
mean
()
powers
.
append
(
mpower
)
# can happen if ridge exclusively inside COI
if
not
np
.
isnan
(
mpower
):
powers
.
append
(
mpower
)
ids
.
append
(
_id
)
powers_series
=
pd
.
Series
(
index
=
signal_
ids
,
data
=
powers
)
powers_series
=
pd
.
Series
(
index
=
ids
,
data
=
powers
)
# sort by power, descending
powers_series
.
sort_values
(
...
...
pyboat/ui/batch_process.py
View file @
4a921319
...
...
@@ -202,6 +202,13 @@ class BatchProcessWindow(QWidget):
# for each signal and the signal_id as key
ridge_results
=
self
.
do_the_loop
()
# check for empty ridge_results
if
not
ridge_results
:
self
.
NoResults
=
MessageWindow
(
'All ridges below threshold.. no results!'
,
'No results'
)
return
# compute the time-averaged powers
if
self
.
cb_power_dis
.
isChecked
()
or
self
.
cb_sorted_powers
.
isChecked
():
...
...
@@ -209,7 +216,6 @@ class BatchProcessWindow(QWidget):
ridge_results
.
keys
(),
exclude_coi
=
True
)
print
(
powers_series
)
# sort by power, descending
powers_series
.
sort_values
(
ascending
=
False
,
...
...
@@ -357,6 +363,8 @@ class BatchProcessWindow(QWidget):
'''
EmptyRidge
=
0
if
self
.
export_options
.
isChecked
():
OutPath
=
self
.
get_OutPath
()
if
OutPath
is
None
:
...
...
@@ -415,8 +423,12 @@ class BatchProcessWindow(QWidget):
tvec
,
power_thresh
,
smoothing_wsize
=
rsmooth
)
ridge_results
[
signal_id
]
=
(
ridge_data
)
if
ridge_data
.
empty
:
EmptyRidge
+=
1
else
:
ridge_results
[
signal_id
]
=
ridge_data
# -- Save out individual results --
if
self
.
cb_specs
.
isChecked
():
...
...
@@ -435,7 +447,8 @@ class BatchProcessWindow(QWidget):
plt
.
savefig
(
fname
)
plt
.
close
()
if
self
.
cb_readout_plots
.
isChecked
():
if
self
.
cb_readout_plots
.
isChecked
()
and
not
ridge_data
.
empty
:
pl
.
plot_readout
(
ridge_data
)
fname
=
f
'
{
OutPath
}
/
{
signal_id
}
_readout.png'
if
self
.
debug
:
...
...
@@ -443,14 +456,20 @@ class BatchProcessWindow(QWidget):
plt
.
savefig
(
fname
)
plt
.
close
()
if
self
.
cb_readout
.
isChecked
():
if
self
.
cb_readout
.
isChecked
()
and
not
ridge_data
.
empty
:
fname
=
f
'
{
OutPath
}
/
{
signal_id
}
_readout.csv'
if
self
.
debug
:
print
(
f
'Saving ridge reatout to
{
fname
}
'
)
ridge_data
.
to_csv
(
fname
,
sep
=
','
,
float_format
=
'%.3f'
,
index
=
False
)
self
.
progress
.
setValue
(
i
)
if
EmptyRidge
>
0
:
self
.
NoRidges
=
MessageWindow
(
f
'
{
EmptyRidge
}
ridge readouts entirely below threshold..'
,
'Discarded ridges'
)
return
ridge_results
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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