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
a1d51bc3
Commit
a1d51bc3
authored
Aug 26, 2020
by
Gregor Moenke
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Status bars
parent
e759919d
Changes
8
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
456 additions
and
391 deletions
+456
-391
CHANGELOG.md
CHANGELOG.md
+2
-1
pyboat/__init__.py
pyboat/__init__.py
+1
-1
pyboat/plotting.py
pyboat/plotting.py
+1
-1
pyboat/ui/analysis.py
pyboat/ui/analysis.py
+368
-329
pyboat/ui/batch_process.py
pyboat/ui/batch_process.py
+26
-20
pyboat/ui/data_viewer.py
pyboat/ui/data_viewer.py
+28
-15
pyboat/ui/start_menu.py
pyboat/ui/start_menu.py
+2
-2
pyboat/ui/synth_gen.py
pyboat/ui/synth_gen.py
+28
-22
No files found.
CHANGELOG.md
View file @
a1d51bc3
### pyBOAT 0.8.2
-
Added time averaging of Wavelet spectra
<->
Fourier estimates
-
Added Fourier distribution for ensembles
-
Added Fourier distribution for ensembles
, can be used for empirical background estimation
-
Reworked FFT visualizations
-
Status bars with tool tips for all analysis windows
### pyBOAT 0.8.17
...
...
pyboat/__init__.py
View file @
a1d51bc3
...
...
@@ -3,7 +3,7 @@
import
sys
,
os
import
argparse
__version__
=
'0.8.
18
'
__version__
=
'0.8.
2
'
# the object oriented API
from
.api
import
WAnalyzer
...
...
pyboat/plotting.py
View file @
a1d51bc3
...
...
@@ -278,7 +278,7 @@ def plot_signal_modulus(axs, time_vector, signal, modulus, periods, p_max=None):
cb
.
set_ticks
(
cb_ticks
)
cb
.
ax
.
set_xticklabels
(
cb_ticks
,
fontsize
=
tick_label_size
)
# cb.set_label('$|\mathcal{W}_{\Psi}(t,T)|^2$',rotation = '0',labelpad = 5,fontsize = 15)
cb
.
set_label
(
"Wavelet Power"
,
rotation
=
"0"
,
labelpad
=-
1
7
,
fontsize
=
0.9
*
label_size
)
cb
.
set_label
(
"Wavelet Power"
,
rotation
=
"0"
,
labelpad
=-
1
2
,
fontsize
=
0.9
*
label_size
)
def
draw_Wavelet_ridge
(
ax
,
ridge_data
,
marker_size
=
1.5
):
...
...
pyboat/ui/analysis.py
View file @
a1d51bc3
This diff is collapsed.
Click to expand it.
pyboat/ui/batch_process.py
View file @
a1d51bc3
...
...
@@ -4,7 +4,7 @@ import pandas as pd
import
matplotlib.pyplot
as
plt
from
os.path
import
expanduser
from
PyQt5.QtWidgets
import
QCheckBox
,
QComboBox
,
QFileDialog
,
QAction
,
QLabel
,
QLineEdit
,
QPushButton
,
QMessageBox
,
QSizePolicy
,
QWidget
,
QVBoxLayout
,
QHBoxLayout
,
QDialog
,
QGroupBox
,
QGridLayout
,
QProgressBar
,
QSpacerItem
,
QFrame
from
PyQt5.QtWidgets
import
QCheckBox
,
QComboBox
,
QFileDialog
,
QAction
,
QLabel
,
QLineEdit
,
QPushButton
,
QMessageBox
,
QSizePolicy
,
QWidget
,
QVBoxLayout
,
QHBoxLayout
,
QDialog
,
QGroupBox
,
QGridLayout
,
QProgressBar
,
QSpacerItem
,
QFrame
,
QMainWindow
from
PyQt5.QtGui
import
QDoubleValidator
,
QIntValidator
,
QScreen
from
PyQt5.QtCore
import
Qt
,
pyqtSignal
...
...
@@ -18,7 +18,7 @@ import pyboat
from
pyboat
import
plotting
as
pl
from
pyboat
import
ensemble_measures
as
em
class
BatchProcessWindow
(
Q
Widget
):
class
BatchProcessWindow
(
Q
MainWindow
):
'''
The parent is a DataViewer instance holding the
...
...
@@ -49,6 +49,10 @@ class BatchProcessWindow(QWidget):
# from the DataViewer
self
.
wlet_pars
=
wlet_pars
# for the status bar
main_widget
=
QWidget
()
self
.
statusBar
()
main_layout
=
QGridLayout
()
...
...
@@ -61,7 +65,7 @@ class BatchProcessWindow(QWidget):
thresh_edit
.
setValidator
(
posfloatV
)
thresh_edit
.
insert
(
'0'
)
thresh_edit
.
setMaximumWidth
(
60
)
thresh_edit
.
set
Tool
Tip
(
'Ridge points below that power value will be filtered out '
)
thresh_edit
.
set
Status
Tip
(
'Ridge points below that power value will be filtered out '
)
self
.
thresh_edit
=
thresh_edit
...
...
@@ -71,7 +75,7 @@ class BatchProcessWindow(QWidget):
smooth_edit
.
setSizePolicy
(
QSizePolicy
.
Fixed
,
QSizePolicy
.
Fixed
)
smooth_edit
.
setValidator
(
QIntValidator
(
bottom
=
3
,
top
=
99999999
)
)
tt
=
'Savitkzy-Golay window size for smoothing the ridge,
\n
leave blank for no smoothing'
smooth_edit
.
set
Tool
Tip
(
tt
)
smooth_edit
.
set
Status
Tip
(
tt
)
self
.
smooth_edit
=
smooth_edit
ridge_options_layout
=
QGridLayout
()
...
...
@@ -83,41 +87,41 @@ class BatchProcessWindow(QWidget):
# -- Plotting Options --
plotting_options
=
QGroupBox
(
'Summary Statistics'
)
self
.
cb_power_dis
=
QCheckBox
(
'
Ensembl
e Power Distribution'
)
self
.
cb_power_dis
.
set
ToolTip
(
'Show time-averaged wavelet power of the ensemble
'
)
plotting_options
=
QGroupBox
(
'
Ensemble
Summary Statistics'
)
self
.
cb_power_dis
=
QCheckBox
(
'
Ridg
e Power Distribution'
)
self
.
cb_power_dis
.
set
StatusTip
(
'Show time-averaged ridge powers distribution
'
)
self
.
cb_plot_ens_dynamics
=
QCheckBox
(
'Ensemble Dynamics'
)
self
.
cb_plot_ens_dynamics
.
set
Tool
Tip
(
'Show period, amplitude and phase distribution over time'
)
self
.
cb_plot_ens_dynamics
.
set
Status
Tip
(
'Show period, amplitude and phase distribution over time'
)
self
.
cb_plot_Fourier_dis
=
QCheckBox
(
'Fourier Spectra Distribution'
)
self
.
cb_plot_Fourier_dis
.
set
Tool
Tip
(
'Distribution of the time averaged Wavelet spectra'
)
self
.
cb_plot_Fourier_dis
.
set
Status
Tip
(
'Distribution of the time averaged Wavelet spectra'
)
lo
=
QGridLayout
()
lo
.
addWidget
(
self
.
cb_p
ower_dis
,
0
,
0
)
lo
.
addWidget
(
self
.
cb_plot_
ens_dynamic
s
,
1
,
0
)
lo
.
addWidget
(
self
.
cb_p
lot_Fouri
er_dis
,
2
,
0
)
lo
.
addWidget
(
self
.
cb_p
lot_ens_dynamics
,
0
,
0
)
lo
.
addWidget
(
self
.
cb_plot_
Fourier_di
s
,
1
,
0
)
lo
.
addWidget
(
self
.
cb_p
ow
er_dis
,
2
,
0
)
plotting_options
.
setLayout
(
lo
)
# -- Save Out Results --
export_options
=
QGroupBox
(
'Export Results'
)
export_options
.
set
ToolTip
(
'Saves also the summary statistics..'
)
export_options
.
set
StatusTip
(
"Creates various figures and csv's"
)
export_options
.
setCheckable
(
True
)
export_options
.
setChecked
(
False
)
self
.
cb_specs
=
QCheckBox
(
'Wavelet Spectra'
)
self
.
cb_specs
.
set
Tool
Tip
(
"Saves the individual wavelet spectra as images (png's)"
)
self
.
cb_specs
.
set
Status
Tip
(
"Saves the individual wavelet spectra as images (png's)"
)
self
.
cb_readout
=
QCheckBox
(
'Ridge Readouts'
)
self
.
cb_readout
.
set
Tool
Tip
(
'Saves one data frame per signal to disc as csv'
)
self
.
cb_readout
.
set
Status
Tip
(
'Saves one data frame per signal to disc as csv'
)
self
.
cb_readout_plots
=
QCheckBox
(
'Ridge Readout Plots'
)
self
.
cb_readout_plots
.
set
Tool
Tip
(
"Saves the individual readout plots to disc as png's"
)
self
.
cb_readout_plots
.
set
Status
Tip
(
"Saves the individual readout plots to disc as png's"
)
self
.
cb_sorted_powers
=
QCheckBox
(
'Sorted Average Powers'
)
self
.
cb_sorted_powers
.
set
ToolTip
(
"Saves the time-averaged
powers in descending order"
)
self
.
cb_sorted_powers
.
set
StatusTip
(
"Saves the time-averaged ridge
powers in descending order"
)
self
.
cb_save_ensemble_dynamics
=
QCheckBox
(
'Ensemble Dynamics'
)
self
.
cb_save_ensemble_dynamics
.
set
ToolTip
(
"Saves each period, amplitude and phase summary statistics to a csv tab
le"
)
self
.
cb_save_ensemble_dynamics
.
set
StatusTip
(
"Saves each period, amplitude and phase summary statistics to a fi
le"
)
self
.
cb_save_Fourier_dis
=
QCheckBox
(
'Fourier Distribution'
)
self
.
cb_save_Fourier_dis
.
set
ToolTip
(
"Saves median and quartiles of the Fourier power spectra
"
)
self
.
cb_save_Fourier_dis
.
set
StatusTip
(
"Saves median and quartiles of the Fourier power spectral distribution
"
)
home
=
expanduser
(
"~"
)
OutPath_label
=
QLabel
(
'Export to:'
)
...
...
@@ -187,7 +191,9 @@ class BatchProcessWindow(QWidget):
main_layout
.
addWidget
(
process_box
,
2
,
0
,
1
,
2
)
# set main layout
self
.
setLayout
(
main_layout
)
main_widget
.
setLayout
(
main_layout
)
self
.
setCentralWidget
(
main_widget
)
self
.
show
()
...
...
pyboat/ui/data_viewer.py
View file @
a1d51bc3
...
...
@@ -44,7 +44,7 @@ pl.tick_label_size = 12
pl
.
label_size
=
14
class
DataViewer
(
Q
Widget
):
class
DataViewer
(
Q
MainWindow
):
def
__init__
(
self
,
data
,
debug
=
False
):
super
().
__init__
()
...
...
@@ -79,6 +79,10 @@ class DataViewer(QWidget):
self
.
setWindowTitle
(
f
"DataViewer -
{
self
.
df
.
name
}
"
)
self
.
setGeometry
(
80
,
300
,
900
,
650
)
# for the status bar
main_widget
=
QWidget
()
self
.
statusBar
()
self
.
tsCanvas
=
mkTimeSeriesCanvas
()
main_frame
=
QWidget
()
self
.
tsCanvas
.
setParent
(
main_frame
)
...
...
@@ -102,7 +106,7 @@ class DataViewer(QWidget):
# the signal selection box
SignalBox
=
QComboBox
(
self
)
SignalBox
.
set
ToolTip
(
"..or just click
on a signal in the table!"
)
SignalBox
.
set
StatusTip
(
"..or just click directly
on a signal in the table!"
)
main_layout_v
=
QVBoxLayout
()
# The whole Layout
# Data selction drop-down
...
...
@@ -110,13 +114,13 @@ class DataViewer(QWidget):
dt_label
=
QLabel
(
"Sampling Interval:"
)
dt_edit
=
QLineEdit
()
dt_edit
.
set
Tool
Tip
(
"How much time in between two recordings?"
)
dt_edit
.
set
Status
Tip
(
"How much time in between two recordings?"
)
dt_edit
.
setMinimumSize
(
70
,
0
)
# no effect :/
dt_edit
.
setValidator
(
posfloatV
)
unit_label
=
QLabel
(
"Time Unit:"
)
unit_edit
=
QLineEdit
(
self
)
unit_edit
.
set
ToolTip
(
"Changes only the axis labels!
"
)
unit_edit
.
set
StatusTip
(
"Changes only the axis labels..
"
)
unit_edit
.
setMinimumSize
(
70
,
0
)
top_bar_box
=
QWidget
()
...
...
@@ -145,7 +149,7 @@ class DataViewer(QWidget):
self
.
T_c_edit
=
QLineEdit
()
self
.
T_c_edit
.
setMaximumWidth
(
70
)
self
.
T_c_edit
.
setValidator
(
posfloatV
)
self
.
T_c_edit
.
set
Tool
Tip
(
"..in time units, e.g. 120min"
)
self
.
T_c_edit
.
set
Status
Tip
(
"..in time units, e.g. 120min"
)
sinc_options_box
=
QGroupBox
(
"Sinc Detrending"
)
sinc_options_layout
=
QGridLayout
()
...
...
@@ -157,7 +161,7 @@ class DataViewer(QWidget):
self
.
L_edit
=
QLineEdit
()
self
.
L_edit
.
setMaximumWidth
(
70
)
self
.
L_edit
.
setValidator
(
self
.
envelopeV
)
self
.
L_edit
.
set
Tool
Tip
(
"..in time units, e.g. 120min"
)
self
.
L_edit
.
set
Status
Tip
(
"..in time units, e.g. 120min"
)
envelope_options_box
=
QGroupBox
(
"Amplitude Envelope"
)
envelope_options_layout
=
QGridLayout
()
...
...
@@ -170,16 +174,24 @@ class DataViewer(QWidget):
plot_options_layout
=
QGridLayout
()
self
.
cb_raw
=
QCheckBox
(
"Raw Signal"
,
self
)
self
.
cb_raw
.
setStatusTip
(
"Plots the raw unfiltered signal"
)
self
.
cb_trend
=
QCheckBox
(
"Trend"
,
self
)
self
.
cb_trend
.
setStatusTip
(
"Plots the sinc filtered signal"
)
self
.
cb_detrend
=
QCheckBox
(
"Detrended Signal"
,
self
)
self
.
cb_detrend
.
setStatusTip
(
"Plots the signal after trend subtraction (detrending)"
)
self
.
cb_envelope
=
QCheckBox
(
"Envelope"
,
self
)
self
.
cb_envelope
.
setStatusTip
(
"Plots the estimated amplitude envelope"
)
plotButton
=
QPushButton
(
"Refresh Plot"
,
self
)
plotButton
.
setStatusTip
(
"Updates the plot with the new filter parameter values"
)
plotButton
.
clicked
.
connect
(
self
.
doPlot
)
saveButton
=
QPushButton
(
"Save Filter Results"
,
self
)
saveButton
.
clicked
.
connect
(
self
.
save_out_trend
)
saveButton
.
set
Tool
Tip
(
"Writes the trend and the detrended signal into a file"
)
saveButton
.
set
Status
Tip
(
"Writes the trend and the detrended signal into a file"
)
## checkbox layout
plot_options_layout
.
addWidget
(
self
.
cb_raw
,
0
,
0
)
...
...
@@ -223,16 +235,16 @@ class DataViewer(QWidget):
## for wavlet params, button, etc.
self
.
T_min
=
QLineEdit
()
self
.
T_min
.
set
Tool
Tip
(
"This is the lower period limit"
)
self
.
T_min
.
set
Status
Tip
(
"This is the lower period limit"
)
self
.
step_num
=
QLineEdit
()
self
.
step_num
.
insert
(
"200"
)
self
.
step_num
.
set
ToolTip
(
"Increase this number for more
resolution"
)
self
.
step_num
.
set
StatusTip
(
"Increase this number for more spectral
resolution"
)
self
.
T_max
=
QLineEdit
()
self
.
T_max
.
set
Tool
Tip
(
"This is the upper period limit"
)
self
.
T_max
.
set
Status
Tip
(
"This is the upper period limit"
)
self
.
p_max
=
QLineEdit
()
self
.
p_max
.
set
Tool
Tip
(
"Enter a fixed value
for all signals or leave blank for automatic
scaling"
self
.
p_max
.
set
Status
Tip
(
"Enter a fixed value
or leave blank for automatic wavelet power
scaling"
)
# self.p_max.insert(str(20)) # leave blank
...
...
@@ -249,12 +261,12 @@ class DataViewer(QWidget):
wletButton
=
QPushButton
(
"Analyze Signal"
,
self
)
wletButton
.
setStyleSheet
(
"background-color: lightblue"
)
wletButton
.
set
ToolTip
(
"Start the wavelet analysis!
"
)
wletButton
.
set
StatusTip
(
"Opens the wavelet analysis..
"
)
wletButton
.
clicked
.
connect
(
self
.
run_wavelet_ana
)
batchButton
=
QPushButton
(
"Analyze All.."
,
self
)
batchButton
.
clicked
.
connect
(
self
.
run_batch
)
batchButton
.
set
ToolTip
(
"Sets up the analysis for all signals in the table
"
)
batchButton
.
set
StatusTip
(
"Starts the batch processing
"
)
## add button to layout
wlet_button_layout_h
=
QHBoxLayout
()
...
...
@@ -365,7 +377,8 @@ class DataViewer(QWidget):
unit_edit
.
textChanged
[
str
].
connect
(
self
.
qset_time_unit
)
unit_edit
.
insert
(
"min"
)
# standard time unit is minutes
self
.
setLayout
(
main_layout_v
)
main_widget
.
setLayout
(
main_layout_v
)
self
.
setCentralWidget
(
main_widget
)
self
.
show
()
# trigger initial plot?!
...
...
pyboat/ui/start_menu.py
View file @
a1d51bc3
...
...
@@ -59,6 +59,8 @@ class MainWindow(QMainWindow):
# Actions for the menu - status bar
main_widget
=
QWidget
()
# online help in lower left corner
self
.
statusBar
()
quitAction
=
QAction
(
"&Quit"
,
self
)
quitAction
.
setShortcut
(
"Ctrl+Q"
)
...
...
@@ -73,8 +75,6 @@ class MainWindow(QMainWindow):
go_to_doc
=
QAction
(
"&Documentation.."
,
self
)
go_to_doc
.
triggered
.
connect
(
self
.
open_doc_link
)
# online help in lower left corner
self
.
statusBar
()
# the menu bar
...
...
pyboat/ui/synth_gen.py
View file @
a1d51bc3
...
...
@@ -38,7 +38,7 @@ pl.tick_label_size = 12
pl
.
label_size
=
14
class
SynthSignalGen
(
Q
Widget
):
class
SynthSignalGen
(
Q
MainWindow
):
"""
This is basically a clone of the
...
...
@@ -75,6 +75,9 @@ class SynthSignalGen(QWidget):
self
.
setWindowTitle
(
f
"Synthetic Signal Generator"
)
self
.
setGeometry
(
80
,
300
,
900
,
650
)
main_widget
=
QWidget
()
self
.
statusBar
()
self
.
tsCanvas
=
mkTimeSeriesCanvas
()
main_frame
=
QWidget
()
self
.
tsCanvas
.
setParent
(
main_frame
)
...
...
@@ -101,7 +104,7 @@ class SynthSignalGen(QWidget):
Nt_label
=
QLabel
(
"# Samples"
)
self
.
Nt_edit
=
QLineEdit
()
self
.
Nt_edit
.
set
Tool
Tip
(
self
.
Nt_edit
.
set
Status
Tip
(
"Number of data points, minimum is 10, maximum is 10 000!"
)
set_max_width
(
self
.
Nt_edit
,
iwidth
)
...
...
@@ -114,33 +117,34 @@ class SynthSignalGen(QWidget):
basics_box_layout
.
setSpacing
(
2.5
)
basics_box
.
setLayout
(
basics_box_layout
)
basics_box_layout
.
addWidget
(
Nt_label
)
basics_box_layout
.
addWidget
(
self
.
Nt_edit
)
basics_box_layout
.
addWidget
(
dt_label
)
basics_box_layout
.
addWidget
(
dt_edit
)
basics_box_layout
.
addWidget
(
Nt_label
)
basics_box_layout
.
addWidget
(
self
.
Nt_edit
)
basics_box_layout
.
addWidget
(
unit_label
)
basics_box_layout
.
addWidget
(
unit_edit
)
basics_box_layout
.
addStretch
(
0
)
# --- chirp 1 ---
T11_label
=
QLabel
(
"Initial Period"
)
self
.
T11_edit
=
QLineEdit
()
self
.
T11_edit
.
set
Tool
Tip
(
"Period at the beginning of the signal"
)
self
.
T11_edit
.
set
Status
Tip
(
"Period at the beginning of the signal"
)
set_max_width
(
self
.
T11_edit
,
iwidth
)
self
.
T11_edit
.
setValidator
(
posfloatV
)
self
.
T11_edit
.
insert
(
str
(
50
))
# initial period of chirp 1
T12_label
=
QLabel
(
"Final Period"
)
self
.
T12_edit
=
QLineEdit
()
self
.
T12_edit
.
set
Tool
Tip
(
"Period at the end of the signal"
)
self
.
T12_edit
.
set
Status
Tip
(
"Period at the end of the signal"
)
set_max_width
(
self
.
T12_edit
,
iwidth
)
self
.
T12_edit
.
setValidator
(
posfloatV
)
self
.
T12_edit
.
insert
(
str
(
150
))
# initial period of chirp 1
A1_label
=
QLabel
(
"Amplitude"
)
self
.
A1_edit
=
QLineEdit
()
self
.
A1_edit
.
set
Tool
Tip
(
"The amplitude :)"
)
self
.
A1_edit
.
set
Status
Tip
(
"The amplitude :)"
)
set_max_width
(
self
.
A1_edit
,
iwidth
)
self
.
A1_edit
.
setValidator
(
posfloatV
)
self
.
A1_edit
.
insert
(
str
(
1
))
# initial amplitude
...
...
@@ -165,21 +169,21 @@ class SynthSignalGen(QWidget):
T21_label
=
QLabel
(
"Initial Period"
)
self
.
T21_edit
=
QLineEdit
()
self
.
T21_edit
.
set
Tool
Tip
(
"Period at the beginning of the signal"
)
self
.
T21_edit
.
set
Status
Tip
(
"Period at the beginning of the signal"
)
set_max_width
(
self
.
T21_edit
,
iwidth
)
self
.
T21_edit
.
setValidator
(
posfloatV
)
self
.
T21_edit
.
insert
(
str
(
1000
))
# initial period of chirp 1
T22_label
=
QLabel
(
"Final Period"
)
self
.
T22_edit
=
QLineEdit
()
self
.
T22_edit
.
set
Tool
Tip
(
"Period at the end of the signal"
)
self
.
T22_edit
.
set
Status
Tip
(
"Period at the end of the signal"
)
set_max_width
(
self
.
T22_edit
,
iwidth
)
self
.
T22_edit
.
setValidator
(
posfloatV
)
self
.
T22_edit
.
insert
(
str
(
1000
))
# initial period of chirp 1
A2_label
=
QLabel
(
"Amplitude"
)
self
.
A2_edit
=
QLineEdit
()
self
.
A2_edit
.
set
Tool
Tip
(
"Can be negative to induce different trends.."
)
self
.
A2_edit
.
set
Status
Tip
(
"Can be negative to induce different trends.."
)
set_max_width
(
self
.
A2_edit
,
iwidth
)
self
.
A2_edit
.
setValidator
(
floatV
)
self
.
A2_edit
.
insert
(
str
(
2
))
# initial amplitude
...
...
@@ -201,14 +205,15 @@ class SynthSignalGen(QWidget):
# --- the AR1 box ---
self
.
noise_box
=
QGroupBox
(
"Noise"
)
self
.
noise_box
.
setStatusTip
(
"Adds colored AR(1) noise to the signal"
)
self
.
noise_box
.
setCheckable
(
True
)
self
.
noise_box
.
setChecked
(
False
)
noise_box_layout
=
QVBoxLayout
()
self
.
noise_box
.
setLayout
(
noise_box_layout
)
alpha_label
=
QLabel
(
"AR
1
parameter"
)
alpha_label
=
QLabel
(
"AR
(1)
parameter"
)
self
.
alpha_edit
=
QLineEdit
(
parent
=
self
.
noise_box
)
self
.
alpha_edit
.
set
Tool
Tip
(
"0 is white noise, must be smaller than 1!"
)
self
.
alpha_edit
.
set
Status
Tip
(
"0 is white noise, must be smaller than 1!"
)
set_max_width
(
self
.
alpha_edit
,
iwidth
)
# does not work as expected :/
V1
=
QDoubleValidator
()
...
...
@@ -220,7 +225,7 @@ class SynthSignalGen(QWidget):
d_label
=
QLabel
(
"Noise Strength"
)
self
.
d_edit
=
QLineEdit
(
parent
=
self
.
noise_box
)
self
.
d_edit
.
set
ToolTip
(
"Compare to
amplitudes.."
)
self
.
d_edit
.
set
StatusTip
(
"Relative to oscillator
amplitudes.."
)
set_max_width
(
self
.
d_edit
,
iwidth
)
self
.
d_edit
.
setValidator
(
QDoubleValidator
(
bottom
=
0
,
top
=
999999
))
self
.
d_edit
.
insert
(
"0.5"
)
# initial noise strength
...
...
@@ -235,7 +240,7 @@ class SynthSignalGen(QWidget):
tau_label
=
QLabel
(
"Decay Time"
)
self
.
tau_edit
=
QLineEdit
()
self
.
tau_edit
.
set
Tool
Tip
(
self
.
tau_edit
.
set
Status
Tip
(
"Time after which the signal decayed to around a third of the initial amplitude"
)
set_max_width
(
self
.
tau_edit
,
iwidth
)
...
...
@@ -256,7 +261,7 @@ class SynthSignalGen(QWidget):
# --- the create signal button
ssgButton
=
QPushButton
(
"Synthesize Signal"
,
self
)
ssgButton
.
clicked
.
connect
(
self
.
create_signal
)
ssgButton
.
set
Tool
Tip
(
ssgButton
.
set
Status
Tip
(
"Click again with same settings for different noise realizations"
)
ssgButton
.
setStyleSheet
(
"background-color: orange"
)
...
...
@@ -365,15 +370,15 @@ class SynthSignalGen(QWidget):
## for wavlet params, button, etc.
self
.
T_min
=
QLineEdit
()
self
.
T_min
.
set
Tool
Tip
(
"This is the lower period limit"
)
self
.
T_min
.
set
Status
Tip
(
"This is the lower period limit"
)
self
.
step_num
=
QLineEdit
()
self
.
step_num
.
insert
(
"200"
)
self
.
step_num
.
set
Tool
Tip
(
"Increase this number for more resolution"
)
self
.
step_num
.
set
Status
Tip
(
"Increase this number for more resolution"
)
self
.
T_max
=
QLineEdit
()
self
.
T_max
.
set
Tool
Tip
(
"This is the upper period limit"
)
self
.
T_max
.
set
Status
Tip
(
"This is the upper period limit"
)
self
.
p_max
=
QLineEdit
()
self
.
p_max
.
set
Tool
Tip
(
self
.
p_max
.
set
Status
Tip
(
"Enter a fixed value for all signals or leave blank for automatic scaling"
)
...
...
@@ -391,7 +396,7 @@ class SynthSignalGen(QWidget):
wletButton
=
QPushButton
(
"Analyze Signal"
,
self
)
wletButton
.
clicked
.
connect
(
self
.
run_wavelet_ana
)
wletButton
.
set
Tool
Tip
(
"Start the wavelet analysis!"
)
wletButton
.
set
Status
Tip
(
"Start the wavelet analysis!"
)
wletButton
.
setStyleSheet
(
"background-color: lightblue"
)
## add button to layout
...
...
@@ -495,9 +500,10 @@ class SynthSignalGen(QWidget):
# create the default signal
self
.
create_signal
()
self
.
setLayout
(
main_layout_v
)
main_widget
.
setLayout
(
main_layout_v
)
self
.
setCentralWidget
(
main_widget
)
self
.
show
()
# probably all the toggle state variables are not needed -> read out checkboxes directly
def
toggle_raw
(
self
,
state
):
if
state
==
Qt
.
Checked
:
...
...
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