Compare commits
26 Commits
761dc9008c
...
671f66058c
| Author | SHA1 | Date |
|---|---|---|
|
|
671f66058c | |
|
|
2d6c950dfe | |
|
|
fe9ac2d65c | |
|
|
bdeca2b44e | |
|
|
06056d4865 | |
|
|
df68a862fc | |
|
|
7a5f6d41f7 | |
|
|
eef048b197 | |
|
|
3c78777179 | |
|
|
b84f58ca2c | |
|
|
0df253d70f | |
|
|
2715d225af | |
|
|
571ac20d37 | |
|
|
5f0fb9ad53 | |
|
|
cb94bb3c5d | |
|
|
56a26c04b6 | |
|
|
de54303e0b | |
|
|
43ed93584f | |
|
|
d1b311d1a3 | |
|
|
607aed3f11 | |
|
|
487f5e9ac8 | |
|
|
8c7c4cafbc | |
|
|
8dd50f9373 | |
|
|
bcdae43d10 | |
|
|
0c141b8d24 | |
|
|
ba0557294e |
|
|
@ -389,10 +389,6 @@ class CreateTableForSaveAs:
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
logger.debug(f"stg.ind_bottom: {stg.ind_bottom[i]}")
|
|
||||||
logger.debug(np.array([stg.ind_bottom[i]]),
|
|
||||||
np.array(stg.ind_bottom[i]).shape)
|
|
||||||
|
|
||||||
# Commit the transaction after executing INSERT.
|
# Commit the transaction after executing INSERT.
|
||||||
cnx.commit()
|
cnx.commit()
|
||||||
|
|
||||||
|
|
@ -446,7 +442,7 @@ class CreateTableForSaveAs:
|
||||||
|
|
||||||
cur.execute(self.create_SedimentsFile)
|
cur.execute(self.create_SedimentsFile)
|
||||||
|
|
||||||
if stg.path_fine != "" and path_sand != "":
|
if stg.path_fine != "" and stg.path_sand != "":
|
||||||
cur.execute(
|
cur.execute(
|
||||||
"""
|
"""
|
||||||
INSERT into SedimentsFile(
|
INSERT into SedimentsFile(
|
||||||
|
|
|
||||||
42
README.md
42
README.md
|
|
@ -1,27 +1,23 @@
|
||||||
# AcouSed
|
# AcouSed
|
||||||
|
|
||||||
AcouSed for **Acou**stic Backscattering for Concentration of Suspended **Sed**iments in Rivers is a software developped by INRAE, in collaboation with CNR.
|
AcouSed for **Acou**stic Backscattering for Concentration of Suspended **Sed**iments in Rivers is a software developped by INRAE, in collaboation with CNR.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
It is divided in six tabs:
|
It is divided in six tabs:
|
||||||
- Acoustic data : acoustic raw data are downloaded and visualised
|
- Acoustic data : acoustic raw data are downloaded and visualised
|
||||||
- Signal preprocessing : acoustic raw signal is preprocessed with filters
|
- Signal preprocessing : acoustic raw signal is preprocessed with filters
|
||||||
- Sample data : fine and sand sediments samples data are downloaded and visualised
|
- Sample data : fine and sand sediments samples data are downloaded and visualised
|
||||||
- Calibration : calibration parameter are computed
|
- Calibration : calibration parameter are computed
|
||||||
- Inversion : inversion method is calculated to provide fine and sand sediments fields
|
- Inversion : inversion method is calculated to provide fine and sand sediments fields
|
||||||
|
|
||||||
## Software documentation
|
## Installation
|
||||||
|
|
||||||
### Installation
|
|
||||||
|
|
||||||
Acoused is developped for Linux and Windows on Python version 3.8 or
|
Acoused is developped for Linux and Windows on Python version 3.8 or
|
||||||
greater. By default, Acoused is developped with Pypi package
|
greater. By default, Acoused is developped with Pypi package
|
||||||
dependencies, but is also possible to use Guix package manager to run
|
dependencies, but is also possible to use Guix package manager to run
|
||||||
Acoused.
|
Acoused.
|
||||||
|
|
||||||
## Development documentation
|
|
||||||
|
|
||||||
### **TODO** Windows
|
### **TODO** Windows
|
||||||
|
|
||||||
### Linux
|
### Linux
|
||||||
|
|
@ -49,16 +45,15 @@ script `guix.sh` to run the program.
|
||||||
guix shell sqlitebrowser -- ./guix.sh
|
guix shell sqlitebrowser -- ./guix.sh
|
||||||
```
|
```
|
||||||
|
|
||||||
## License
|
## Support files & References
|
||||||
|
|
||||||
AcouSed
|
- [ ] [Acoustic inversion method diagram](https://forgemia.inra.fr/theophile.terraz/acoused/-/blob/main/Acoustic_Inversion_theory.pdf?ref_type=heads)
|
||||||
Copyright (C) 2024 - INRAE
|
- [ ] [Tutorial AQUAscat software : AQUAtalk](https://forgemia.inra.fr/theophile.terraz/acoused/-/blob/main/Tutorial_AQUAscat_software.pdf?ref_type=heads)
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
- [ ] [Adrien Vergne thesis (2018)](https://theses.fr/2018GREAU046)
|
||||||
|
- [ ] [Vergne A., Le Coz J., Berni C., & Pierrefeu G. (2020), Water Resources Research, 56(2)](https://doi.org/10.1029/2019WR024877)
|
||||||
You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
|
- [ ] [Vergne A., Berni C., Le Coz J., & Tencé F., (2021), Water Resources Research, 57(9)](https://doi.org/10.1029/2021WR029589)
|
||||||
|
|
||||||
## Authors & Contacts
|
## Authors & Contacts
|
||||||
|
|
||||||
|
|
@ -68,15 +63,16 @@ You should have received a copy of the GNU General Public License along with thi
|
||||||
If you have any questions or suggestions, please contact us to celine.berni@inrae.fr and/or jerome.lecoz@inrae.fr.
|
If you have any questions or suggestions, please contact us to celine.berni@inrae.fr and/or jerome.lecoz@inrae.fr.
|
||||||
|
|
||||||
## Acknowledgment (Funding)
|
## Acknowledgment (Funding)
|
||||||
This study was conducted within the [Rhône Sediment Observatory](https://observatoire-sediments-rhone.fr/) (OSR), a multi-partner research program funded through the Plan Rhône by the European Regional Development Fund (ERDF), Agence de l’Eau RMC, CNR, EDF and three regional councils (Auvergne-Rhône-Alpes, PACA and Occitanie). It was also support by CNR.
|
|
||||||
|
|
||||||
## Support files & References
|
This study was conducted within the [Rhône Sediment Observatory](https://observatoire-sediments-rhone.fr/) (OSR), a multi-partner research program funded through the Plan Rhône by the European Regional Development Fund (ERDF), Agence de l’Eau RMC, CNR, EDF and three regional councils (Auvergne-Rhône-Alpes, PACA and Occitanie). It was also support by CNR.
|
||||||
|
|
||||||
- [ ] [Acoustic inversion method diagram](https://forgemia.inra.fr/theophile.terraz/acoused/-/blob/main/Acoustic_Inversion_theory.pdf?ref_type=heads)
|
## License
|
||||||
- [ ] [Tutorial AQUAscat software : AQUAtalk](https://forgemia.inra.fr/theophile.terraz/acoused/-/blob/main/Tutorial_AQUAscat_software.pdf?ref_type=heads)
|
|
||||||
|
|
||||||
|
AcouSed
|
||||||
|
Copyright (C) 2024-2025 - INRAE
|
||||||
|
|
||||||
- [ ] [Adrien Vergne thesis (2018)](https://theses.fr/2018GREAU046)
|
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
|
||||||
- [ ] [Vergne A., Le Coz J., Berni C., & Pierrefeu G. (2020), Water Resources Research, 56(2)](https://doi.org/10.1029/2019WR024877)
|
|
||||||
- [ ] [Vergne A., Berni C., Le Coz J., & Tencé F., (2021), Water Resources Research, 57(9)](https://doi.org/10.1029/2021WR029589)
|
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -20,16 +20,11 @@
|
||||||
|
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
import os
|
||||||
import pandas as pd
|
|
||||||
from PyQt5.QtWidgets import (QWidget, QVBoxLayout, QHBoxLayout, QGroupBox, QComboBox,
|
|
||||||
QLabel, QPushButton, QSpacerItem,
|
|
||||||
QSlider, QLineEdit, QMessageBox, QFileDialog)
|
|
||||||
|
|
||||||
from PyQt5.QtCore import QCoreApplication, Qt
|
|
||||||
from PyQt5.QtGui import QIcon, QPixmap
|
|
||||||
|
|
||||||
import numpy as np
|
import numpy as np
|
||||||
|
import pandas as pd
|
||||||
|
|
||||||
|
from copy import deepcopy
|
||||||
|
|
||||||
import matplotlib.pyplot as plt
|
import matplotlib.pyplot as plt
|
||||||
|
|
||||||
|
|
@ -37,9 +32,14 @@ from matplotlib.colors import LogNorm
|
||||||
from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas
|
from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas
|
||||||
from matplotlib.backends.backend_qt5agg import NavigationToolbar2QT as NavigationToolBar
|
from matplotlib.backends.backend_qt5agg import NavigationToolbar2QT as NavigationToolBar
|
||||||
|
|
||||||
from os import chdir
|
from PyQt5.QtWidgets import (
|
||||||
|
QWidget, QVBoxLayout, QHBoxLayout, QGroupBox, QComboBox,
|
||||||
|
QLabel, QPushButton, QSpacerItem, QSlider, QLineEdit,
|
||||||
|
QMessageBox, QFileDialog
|
||||||
|
)
|
||||||
|
|
||||||
from copy import deepcopy
|
from PyQt5.QtCore import QCoreApplication, Qt
|
||||||
|
from PyQt5.QtGui import QIcon, QPixmap
|
||||||
|
|
||||||
from View.checkable_combobox import CheckableComboBox
|
from View.checkable_combobox import CheckableComboBox
|
||||||
|
|
||||||
|
|
@ -1671,96 +1671,81 @@ class AcousticInversionTab(QWidget):
|
||||||
self.figure_measured_vs_inverted_sand.canvas.draw_idle()
|
self.figure_measured_vs_inverted_sand.canvas.draw_idle()
|
||||||
|
|
||||||
def save_result_in_excel_file(self):
|
def save_result_in_excel_file(self):
|
||||||
|
|
||||||
if self.combobox_acoustic_data_choice.count() > 0:
|
if self.combobox_acoustic_data_choice.count() > 0:
|
||||||
|
|
||||||
name = QFileDialog.getSaveFileName(
|
name = QFileDialog.getSaveFileName(
|
||||||
caption="Save As - Inversion results", directory="", filter="Excel Files (*.xlsx)",
|
caption="Save As - Inversion results",
|
||||||
options=QFileDialog.DontUseNativeDialog)
|
directory="",
|
||||||
|
filter="Excel Files (*.xlsx)",
|
||||||
|
options=QFileDialog.DontUseNativeDialog
|
||||||
|
)
|
||||||
|
|
||||||
if name[0]:
|
if name[0]:
|
||||||
dirname = "/".join(name[0].split("/")[:-1]) + "/"
|
dirname = os.path.dirname(name[0])
|
||||||
filename = name[0].split("/")[-1]
|
filename = os.path.basename(name[0])
|
||||||
chdir(dirname)
|
os.chdir(dirname)
|
||||||
|
|
||||||
|
results = []
|
||||||
|
|
||||||
for k in range(self.combobox_acoustic_data_choice.count()):
|
for k in range(self.combobox_acoustic_data_choice.count()):
|
||||||
|
|
||||||
if stg.time_cross_section[k].shape != (0,):
|
if stg.time_cross_section[k].shape != (0,):
|
||||||
|
time_data = stg.time_cross_section
|
||||||
if stg.depth_cross_section[k].shape != (0,):
|
|
||||||
|
|
||||||
t = np.repeat(stg.time_cross_section[k][stg.frequency_for_inversion[1]],
|
|
||||||
stg.depth_cross_section[k].shape[1])
|
|
||||||
|
|
||||||
r = np.zeros((stg.depth_cross_section[k].shape[1] *stg.time_cross_section[k].shape[1],1))
|
|
||||||
|
|
||||||
for i in range(stg.time_cross_section[k].shape[1]):
|
|
||||||
for j in range(stg.depth_cross_section[k].shape[1]):
|
|
||||||
r[i * stg.depth_cross_section[k].shape[1] + j] = (
|
|
||||||
stg.depth_cross_section[k][int(stg.frequency_for_inversion[1]), j])
|
|
||||||
|
|
||||||
if stg.SSC_fine[k].shape == (0,):
|
|
||||||
stg.SSC_fine[k] = np.zeros(r.shape[0])
|
|
||||||
if stg.SSC_sand[k].shape == (0,):
|
|
||||||
stg.SSC_sand[k] = np.zeros(r.shape[0])
|
|
||||||
|
|
||||||
else:
|
|
||||||
|
|
||||||
t = np.repeat(stg.time_cross_section[k][stg.frequency_for_inversion[1]], stg.depth[k].shape[1])
|
|
||||||
|
|
||||||
r = np.zeros((stg.depth[k].shape[1] * stg.time_cross_section[k].shape[1], 1))
|
|
||||||
for i in range(stg.time_cross_section[k].shape[1]):
|
|
||||||
for j in range(stg.depth[k].shape[1]):
|
|
||||||
r[i * stg.depth[k].shape[1] + j] = (
|
|
||||||
stg.depth[k][int(stg.frequency_for_inversion[1]), j])
|
|
||||||
|
|
||||||
if stg.SSC_fine[k].shape == (0,):
|
|
||||||
stg.SSC_fine[k] = np.zeros(r.shape[0])
|
|
||||||
if stg.SSC_sand[k].shape == (0,):
|
|
||||||
stg.SSC_sand[k] = np.zeros(r.shape[0])
|
|
||||||
|
|
||||||
else:
|
else:
|
||||||
|
time_data = stg.time
|
||||||
|
|
||||||
if stg.depth_cross_section[k].shape != (0,):
|
if stg.depth_cross_section[k].shape != (0,):
|
||||||
|
depth_data = stg.depth_cross_section
|
||||||
t = np.repeat(stg.time[k][stg.frequency_for_inversion[1]], stg.depth_cross_section[k].shape[1])
|
else:
|
||||||
|
depth_data = stg.depth
|
||||||
r = np.zeros((stg.depth_cross_section[k].shape[1] * stg.time[k].shape[1], 1))
|
|
||||||
for i in range(stg.time[k].shape[1]):
|
|
||||||
for j in range(stg.depth_cross_section[k].shape[1]):
|
|
||||||
r[i * stg.depth_cross_section[k].shape[1] + j] = (
|
|
||||||
stg.depth_cross_section[k][int(stg.frequency_for_inversion[1]), j])
|
|
||||||
|
|
||||||
if stg.SSC_fine[k].shape == (0,):
|
|
||||||
stg.SSC_fine[k] = np.zeros(r.shape[0])
|
|
||||||
if stg.SSC_sand[k].shape == (0,):
|
|
||||||
stg.SSC_sand[k] = np.zeros(r.shape[0])
|
|
||||||
|
|
||||||
else:
|
|
||||||
|
|
||||||
t = np.repeat(stg.time[k][stg.frequency_for_inversion[1]], stg.depth[k].shape[1])
|
|
||||||
|
|
||||||
r = np.zeros(stg.depth[k].shape[1] * stg.time[k].shape[1])
|
|
||||||
|
|
||||||
for i in range(stg.time[k].shape[1]):
|
|
||||||
for j in range(stg.depth[k].shape[1]):
|
|
||||||
r[i * stg.depth[k].shape[1] + j] = (
|
|
||||||
stg.depth[k][int(stg.frequency_for_inversion[1]), j])
|
|
||||||
|
|
||||||
if stg.SSC_fine[k].shape == (0,):
|
|
||||||
stg.SSC_fine[k] = np.zeros(r.shape[0])
|
|
||||||
if stg.SSC_sand[k].shape == (0,):
|
|
||||||
stg.SSC_sand[k] = np.zeros(r.shape[0])
|
|
||||||
|
|
||||||
exec("result_" + str(k) + "= pd.DataFrame({'Time (sec)': t," +
|
|
||||||
"'Depth (m)': r," +
|
|
||||||
"'SSC_fine (g/L)': stg.SSC_fine[" + str(k) + "].reshape(t.shape[0])," +
|
|
||||||
"'SSC_sand (g/L)': stg.SSC_sand[" + str(k) + "].reshape(t.shape[0])})")
|
|
||||||
|
|
||||||
|
|
||||||
|
t = np.repeat(
|
||||||
|
time_data[k][stg.frequency_for_inversion[1]],
|
||||||
|
depth_data[k].shape[1]
|
||||||
|
)
|
||||||
|
|
||||||
with pd.ExcelWriter(dirname + filename + '.xlsx') as writer:
|
r = np.zeros(
|
||||||
|
depth_data[k].shape[1] * time_data[k].shape[1]
|
||||||
|
)
|
||||||
|
|
||||||
|
for i in range(time_data[k].shape[1]):
|
||||||
|
for j in range(depth_data[k].shape[1]):
|
||||||
|
r_id = i * depth_data[k].shape[1] + j
|
||||||
|
|
||||||
|
r[r_id] = (
|
||||||
|
depth_data[k][
|
||||||
|
int(stg.frequency_for_inversion[1]), j
|
||||||
|
]
|
||||||
|
)
|
||||||
|
|
||||||
|
if stg.SSC_fine[k].shape == (0,):
|
||||||
|
stg.SSC_fine[k] = np.zeros(r.shape[0])
|
||||||
|
if stg.SSC_sand[k].shape == (0,):
|
||||||
|
stg.SSC_sand[k] = np.zeros(r.shape[0])
|
||||||
|
|
||||||
|
results.append(
|
||||||
|
pd.DataFrame(
|
||||||
|
{
|
||||||
|
'Time (sec)': list(t),
|
||||||
|
'Depth (m)': list(r),
|
||||||
|
'SSC_fine (g/L)': list(
|
||||||
|
stg.SSC_fine[k].reshape(t.shape[0])
|
||||||
|
),
|
||||||
|
'SSC_sand (g/L)': list(
|
||||||
|
stg.SSC_sand[k].reshape(t.shape[0])
|
||||||
|
),
|
||||||
|
}
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
if os.path.splitext(filename)[1] != ".xlsx":
|
||||||
|
filename += ".xlsx"
|
||||||
|
|
||||||
|
with pd.ExcelWriter(
|
||||||
|
os.path.join(dirname, filename)
|
||||||
|
) as writer:
|
||||||
for k in range(self.combobox_acoustic_data_choice.count()):
|
for k in range(self.combobox_acoustic_data_choice.count()):
|
||||||
eval("result_" + str(k) + ".to_excel(writer, index=False, " +
|
results[k].to_excel(
|
||||||
"engine='xlsxwriter', na_rep='NA', " +
|
writer, index=False,
|
||||||
"sheet_name=stg.data_preprocessed[" + str(k) + "])")
|
engine='xlsxwriter', na_rep='NA',
|
||||||
|
sheet_name=stg.data_preprocessed[k],
|
||||||
|
)
|
||||||
|
|
|
||||||
|
|
@ -147,12 +147,14 @@ class Ui_MainWindow(object):
|
||||||
icon6.addPixmap(QtGui.QPixmap("icons/en.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
|
icon6.addPixmap(QtGui.QPixmap("icons/en.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
|
||||||
self.actionEnglish.setIcon(icon6)
|
self.actionEnglish.setIcon(icon6)
|
||||||
self.actionEnglish.setObjectName("actionEnglish")
|
self.actionEnglish.setObjectName("actionEnglish")
|
||||||
|
self.actionEnglish.setEnabled(False)
|
||||||
|
|
||||||
self.actionFrench = QtWidgets.QAction(self.mainwindow)
|
self.actionFrench = QtWidgets.QAction(self.mainwindow)
|
||||||
icon7 = QtGui.QIcon()
|
icon7 = QtGui.QIcon()
|
||||||
icon7.addPixmap(QtGui.QPixmap("icons/fr.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
|
icon7.addPixmap(QtGui.QPixmap("icons/fr.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
|
||||||
self.actionFrench.setIcon(icon7)
|
self.actionFrench.setIcon(icon7)
|
||||||
self.actionFrench.setObjectName("actionFrench")
|
self.actionFrench.setObjectName("actionFrench")
|
||||||
|
self.actionFrench.setEnabled(False)
|
||||||
|
|
||||||
self.action_ABSCalibrationConstant = QtWidgets.QAction(self.mainwindow)
|
self.action_ABSCalibrationConstant = QtWidgets.QAction(self.mainwindow)
|
||||||
self.action_ABSCalibrationConstant.setText("ABS constant calibration kt")
|
self.action_ABSCalibrationConstant.setText("ABS constant calibration kt")
|
||||||
|
|
@ -268,7 +270,10 @@ class Ui_MainWindow(object):
|
||||||
)
|
)
|
||||||
|
|
||||||
def save(self):
|
def save(self):
|
||||||
UpdateTableForSave()
|
if stg.dirname_save_as:
|
||||||
|
UpdateTableForSave()
|
||||||
|
else:
|
||||||
|
self.save_as()
|
||||||
|
|
||||||
def open(self):
|
def open(self):
|
||||||
reader = ReadTableForOpen()
|
reader = ReadTableForOpen()
|
||||||
|
|
|
||||||
|
|
@ -1716,14 +1716,18 @@ class SedimentCalibrationTab(QWidget):
|
||||||
self.animaiton_groupbox_compute.start()
|
self.animaiton_groupbox_compute.start()
|
||||||
|
|
||||||
def import_calibration_file(self):
|
def import_calibration_file(self):
|
||||||
|
|
||||||
filename = QFileDialog.getOpenFileName(
|
filename = QFileDialog.getOpenFileName(
|
||||||
self, "Open calibration",
|
self, "Open calibration",
|
||||||
[stg.path_calibration_file if stg.path_calibration_file else
|
[
|
||||||
stg.path_BS_raw_data[
|
stg.path_calibration_file
|
||||||
-1] if self.combobox_acoustic_data_choice.count() > 0 else ""][0],
|
if stg.path_calibration_file
|
||||||
|
else stg.path_BS_raw_data[-1]
|
||||||
|
if self.combobox_acoustic_data_choice.count() > 0
|
||||||
|
else ""
|
||||||
|
][0],
|
||||||
"Calibration file (*.xls, *.ods, *csv)",
|
"Calibration file (*.xls, *.ods, *csv)",
|
||||||
options=QFileDialog.DontUseNativeDialog)
|
options=QFileDialog.DontUseNativeDialog
|
||||||
|
)
|
||||||
|
|
||||||
dir_name = os.path.dirname(filename[0])
|
dir_name = os.path.dirname(filename[0])
|
||||||
name = os.path.basename(filename[0])
|
name = os.path.basename(filename[0])
|
||||||
|
|
@ -1736,114 +1740,188 @@ class SedimentCalibrationTab(QWidget):
|
||||||
|
|
||||||
self.lineEdit_import_calibration.setToolTip(dir_name)
|
self.lineEdit_import_calibration.setToolTip(dir_name)
|
||||||
|
|
||||||
|
self.compute_depth_2D()
|
||||||
self.read_calibration_file_and_fill_parameter()
|
self.read_calibration_file_and_fill_parameter()
|
||||||
|
|
||||||
def update_label_freq1_for_calibration(self):
|
def update_label_freq1_for_calibration(self):
|
||||||
self.label_freq1.clear()
|
self.label_freq1.clear()
|
||||||
self.label_freq1.setText(str(self.combobox_freq1.currentText()))
|
self.label_freq1.setText(
|
||||||
|
str(self.combobox_freq1.currentText())
|
||||||
|
)
|
||||||
|
|
||||||
def update_label_freq2_for_calibration(self):
|
def update_label_freq2_for_calibration(self):
|
||||||
self.label_freq2.clear()
|
self.label_freq2.clear()
|
||||||
self.label_freq2.setText(self.combobox_freq2.currentText())
|
self.label_freq2.setText(
|
||||||
|
self.combobox_freq2.currentText()
|
||||||
|
)
|
||||||
|
|
||||||
def update_label_kt_value_for_calibration(self):
|
def update_label_kt_value_for_calibration(self):
|
||||||
|
print("self.combobox_freq1.currentIndex() ",
|
||||||
|
self.combobox_freq1.currentIndex(),
|
||||||
|
self.combobox_freq1.currentText())
|
||||||
|
|
||||||
|
freq_1 = self.combobox_freq1.currentIndex()
|
||||||
|
freq_2 = self.combobox_freq2.currentIndex()
|
||||||
|
|
||||||
self.label_kt_freq1.clear()
|
self.label_kt_freq1.clear()
|
||||||
print("self.combobox_freq1.currentIndex() ", self.combobox_freq1.currentIndex(), self.combobox_freq1.currentText())
|
if stg.kt_corrected[freq_1] != stg.kt_read[freq_1]:
|
||||||
if stg.kt_corrected[self.combobox_freq1.currentIndex()] != stg.kt_read[self.combobox_freq1.currentIndex()]:
|
self.label_kt_freq1.setText(
|
||||||
self.label_kt_freq1.setText(str('%.4f' % stg.kt_corrected[self.combobox_freq1.currentIndex()]))
|
str('%.4f' % stg.kt_corrected[freq_1])
|
||||||
|
)
|
||||||
else:
|
else:
|
||||||
self.label_kt_freq1.setText(str('%.4f' % stg.kt_read[self.combobox_freq1.currentIndex()]))
|
self.label_kt_freq1.setText(
|
||||||
|
str('%.4f' % stg.kt_read[freq_1])
|
||||||
|
)
|
||||||
|
|
||||||
self.label_kt_freq2.clear()
|
self.label_kt_freq2.clear()
|
||||||
if stg.kt_corrected[self.combobox_freq2.currentIndex()] != stg.kt_read[self.combobox_freq2.currentIndex()]:
|
if stg.kt_corrected[freq_2] != stg.kt_read[freq_2]:
|
||||||
self.label_kt_freq2.setText(str('%.4f' % stg.kt_corrected[self.combobox_freq2.currentIndex()]))
|
self.label_kt_freq2.setText(
|
||||||
|
str('%.4f' % stg.kt_corrected[freq_2])
|
||||||
|
)
|
||||||
else:
|
else:
|
||||||
self.label_kt_freq2.setText(str('%.4f' % stg.kt_read[self.combobox_freq2.currentIndex()]))
|
self.label_kt_freq2.setText(
|
||||||
|
str('%.4f' % stg.kt_read[freq_2])
|
||||||
|
)
|
||||||
|
|
||||||
def read_calibration_file_and_fill_parameter(self):
|
def read_calibration_file_and_fill_parameter(self):
|
||||||
if self.combobox_acoustic_data_choice.count() == 0:
|
if self.combobox_acoustic_data_choice.count() == 0:
|
||||||
|
|
||||||
msgBox = QMessageBox()
|
msgBox = QMessageBox()
|
||||||
msgBox.setWindowTitle("Calibration import error")
|
msgBox.setWindowTitle("Calibration import error")
|
||||||
msgBox.setIconPixmap(
|
msgBox.setIconPixmap(
|
||||||
QPixmap(self._path_icon("no_approved.png")).scaledToHeight(32, Qt.SmoothTransformation))
|
QPixmap(
|
||||||
|
self._path_icon("no_approved.png")
|
||||||
|
).scaledToHeight(32, Qt.SmoothTransformation)
|
||||||
|
)
|
||||||
msgBox.setText("Update data before importing calibration")
|
msgBox.setText("Update data before importing calibration")
|
||||||
msgBox.setStandardButtons(QMessageBox.Ok)
|
msgBox.setStandardButtons(QMessageBox.Ok)
|
||||||
msgBox.exec()
|
msgBox.exec()
|
||||||
|
|
||||||
else:
|
elif stg.filename_calibration_file == "":
|
||||||
|
|
||||||
|
pass
|
||||||
|
|
||||||
|
else:
|
||||||
# --- Read calibration file ---
|
# --- Read calibration file ---
|
||||||
data = pd.read_csv(stg.path_calibration_file + "/" + stg.filename_calibration_file, header=0, index_col=0)
|
data = pd.read_csv(os.path.join(stg.path_calibration_file, stg.filename_calibration_file), header=0, index_col=0)
|
||||||
|
|
||||||
# --- Fill spinboxes of calibration parameter ---
|
# --- Fill spinboxes of calibration parameter ---
|
||||||
self.label_temperature.clear()
|
self.label_temperature.clear()
|
||||||
self.label_temperature.setText("T = " + str(stg.temperature) + " °C")
|
self.label_temperature.setText(
|
||||||
|
"T = " + str(stg.temperature) + " °C"
|
||||||
|
)
|
||||||
|
|
||||||
self.label_freq1.clear()
|
self.label_freq1.clear()
|
||||||
self.label_freq1.setText(data.columns[0])
|
self.label_freq1.setText(data.columns[0])
|
||||||
|
|
||||||
index_freq1 = np.where(np.asarray(stg.freq_text[self.combobox_acoustic_data_choice.currentIndex()]) ==
|
data_id = self.combobox_acoustic_data_choice.currentIndex()
|
||||||
data.columns[0])[0][0]
|
|
||||||
|
index_freq1 = np.where(
|
||||||
|
np.asarray(
|
||||||
|
stg.freq_text[data_id]
|
||||||
|
) == data.columns[0]
|
||||||
|
)[0][0]
|
||||||
|
|
||||||
stg.frequencies_for_calibration.clear()
|
stg.frequencies_for_calibration.clear()
|
||||||
stg.frequencies_for_calibration.append((stg.freq[self.combobox_acoustic_data_choice.currentIndex()][
|
stg.frequencies_for_calibration.append(
|
||||||
index_freq1],
|
(
|
||||||
index_freq1))
|
stg.freq[data_id][index_freq1],
|
||||||
|
index_freq1
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
self.label_freq2.clear()
|
self.label_freq2.clear()
|
||||||
self.label_freq2.setText(data.columns[1])
|
self.label_freq2.setText(data.columns[1])
|
||||||
|
|
||||||
index_freq2 = np.where(np.asarray(stg.freq_text[self.combobox_acoustic_data_choice.currentIndex()]) ==
|
index_freq2 = np.where(
|
||||||
data.columns[1])[0][0]
|
np.asarray(
|
||||||
stg.frequencies_for_calibration.append((stg.freq[self.combobox_acoustic_data_choice.currentIndex()][
|
stg.freq_text[data_id]
|
||||||
index_freq2],
|
) == data.columns[1]
|
||||||
index_freq2))
|
)[0][0]
|
||||||
|
|
||||||
|
stg.frequencies_for_calibration.append(
|
||||||
|
(
|
||||||
|
stg.freq[data_id][index_freq2],
|
||||||
|
index_freq2
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
stg.frequency_for_inversion = tuple()
|
stg.frequency_for_inversion = tuple()
|
||||||
stg.frequency_for_inversion = (stg.freq[self.combobox_acoustic_data_choice.currentIndex()][index_freq2],
|
stg.frequency_for_inversion = (
|
||||||
index_freq2)
|
stg.freq[data_id][index_freq2],
|
||||||
|
index_freq2
|
||||||
|
)
|
||||||
|
|
||||||
self.lineEdit_ks_freq1.clear()
|
self.lineEdit_ks_freq1.clear()
|
||||||
self.lineEdit_ks_freq1.setText(str("%.5f" % float(data.iloc[0][0])))
|
self.lineEdit_ks_freq1.setText(
|
||||||
|
str("%.5f" % float(data.iloc[0][0]))
|
||||||
|
)
|
||||||
|
|
||||||
self.lineEdit_ks_freq2.clear()
|
self.lineEdit_ks_freq2.clear()
|
||||||
self.lineEdit_ks_freq2.setText(str("%.5f" % float(data.iloc[0][1])))
|
self.lineEdit_ks_freq2.setText(
|
||||||
|
str("%.5f" % float(data.iloc[0][1]))
|
||||||
|
)
|
||||||
|
|
||||||
stg.ks.clear()
|
stg.ks.clear()
|
||||||
stg.ks = [float(self.lineEdit_ks_freq1.text()), float(self.lineEdit_ks_freq2.text())]
|
stg.ks = [
|
||||||
|
float(self.lineEdit_ks_freq1.text()),
|
||||||
|
float(self.lineEdit_ks_freq2.text())
|
||||||
|
]
|
||||||
|
|
||||||
self.lineEdit_sv_freq1.clear()
|
self.lineEdit_sv_freq1.clear()
|
||||||
self.lineEdit_sv_freq1.setText(str("%.5f" % float(data.iloc[1][0])))
|
self.lineEdit_sv_freq1.setText(
|
||||||
|
str("%.5f" % float(data.iloc[1][0]))
|
||||||
|
)
|
||||||
|
|
||||||
self.lineEdit_sv_freq2.clear()
|
self.lineEdit_sv_freq2.clear()
|
||||||
self.lineEdit_sv_freq2.setText(str("%.5f" % float(data.iloc[1][1])))
|
self.lineEdit_sv_freq2.setText(
|
||||||
|
str("%.5f" % float(data.iloc[1][1]))
|
||||||
|
)
|
||||||
|
|
||||||
stg.sv.clear()
|
stg.sv.clear()
|
||||||
stg.sv = [float(self.lineEdit_sv_freq1.text()), float(self.lineEdit_sv_freq2.text())]
|
stg.sv = [
|
||||||
|
float(self.lineEdit_sv_freq1.text()),
|
||||||
|
float(self.lineEdit_sv_freq2.text())
|
||||||
|
]
|
||||||
|
|
||||||
self.lineEdit_X.clear()
|
self.lineEdit_X.clear()
|
||||||
self.lineEdit_X.setText(str("%.2f" % float(data.iloc[2][0])))
|
self.lineEdit_X.setText(
|
||||||
|
str("%.2f" % float(data.iloc[2][0]))
|
||||||
|
)
|
||||||
|
|
||||||
stg.X_exponent.clear()
|
stg.X_exponent.clear()
|
||||||
stg.X_exponent.append(float(self.lineEdit_X.text()))
|
stg.X_exponent.append(float(self.lineEdit_X.text()))
|
||||||
|
|
||||||
self.lineEdit_alphas_freq1.clear()
|
self.lineEdit_alphas_freq1.clear()
|
||||||
self.lineEdit_alphas_freq1.setText(str("%.5f" % float(data.iloc[3][0])))
|
self.lineEdit_alphas_freq1.setText(
|
||||||
|
str("%.5f" % float(data.iloc[3][0]))
|
||||||
|
)
|
||||||
|
|
||||||
self.lineEdit_alphas_freq2.clear()
|
self.lineEdit_alphas_freq2.clear()
|
||||||
self.lineEdit_alphas_freq2.setText(str("%.5f" % float(data.iloc[3][1])))
|
self.lineEdit_alphas_freq2.setText(
|
||||||
|
str("%.5f" % float(data.iloc[3][1]))
|
||||||
|
)
|
||||||
|
|
||||||
stg.alpha_s.clear()
|
stg.alpha_s.clear()
|
||||||
stg.alpha_s = [float(self.lineEdit_alphas_freq1.text()), float(self.lineEdit_alphas_freq2.text())]
|
stg.alpha_s = [
|
||||||
|
float(self.lineEdit_alphas_freq1.text()),
|
||||||
|
float(self.lineEdit_alphas_freq2.text())
|
||||||
|
]
|
||||||
|
|
||||||
self.lineEdit_zeta_freq1.clear()
|
self.lineEdit_zeta_freq1.clear()
|
||||||
self.lineEdit_zeta_freq1.setText(str("%.5f" % float(data.iloc[4][0])))
|
self.lineEdit_zeta_freq1.setText(
|
||||||
|
str("%.5f" % float(data.iloc[4][0]))
|
||||||
|
)
|
||||||
|
|
||||||
self.lineEdit_zeta_freq2.clear()
|
self.lineEdit_zeta_freq2.clear()
|
||||||
self.lineEdit_zeta_freq2.setText(str("%.5f" % float(data.iloc[4][1])))
|
self.lineEdit_zeta_freq2.setText(
|
||||||
|
str("%.5f" % float(data.iloc[4][1]))
|
||||||
|
)
|
||||||
|
|
||||||
stg.zeta.clear()
|
stg.zeta.clear()
|
||||||
stg.zeta = [float(self.lineEdit_zeta_freq1.text()), float(self.lineEdit_zeta_freq2.text())]
|
stg.zeta = [
|
||||||
|
float(self.lineEdit_zeta_freq1.text()),
|
||||||
|
float(self.lineEdit_zeta_freq2.text())
|
||||||
|
]
|
||||||
|
|
||||||
self.compute_kt2D_kt3D()
|
self.compute_kt2D_kt3D()
|
||||||
self.compute_J_cross_section()
|
self.compute_J_cross_section()
|
||||||
|
|
@ -1931,8 +2009,8 @@ class SedimentCalibrationTab(QWidget):
|
||||||
self.compute_zeta()
|
self.compute_zeta()
|
||||||
|
|
||||||
def compute_ks(self):
|
def compute_ks(self):
|
||||||
|
data_id = self.combobox_acoustic_data_choice.currentIndex()
|
||||||
|
|
||||||
# --- Compute ks ---
|
|
||||||
psd_number_of_particles = (
|
psd_number_of_particles = (
|
||||||
self.inv_hc.compute_particle_size_distribution_in_number_of_particles(
|
self.inv_hc.compute_particle_size_distribution_in_number_of_particles(
|
||||||
num_sample=stg.sand_sample_target[0][1],
|
num_sample=stg.sand_sample_target[0][1],
|
||||||
|
|
@ -1943,17 +2021,13 @@ class SedimentCalibrationTab(QWidget):
|
||||||
|
|
||||||
ks_freq1 = self.inv_hc.ks(
|
ks_freq1 = self.inv_hc.ks(
|
||||||
proba_num=psd_number_of_particles,
|
proba_num=psd_number_of_particles,
|
||||||
freq=stg.freq[self.combobox_acoustic_data_choice.currentIndex()][
|
freq=stg.freq[data_id][self.combobox_freq1.currentIndex()],
|
||||||
self.combobox_freq1.currentIndex()
|
|
||||||
],
|
|
||||||
C=stg.water_velocity
|
C=stg.water_velocity
|
||||||
)
|
)
|
||||||
|
|
||||||
ks_freq2 = self.inv_hc.ks(
|
ks_freq2 = self.inv_hc.ks(
|
||||||
proba_num=psd_number_of_particles,
|
proba_num=psd_number_of_particles,
|
||||||
freq=stg.freq[self.combobox_acoustic_data_choice.currentIndex()][
|
freq=stg.freq[data_id][self.combobox_freq2.currentIndex()],
|
||||||
self.combobox_freq2.currentIndex()
|
|
||||||
],
|
|
||||||
C=stg.water_velocity
|
C=stg.water_velocity
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -1961,12 +2035,12 @@ class SedimentCalibrationTab(QWidget):
|
||||||
|
|
||||||
logger.debug(
|
logger.debug(
|
||||||
"ks for frequency of "
|
"ks for frequency of "
|
||||||
+ f"{stg.freq[self.combobox_acoustic_data_choice.currentIndex()][self.combobox_freq1.currentIndex()]} : "
|
+ f"{stg.freq[data_id][self.combobox_freq1.currentIndex()]} : "
|
||||||
+ f"{ks_freq1} m/kg^0.5 \n"
|
+ f"{ks_freq1} m/kg^0.5 \n"
|
||||||
)
|
)
|
||||||
logger.debug(
|
logger.debug(
|
||||||
"ks for frequency of "
|
"ks for frequency of "
|
||||||
+ f"{stg.freq[self.combobox_acoustic_data_choice.currentIndex()][self.combobox_freq2.currentIndex()]} : " +
|
+ f"{stg.freq[data_id][self.combobox_freq2.currentIndex()]} : " +
|
||||||
f"{ks_freq2} m/kg^0.5"
|
f"{ks_freq2} m/kg^0.5"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -1977,13 +2051,21 @@ class SedimentCalibrationTab(QWidget):
|
||||||
self.lineEdit_ks_freq2.setText(str("%.5f" % ks_freq2))
|
self.lineEdit_ks_freq2.setText(str("%.5f" % ks_freq2))
|
||||||
|
|
||||||
def compute_sv(self):
|
def compute_sv(self):
|
||||||
|
data_id = self.combobox_acoustic_data_choice.currentIndex()
|
||||||
|
|
||||||
sv_freq1 = self.inv_hc.sv(ks=stg.ks[0], M_sand=stg.Ctot_sand[stg.sand_sample_target[0][1]])
|
sv_freq1 = self.inv_hc.sv(ks=stg.ks[0], M_sand=stg.Ctot_sand[stg.sand_sample_target[0][1]])
|
||||||
sv_freq2 = self.inv_hc.sv(ks=stg.ks[1], M_sand=stg.Ctot_sand[stg.sand_sample_target[0][1]])
|
sv_freq2 = self.inv_hc.sv(ks=stg.ks[1], M_sand=stg.Ctot_sand[stg.sand_sample_target[0][1]])
|
||||||
|
|
||||||
stg.sv = [sv_freq1, sv_freq2]
|
stg.sv = [sv_freq1, sv_freq2]
|
||||||
|
|
||||||
print(f"sv for frequency of {stg.freq[self.combobox_acoustic_data_choice.currentIndex()][self.combobox_freq1.currentIndex()]} : {sv_freq1:.8f} /m \n")
|
print(
|
||||||
print(f"sv for frequency of {stg.freq[self.combobox_acoustic_data_choice.currentIndex()][self.combobox_freq2.currentIndex()]} : {sv_freq2:.8f} /m")
|
f"sv for frequency of {stg.freq[data_id][self.combobox_freq1.currentIndex()]}"
|
||||||
|
+ f" : {sv_freq1:.8f} /m \n"
|
||||||
|
)
|
||||||
|
print(
|
||||||
|
f"sv for frequency of {stg.freq[data_id][self.combobox_freq2.currentIndex()]}"
|
||||||
|
+ f" : {sv_freq2:.8f} /m"
|
||||||
|
)
|
||||||
|
|
||||||
self.lineEdit_sv_freq1.clear()
|
self.lineEdit_sv_freq1.clear()
|
||||||
self.lineEdit_sv_freq1.setText(str("%.5f" % sv_freq1))
|
self.lineEdit_sv_freq1.setText(str("%.5f" % sv_freq1))
|
||||||
|
|
@ -1992,9 +2074,13 @@ class SedimentCalibrationTab(QWidget):
|
||||||
self.lineEdit_sv_freq2.setText(str("%.5f" % sv_freq2))
|
self.lineEdit_sv_freq2.setText(str("%.5f" % sv_freq2))
|
||||||
|
|
||||||
def compute_X(self):
|
def compute_X(self):
|
||||||
X_exponent = self.inv_hc.X_exponent(freq1=stg.freq[self.combobox_acoustic_data_choice.currentIndex()][self.combobox_freq1.currentIndex()],
|
data_id = self.combobox_acoustic_data_choice.currentIndex()
|
||||||
freq2=stg.freq[self.combobox_acoustic_data_choice.currentIndex()][self.combobox_freq2.currentIndex()],
|
|
||||||
sv_freq1=stg.sv[0], sv_freq2=stg.sv[1])
|
X_exponent = self.inv_hc.X_exponent(
|
||||||
|
freq1=stg.freq[data_id][self.combobox_freq1.currentIndex()],
|
||||||
|
freq2=stg.freq[data_id][self.combobox_freq2.currentIndex()],
|
||||||
|
sv_freq1=stg.sv[0], sv_freq2=stg.sv[1]
|
||||||
|
)
|
||||||
|
|
||||||
stg.X_exponent.clear()
|
stg.X_exponent.clear()
|
||||||
stg.X_exponent.append(X_exponent)
|
stg.X_exponent.append(X_exponent)
|
||||||
|
|
@ -2037,190 +2123,90 @@ class SedimentCalibrationTab(QWidget):
|
||||||
)
|
)
|
||||||
|
|
||||||
def compute_J_cross_section(self):
|
def compute_J_cross_section(self):
|
||||||
|
lst_bs_data = [
|
||||||
|
stg.BS_stream_bed_pre_process_average,
|
||||||
|
stg.BS_stream_bed_pre_process_SNR,
|
||||||
|
stg.BS_stream_bed,
|
||||||
|
stg.BS_cross_section_pre_process_average,
|
||||||
|
stg.BS_cross_section_pre_process_SNR,
|
||||||
|
stg.BS_cross_section,
|
||||||
|
stg.BS_raw_data_pre_process_average,
|
||||||
|
stg.BS_raw_data_pre_process_SNR,
|
||||||
|
stg.BS_raw_data
|
||||||
|
]
|
||||||
|
|
||||||
for i in range(self.combobox_acoustic_data_choice.count()):
|
for i in range(self.combobox_acoustic_data_choice.count()):
|
||||||
|
|
||||||
J_cross_section_freq1 = np.array([])
|
J_cross_section_freq1 = np.array([])
|
||||||
J_cross_section_freq2 = np.array([])
|
J_cross_section_freq2 = np.array([])
|
||||||
|
|
||||||
# --- Compute J ---
|
for data in lst_bs_data:
|
||||||
if stg.BS_stream_bed_pre_process_average[i].shape != (0,):
|
if data[i].shape != (0,):
|
||||||
|
bs_data = data
|
||||||
|
break
|
||||||
|
|
||||||
J_cross_section_freq1 = self.inv_hc.j_cross_section(
|
print(f"{stg.depth_2D[i].shape}")
|
||||||
BS=stg.BS_stream_bed_pre_process_average[i][
|
print(f"{stg.depth_2D[i]}")
|
||||||
stg.frequencies_for_calibration[0][1], :, :],
|
|
||||||
r2D=stg.depth_2D[i][stg.frequencies_for_calibration[0][1],
|
|
||||||
:, :],
|
|
||||||
kt=stg.kt3D[i][stg.frequencies_for_calibration[0][1], :, :])
|
|
||||||
|
|
||||||
J_cross_section_freq2 = self.inv_hc.j_cross_section(
|
J_cross_section_freq1 = self.inv_hc.j_cross_section(
|
||||||
BS=stg.BS_stream_bed_pre_process_average[i][
|
BS = bs_data[i][
|
||||||
stg.frequencies_for_calibration[1][1], :, :],
|
stg.frequencies_for_calibration[0][1], :, :
|
||||||
r2D=stg.depth_2D[i][stg.frequencies_for_calibration[1][1],
|
],
|
||||||
:, :],
|
r2D = stg.depth_2D[i][
|
||||||
kt=stg.kt3D[i][stg.frequencies_for_calibration[1][1], :, :])
|
stg.frequencies_for_calibration[0][1], :, :
|
||||||
|
],
|
||||||
|
kt = stg.kt3D[i][
|
||||||
|
stg.frequencies_for_calibration[0][1], :, :
|
||||||
|
]
|
||||||
|
)
|
||||||
|
|
||||||
elif stg.BS_stream_bed_pre_process_SNR[i].shape != (0,):
|
J_cross_section_freq2 = self.inv_hc.j_cross_section(
|
||||||
|
BS = bs_data[i][
|
||||||
J_cross_section_freq1 = self.inv_hc.j_cross_section(
|
stg.frequencies_for_calibration[1][1], :, :
|
||||||
BS=stg.BS_stream_bed_pre_process_SNR[i][
|
],
|
||||||
stg.frequencies_for_calibration[0][1], :, :],
|
r2D = stg.depth_2D[i][
|
||||||
r2D=stg.depth_2D[i][stg.frequencies_for_calibration[0][1],
|
stg.frequencies_for_calibration[1][1], :, :
|
||||||
:, :],
|
],
|
||||||
kt=stg.kt3D[i][stg.frequencies_for_calibration[0][1], :, :])
|
kt = stg.kt3D[i][
|
||||||
|
stg.frequencies_for_calibration[1][1], :, :
|
||||||
J_cross_section_freq2 = self.inv_hc.j_cross_section(
|
]
|
||||||
BS=stg.BS_stream_bed_pre_process_SNR[i][
|
)
|
||||||
stg.frequencies_for_calibration[1][1], :, :],
|
|
||||||
r2D=stg.depth_2D[i][stg.frequencies_for_calibration[1][1],
|
|
||||||
:, :],
|
|
||||||
kt=stg.kt3D[i][stg.frequencies_for_calibration[1][1], :, :])
|
|
||||||
|
|
||||||
elif stg.BS_stream_bed[i].shape != (0,):
|
|
||||||
|
|
||||||
J_cross_section_freq1 = self.inv_hc.j_cross_section(
|
|
||||||
BS=stg.BS_stream_bed[i][stg.frequencies_for_calibration[0][1], :, :],
|
|
||||||
r2D=stg.depth_2D[i][stg.frequencies_for_calibration[0][1], :, :],
|
|
||||||
kt=stg.kt3D[i][stg.frequencies_for_calibration[0][1], :, :])
|
|
||||||
|
|
||||||
J_cross_section_freq2 = self.inv_hc.j_cross_section(
|
|
||||||
BS=stg.BS_stream_bed[i][
|
|
||||||
stg.frequencies_for_calibration[1][1], :, :],
|
|
||||||
r2D=stg.depth_2D[i][stg.frequencies_for_calibration[1][1], :, :],
|
|
||||||
kt=stg.kt3D[i][stg.frequencies_for_calibration[1][1], :, :])
|
|
||||||
|
|
||||||
elif stg.BS_cross_section_pre_process_average[i].shape != (0,):
|
|
||||||
|
|
||||||
J_cross_section_freq1 = self.inv_hc.j_cross_section(
|
|
||||||
BS=stg.BS_cross_section_pre_process_average[i][
|
|
||||||
stg.frequencies_for_calibration[0][1], :, :],
|
|
||||||
r2D=stg.depth_2D[i][stg.frequencies_for_calibration[0][1],
|
|
||||||
:, :],
|
|
||||||
kt=stg.kt3D[i][stg.frequencies_for_calibration[0][1], :, :])
|
|
||||||
|
|
||||||
J_cross_section_freq2 = self.inv_hc.j_cross_section(
|
|
||||||
BS=stg.BS_cross_section_pre_process_average[i][
|
|
||||||
stg.frequencies_for_calibration[1][1], :, :],
|
|
||||||
r2D=stg.depth_2D[i][stg.frequencies_for_calibration[1][1],
|
|
||||||
:, :],
|
|
||||||
kt=stg.kt3D[i][stg.frequencies_for_calibration[1][1], :, :])
|
|
||||||
|
|
||||||
elif stg.BS_cross_section_pre_process_SNR[i].shape != (0,):
|
|
||||||
|
|
||||||
J_cross_section_freq1 = self.inv_hc.j_cross_section(
|
|
||||||
BS=stg.BS_cross_section_pre_process_SNR[i][
|
|
||||||
stg.frequencies_for_calibration[0][1], :, :],
|
|
||||||
r2D=stg.depth_2D[i][stg.frequencies_for_calibration[0][1],
|
|
||||||
:, :],
|
|
||||||
kt=stg.kt3D[i][stg.frequencies_for_calibration[0][1], :, :])
|
|
||||||
|
|
||||||
J_cross_section_freq2 = self.inv_hc.j_cross_section(
|
|
||||||
BS=stg.BS_cross_section_pre_process_SNR[i][
|
|
||||||
stg.frequencies_for_calibration[1][1], :, :],
|
|
||||||
r2D=stg.depth_2D[i][stg.frequencies_for_calibration[1][1],
|
|
||||||
:, :],
|
|
||||||
kt=stg.kt3D[i][stg.frequencies_for_calibration[1][1], :, :])
|
|
||||||
|
|
||||||
elif stg.BS_cross_section[i].shape != (0,):
|
|
||||||
|
|
||||||
J_cross_section_freq1 = self.inv_hc.j_cross_section(
|
|
||||||
BS=stg.BS_cross_section[i][
|
|
||||||
stg.frequencies_for_calibration[0][1], :, :],
|
|
||||||
r2D=stg.depth_2D[i, :, :][stg.frequencies_for_calibration[0][1], :, :],
|
|
||||||
kt=stg.kt3D[i][stg.frequencies_for_calibration[0][1], :, :])
|
|
||||||
|
|
||||||
J_cross_section_freq2 = self.inv_hc.j_cross_section(
|
|
||||||
BS=stg.BS_cross_section[i][
|
|
||||||
stg.frequencies_for_calibration[1][1], :, :],
|
|
||||||
r2D=stg.depth_2D[i, :, :][stg.frequencies_for_calibration[1][1], :, :],
|
|
||||||
kt=stg.kt3D[i][stg.frequencies_for_calibration[1][1], :, :])
|
|
||||||
|
|
||||||
elif stg.BS_raw_data_pre_process_average[i].shape != (0,):
|
|
||||||
|
|
||||||
J_cross_section_freq1 = self.inv_hc.j_cross_section(
|
|
||||||
BS=stg.BS_raw_data_pre_process_average[i][
|
|
||||||
stg.frequencies_for_calibration[0][1], :, :],
|
|
||||||
r2D=stg.depth_2D[i][stg.frequencies_for_calibration[0][1], :, :],
|
|
||||||
kt=stg.kt3D[i][stg.frequencies_for_calibration[0][1], :, :])
|
|
||||||
|
|
||||||
J_cross_section_freq2 = self.inv_hc.j_cross_section(
|
|
||||||
BS=stg.BS_raw_data_pre_process_average[i][
|
|
||||||
stg.frequencies_for_calibration[1][1], :, :],
|
|
||||||
r2D=stg.depth_2D[i][stg.frequencies_for_calibration[1][1], :, :],
|
|
||||||
kt=stg.kt3D[i][stg.frequencies_for_calibration[1][1], :, :])
|
|
||||||
|
|
||||||
elif stg.BS_raw_data_pre_process_SNR[i].shape != (0,):
|
|
||||||
|
|
||||||
J_cross_section_freq1 = self.inv_hc.j_cross_section(
|
|
||||||
BS=stg.BS_raw_data_pre_process_SNR[i][
|
|
||||||
stg.frequencies_for_calibration[0][1], :, :],
|
|
||||||
r2D=stg.depth_2D[i][stg.frequencies_for_calibration[0][1], :, :],
|
|
||||||
kt=stg.kt3D[i][stg.frequencies_for_calibration[0][1], :, :])
|
|
||||||
|
|
||||||
J_cross_section_freq2 = self.inv_hc.j_cross_section(
|
|
||||||
BS=stg.BS_raw_data_pre_process_SNR[i][
|
|
||||||
stg.frequencies_for_calibration[1][1], :, :],
|
|
||||||
r2D=stg.depth_2D[i][stg.frequencies_for_calibration[1][1], :, :],
|
|
||||||
kt=stg.kt3D[i][stg.frequencies_for_calibration[1][1], :, :])
|
|
||||||
|
|
||||||
elif stg.BS_raw_data:
|
|
||||||
|
|
||||||
J_cross_section_freq1 = self.inv_hc.j_cross_section(
|
|
||||||
BS=stg.BS_raw_data[i][
|
|
||||||
stg.frequencies_for_calibration[0][1], :, :],
|
|
||||||
r2D=stg.depth_2D[i][stg.frequencies_for_calibration[0][1], :, :],
|
|
||||||
kt=stg.kt3D[i][stg.frequencies_for_calibration[0][1], :, :])
|
|
||||||
|
|
||||||
J_cross_section_freq2 = self.inv_hc.j_cross_section(
|
|
||||||
BS=stg.BS_raw_data[i][
|
|
||||||
stg.frequencies_for_calibration[1][1], :, :],
|
|
||||||
r2D=stg.depth_2D[i][stg.frequencies_for_calibration[1][1], :, :],
|
|
||||||
kt=stg.kt3D[i][stg.frequencies_for_calibration[1][1], :, :])
|
|
||||||
|
|
||||||
stg.J_cross_section[i][0] = J_cross_section_freq1
|
stg.J_cross_section[i][0] = J_cross_section_freq1
|
||||||
stg.J_cross_section[i][1] = J_cross_section_freq2
|
stg.J_cross_section[i][1] = J_cross_section_freq2
|
||||||
|
|
||||||
def compute_alpha_s(self):
|
def compute_alpha_s(self):
|
||||||
|
data_id = self.combobox_acoustic_data_choice.currentIndex()
|
||||||
|
freq_1 = self.combobox_freq1.currentIndex()
|
||||||
|
freq_2 = self.combobox_freq2.currentIndex()
|
||||||
|
|
||||||
# --- Compute alpha_s ---
|
depth_data = stg.depth
|
||||||
if stg.depth_cross_section[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,):
|
if stg.depth_cross_section[data_id].shape != (0,):
|
||||||
|
depth_data = stg.depth_cross_section
|
||||||
|
|
||||||
alpha_s_freq1 = self.inv_hc.alpha_s(
|
alpha_s_freq1 = self.inv_hc.alpha_s(
|
||||||
sv=stg.sv[0],
|
sv=stg.sv[0],
|
||||||
j_cross_section=stg.J_cross_section[self.combobox_acoustic_data_choice.currentIndex()][0][
|
j_cross_section=stg.J_cross_section[data_id][0][
|
||||||
stg.sand_sample_target_indice[0][0], stg.sand_sample_target_indice[0][1]],
|
stg.sand_sample_target_indice[0][0],
|
||||||
depth=stg.depth_cross_section[self.combobox_acoustic_data_choice.currentIndex()][
|
stg.sand_sample_target_indice[0][1]
|
||||||
self.combobox_freq1.currentIndex(), stg.sand_sample_target_indice[0][0]],
|
],
|
||||||
alpha_w=stg.water_attenuation[self.combobox_acoustic_data_choice.currentIndex()][
|
depth=depth_data[data_id][
|
||||||
self.combobox_freq1.currentIndex()])
|
freq_1, stg.sand_sample_target_indice[0][0]
|
||||||
|
],
|
||||||
|
alpha_w=stg.water_attenuation[data_id][freq_1]
|
||||||
|
)
|
||||||
|
|
||||||
alpha_s_freq2 = self.inv_hc.alpha_s(
|
alpha_s_freq2 = self.inv_hc.alpha_s(
|
||||||
sv=stg.sv[1],
|
sv=stg.sv[1],
|
||||||
j_cross_section=stg.J_cross_section[self.combobox_acoustic_data_choice.currentIndex()][1][
|
j_cross_section=stg.J_cross_section[data_id][1][
|
||||||
stg.sand_sample_target_indice[1][0], stg.sand_sample_target_indice[1][1]],
|
stg.sand_sample_target_indice[1][0],
|
||||||
depth=stg.depth_cross_section[self.combobox_acoustic_data_choice.currentIndex()][
|
stg.sand_sample_target_indice[1][1]
|
||||||
self.combobox_freq2.currentIndex(), stg.sand_sample_target_indice[1][0]],
|
],
|
||||||
alpha_w=stg.water_attenuation[self.combobox_acoustic_data_choice.currentIndex()][
|
depth=depth_data[data_id][
|
||||||
self.combobox_freq2.currentIndex()])
|
freq_2, stg.sand_sample_target_indice[1][0]
|
||||||
|
],
|
||||||
else:
|
alpha_w=stg.water_attenuation[data_id][freq_2]
|
||||||
|
)
|
||||||
alpha_s_freq1 = self.inv_hc.alpha_s(
|
|
||||||
sv=stg.sv[0],
|
|
||||||
j_cross_section=stg.J_cross_section[self.combobox_acoustic_data_choice.currentIndex()][0][
|
|
||||||
stg.sand_sample_target_indice[0][0], stg.sand_sample_target_indice[0][1]],
|
|
||||||
depth=stg.depth[self.combobox_acoustic_data_choice.currentIndex()][
|
|
||||||
self.combobox_freq1.currentIndex(), stg.sand_sample_target_indice[0][0]],
|
|
||||||
alpha_w=stg.water_attenuation[self.combobox_acoustic_data_choice.currentIndex()][
|
|
||||||
self.combobox_freq1.currentIndex()])
|
|
||||||
|
|
||||||
alpha_s_freq2 = self.inv_hc.alpha_s(
|
|
||||||
sv=stg.sv[1],
|
|
||||||
j_cross_section=stg.J_cross_section[self.combobox_acoustic_data_choice.currentIndex()][1][
|
|
||||||
stg.sand_sample_target_indice[1][0], stg.sand_sample_target_indice[1][1]],
|
|
||||||
depth=stg.depth[self.combobox_acoustic_data_choice.currentIndex()][
|
|
||||||
self.combobox_freq2.currentIndex(), stg.sand_sample_target_indice[1][0]],
|
|
||||||
alpha_w=stg.water_attenuation[self.combobox_acoustic_data_choice.currentIndex()][
|
|
||||||
self.combobox_freq2.currentIndex()])
|
|
||||||
|
|
||||||
stg.alpha_s = [alpha_s_freq1, alpha_s_freq2]
|
stg.alpha_s = [alpha_s_freq1, alpha_s_freq2]
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -447,8 +447,8 @@ class SignalProcessingTab(QWidget):
|
||||||
# --------------------------------------------------------------------------------------------------------------
|
# --------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
self.pushbutton_update.clicked.connect(self.update_SignalPreprocessingTab)
|
self.pushbutton_update.clicked.connect(self.update_SignalPreprocessingTab)
|
||||||
self.pushbutton_update.clicked.connect(self.compute_average_profile_tail)
|
# self.pushbutton_update.clicked.connect(self.compute_average_profile_tail)
|
||||||
self.pushbutton_update.clicked.connect(self.plot_averaged_profile_tail)
|
# self.pushbutton_update.clicked.connect(self.plot_averaged_profile_tail)
|
||||||
|
|
||||||
self.combobox_acoustic_data_choice.currentIndexChanged.connect(self.combobox_acoustic_data_choice_change_index)
|
self.combobox_acoustic_data_choice.currentIndexChanged.connect(self.combobox_acoustic_data_choice_change_index)
|
||||||
|
|
||||||
|
|
@ -501,26 +501,39 @@ class SignalProcessingTab(QWidget):
|
||||||
- the user remove a file (in the list widget) in the first tab (Acoustic data), so that the combobox
|
- the user remove a file (in the list widget) in the first tab (Acoustic data), so that the combobox
|
||||||
of data to be processed is updated,
|
of data to be processed is updated,
|
||||||
- the user change the limits of one or all the records in the first tab (Acoustic data) """
|
- the user change the limits of one or all the records in the first tab (Acoustic data) """
|
||||||
|
if len(stg.filename_BS_raw_data) == 0:
|
||||||
|
|
||||||
self.combobox_acoustic_data_choice.clear()
|
msgBox = QMessageBox()
|
||||||
self.combobox_acoustic_data_choice.addItems(stg.filename_BS_raw_data)
|
msgBox.setWindowTitle("Compute noise from profile tail error")
|
||||||
|
msgBox.setIcon(QMessageBox.Warning)
|
||||||
|
msgBox.setText("Download acoustic data in previous tab before updating data")
|
||||||
|
msgBox.setStandardButtons(QMessageBox.Ok)
|
||||||
|
msgBox.exec()
|
||||||
|
|
||||||
if stg.noise_method[self.combobox_acoustic_data_choice.currentIndex()] == 0:
|
else:
|
||||||
|
|
||||||
self.groupbox_download_noise_file.setChecked(True)
|
self.combobox_acoustic_data_choice.clear()
|
||||||
self.groupbox_compute_noise_from_profile_tail.setChecked(False)
|
self.combobox_acoustic_data_choice.addItems(stg.filename_BS_raw_data)
|
||||||
self.groupbox_download_noise_file_toggle()
|
|
||||||
|
|
||||||
elif stg.noise_method[self.combobox_acoustic_data_choice.currentIndex()] == 1:
|
if stg.noise_method[self.combobox_acoustic_data_choice.currentIndex()] == 0:
|
||||||
|
|
||||||
self.groupbox_download_noise_file.setChecked(False)
|
self.groupbox_download_noise_file.setChecked(True)
|
||||||
self.groupbox_compute_noise_from_profile_tail.setChecked(True)
|
self.groupbox_compute_noise_from_profile_tail.setChecked(False)
|
||||||
self.groupbox_option_profile_tail_toggle()
|
self.groupbox_download_noise_file_toggle()
|
||||||
|
|
||||||
self.combobox_freq_noise_from_profile_tail.clear()
|
elif stg.noise_method[self.combobox_acoustic_data_choice.currentIndex()] == 1:
|
||||||
self.combobox_freq_noise_from_profile_tail.addItems(stg.freq_text[self.combobox_acoustic_data_choice.currentIndex()])
|
|
||||||
|
|
||||||
self.combobox_acoustic_data_choice.currentIndexChanged.connect(self.combobox_acoustic_data_choice_change_index)
|
self.groupbox_download_noise_file.setChecked(False)
|
||||||
|
self.groupbox_compute_noise_from_profile_tail.setChecked(True)
|
||||||
|
self.groupbox_option_profile_tail_toggle()
|
||||||
|
|
||||||
|
self.combobox_freq_noise_from_profile_tail.clear()
|
||||||
|
self.combobox_freq_noise_from_profile_tail.addItems(stg.freq_text[self.combobox_acoustic_data_choice.currentIndex()])
|
||||||
|
|
||||||
|
self.combobox_acoustic_data_choice.currentIndexChanged.connect(self.combobox_acoustic_data_choice_change_index)
|
||||||
|
|
||||||
|
self.compute_average_profile_tail()
|
||||||
|
self.plot_averaged_profile_tail()
|
||||||
|
|
||||||
def activate_list_of_pre_processed_data(self):
|
def activate_list_of_pre_processed_data(self):
|
||||||
for i in range(self.combobox_acoustic_data_choice.count()):
|
for i in range(self.combobox_acoustic_data_choice.count()):
|
||||||
|
|
@ -654,45 +667,65 @@ class SignalProcessingTab(QWidget):
|
||||||
|
|
||||||
# --- Plot averaged signal ---
|
# --- Plot averaged signal ---
|
||||||
|
|
||||||
if stg.BS_mean[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,):
|
if len(stg.filename_BS_raw_data) == 0:
|
||||||
|
|
||||||
self.verticalLayout_groupbox_plot_profile_tail.removeWidget(self.canvas_profile_tail)
|
msgBox = QMessageBox()
|
||||||
|
msgBox.setWindowTitle("Compute noise from profile tail error")
|
||||||
|
msgBox.setIcon(QMessageBox.Warning)
|
||||||
|
msgBox.setText("Download acoustic data in previous tab before computing noise from profile tail")
|
||||||
|
msgBox.setStandardButtons(QMessageBox.Ok)
|
||||||
|
msgBox.exec()
|
||||||
|
|
||||||
self.fig_profile_tail, self.axis_profile_tail = plt.subplots(nrows=1, ncols=1, layout='constrained')
|
elif self.combobox_acoustic_data_choice.count() == 0:
|
||||||
self.canvas_profile_tail = FigureCanvas(self.fig_profile_tail)
|
|
||||||
|
|
||||||
self.verticalLayout_groupbox_plot_profile_tail.addWidget(self.canvas_profile_tail)
|
msgBox = QMessageBox()
|
||||||
|
msgBox.setWindowTitle("Compute noise from profile tail error")
|
||||||
|
msgBox.setIcon(QMessageBox.Warning)
|
||||||
|
msgBox.setText("Refresh acoustic data before computing noise from profile tail")
|
||||||
|
msgBox.setStandardButtons(QMessageBox.Ok)
|
||||||
|
msgBox.exec()
|
||||||
|
|
||||||
self.axis_profile_tail.plot(
|
else:
|
||||||
-stg.depth[self.combobox_acoustic_data_choice.currentIndex()][self.combobox_freq_noise_from_profile_tail.currentIndex()],
|
|
||||||
stg.BS_mean[self.combobox_acoustic_data_choice.currentIndex()][self.combobox_freq_noise_from_profile_tail.currentIndex()],
|
|
||||||
color="blue", linewidth=1)
|
|
||||||
self.axis_profile_tail.plot(
|
|
||||||
-stg.depth[self.combobox_acoustic_data_choice.currentIndex()][
|
|
||||||
self.combobox_freq_noise_from_profile_tail.currentIndex()],
|
|
||||||
float(self.lineEdit_profile_tail_value.text().replace(",", ".")) *
|
|
||||||
np.ones(stg.depth[self.combobox_acoustic_data_choice.currentIndex()][
|
|
||||||
self.combobox_freq_noise_from_profile_tail.currentIndex()].shape[0]),
|
|
||||||
linestyle='dashed', linewidth=2, color='red')
|
|
||||||
|
|
||||||
self.axis_profile_tail.set_yscale('log')
|
if stg.BS_mean[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,):
|
||||||
self.axis_profile_tail.tick_params(axis='both', labelsize=8)
|
|
||||||
self.axis_profile_tail.text(.98, .03, "Depth (m)",
|
|
||||||
fontsize=8, fontweight='bold', fontname="Ubuntu", c="black", alpha=0.9,
|
|
||||||
horizontalalignment='right', verticalalignment='bottom', rotation='horizontal',
|
|
||||||
transform=self.axis_profile_tail.transAxes)
|
|
||||||
self.axis_profile_tail.text(.1, .45, "BS signal (v)",
|
|
||||||
fontsize=8, fontweight='bold', fontname="Ubuntu", c="black", alpha=0.9,
|
|
||||||
horizontalalignment='right', verticalalignment='bottom', rotation='vertical',
|
|
||||||
transform=self.axis_profile_tail.transAxes)
|
|
||||||
self.axis_profile_tail.text(.98, .85,
|
|
||||||
stg.freq_text[self.combobox_acoustic_data_choice.currentIndex()][
|
|
||||||
self.combobox_freq_noise_from_profile_tail.currentIndex()],
|
|
||||||
fontsize=10, fontweight='bold', fontname="Ubuntu", c="black", alpha=0.5,
|
|
||||||
horizontalalignment='right', verticalalignment='bottom',
|
|
||||||
transform=self.axis_profile_tail.transAxes)
|
|
||||||
|
|
||||||
self.fig_profile_tail.canvas.draw_idle()
|
self.verticalLayout_groupbox_plot_profile_tail.removeWidget(self.canvas_profile_tail)
|
||||||
|
|
||||||
|
self.fig_profile_tail, self.axis_profile_tail = plt.subplots(nrows=1, ncols=1, layout='constrained')
|
||||||
|
self.canvas_profile_tail = FigureCanvas(self.fig_profile_tail)
|
||||||
|
|
||||||
|
self.verticalLayout_groupbox_plot_profile_tail.addWidget(self.canvas_profile_tail)
|
||||||
|
|
||||||
|
self.axis_profile_tail.plot(
|
||||||
|
-stg.depth[self.combobox_acoustic_data_choice.currentIndex()][self.combobox_freq_noise_from_profile_tail.currentIndex()],
|
||||||
|
stg.BS_mean[self.combobox_acoustic_data_choice.currentIndex()][self.combobox_freq_noise_from_profile_tail.currentIndex()],
|
||||||
|
color="blue", linewidth=1)
|
||||||
|
self.axis_profile_tail.plot(
|
||||||
|
-stg.depth[self.combobox_acoustic_data_choice.currentIndex()][
|
||||||
|
self.combobox_freq_noise_from_profile_tail.currentIndex()],
|
||||||
|
float(self.lineEdit_profile_tail_value.text().replace(",", ".")) *
|
||||||
|
np.ones(stg.depth[self.combobox_acoustic_data_choice.currentIndex()][
|
||||||
|
self.combobox_freq_noise_from_profile_tail.currentIndex()].shape[0]),
|
||||||
|
linestyle='dashed', linewidth=2, color='red')
|
||||||
|
|
||||||
|
self.axis_profile_tail.set_yscale('log')
|
||||||
|
self.axis_profile_tail.tick_params(axis='both', labelsize=8)
|
||||||
|
self.axis_profile_tail.text(.98, .03, "Depth (m)",
|
||||||
|
fontsize=8, fontweight='bold', fontname="Ubuntu", c="black", alpha=0.9,
|
||||||
|
horizontalalignment='right', verticalalignment='bottom', rotation='horizontal',
|
||||||
|
transform=self.axis_profile_tail.transAxes)
|
||||||
|
self.axis_profile_tail.text(.1, .45, "BS signal (v)",
|
||||||
|
fontsize=8, fontweight='bold', fontname="Ubuntu", c="black", alpha=0.9,
|
||||||
|
horizontalalignment='right', verticalalignment='bottom', rotation='vertical',
|
||||||
|
transform=self.axis_profile_tail.transAxes)
|
||||||
|
self.axis_profile_tail.text(.98, .85,
|
||||||
|
stg.freq_text[self.combobox_acoustic_data_choice.currentIndex()][
|
||||||
|
self.combobox_freq_noise_from_profile_tail.currentIndex()],
|
||||||
|
fontsize=10, fontweight='bold', fontname="Ubuntu", c="black", alpha=0.5,
|
||||||
|
horizontalalignment='right', verticalalignment='bottom',
|
||||||
|
transform=self.axis_profile_tail.transAxes)
|
||||||
|
|
||||||
|
self.fig_profile_tail.canvas.draw_idle()
|
||||||
|
|
||||||
# ------------------------------------------------------
|
# ------------------------------------------------------
|
||||||
|
|
||||||
|
|
@ -722,82 +755,87 @@ class SignalProcessingTab(QWidget):
|
||||||
|
|
||||||
def clear_noise_data(self):
|
def clear_noise_data(self):
|
||||||
|
|
||||||
stg.BS_noise_raw_data[self.combobox_acoustic_data_choice.currentIndex()] = np.array([])
|
if len(stg.filename_BS_raw_data) == 0:
|
||||||
stg.BS_noise_averaged_data[self.combobox_acoustic_data_choice.currentIndex()] = np.array([])
|
|
||||||
stg.SNR_raw_data[self.combobox_acoustic_data_choice.currentIndex()] = np.array([])
|
|
||||||
stg.SNR_cross_section[self.combobox_acoustic_data_choice.currentIndex()] = np.array([])
|
|
||||||
stg.SNR_stream_bed[self.combobox_acoustic_data_choice.currentIndex()] = np.array([])
|
|
||||||
stg.time_noise[self.combobox_acoustic_data_choice.currentIndex()] = np.array([])
|
|
||||||
stg.noise_method[self.combobox_acoustic_data_choice.currentIndex()] = 0
|
|
||||||
stg.SNR_filter_value[self.combobox_acoustic_data_choice.currentIndex()] = 0
|
|
||||||
|
|
||||||
stg.BS_raw_data_pre_process_SNR[self.combobox_acoustic_data_choice.currentIndex()] = np.array([])
|
pass
|
||||||
stg.BS_raw_data_pre_process_average[self.combobox_acoustic_data_choice.currentIndex()] = np.array([])
|
|
||||||
|
|
||||||
stg.BS_cross_section_pre_process_SNR[self.combobox_acoustic_data_choice.currentIndex()] = np.array([])
|
else:
|
||||||
stg.BS_cross_section_pre_process_average[self.combobox_acoustic_data_choice.currentIndex()] = np.array([])
|
|
||||||
|
|
||||||
stg.BS_stream_bed_pre_process_SNR[self.combobox_acoustic_data_choice.currentIndex()] = np.array([])
|
stg.BS_noise_raw_data[self.combobox_acoustic_data_choice.currentIndex()] = np.array([])
|
||||||
stg.BS_stream_bed_pre_process_average[self.combobox_acoustic_data_choice.currentIndex()] = np.array([])
|
stg.BS_noise_averaged_data[self.combobox_acoustic_data_choice.currentIndex()] = np.array([])
|
||||||
|
stg.SNR_raw_data[self.combobox_acoustic_data_choice.currentIndex()] = np.array([])
|
||||||
|
stg.SNR_cross_section[self.combobox_acoustic_data_choice.currentIndex()] = np.array([])
|
||||||
|
stg.SNR_stream_bed[self.combobox_acoustic_data_choice.currentIndex()] = np.array([])
|
||||||
|
stg.time_noise[self.combobox_acoustic_data_choice.currentIndex()] = np.array([])
|
||||||
|
stg.SNR_filter_value[self.combobox_acoustic_data_choice.currentIndex()] = 0
|
||||||
|
|
||||||
if stg.noise_method[self.combobox_acoustic_data_choice.currentIndex()] == 0:
|
stg.BS_raw_data_pre_process_SNR[self.combobox_acoustic_data_choice.currentIndex()] = np.array([])
|
||||||
self.lineEdit_noise_file.clear()
|
stg.BS_raw_data_pre_process_average[self.combobox_acoustic_data_choice.currentIndex()] = np.array([])
|
||||||
|
|
||||||
elif stg.noise_method[self.combobox_acoustic_data_choice.currentIndex()] == 1:
|
stg.BS_cross_section_pre_process_SNR[self.combobox_acoustic_data_choice.currentIndex()] = np.array([])
|
||||||
self.lineEdit_val1.clear()
|
stg.BS_cross_section_pre_process_average[self.combobox_acoustic_data_choice.currentIndex()] = np.array([])
|
||||||
self.lineEdit_val1.setText("0.00")
|
|
||||||
|
|
||||||
self.lineEdit_val2.clear()
|
stg.BS_stream_bed_pre_process_SNR[self.combobox_acoustic_data_choice.currentIndex()] = np.array([])
|
||||||
self.lineEdit_val2.setText("0.00")
|
stg.BS_stream_bed_pre_process_average[self.combobox_acoustic_data_choice.currentIndex()] = np.array([])
|
||||||
|
print("stg.noise_method[self.combobox_acoustic_data_choice.currentIndex()]", stg.noise_method[self.combobox_acoustic_data_choice.currentIndex()])
|
||||||
|
if stg.noise_method[self.combobox_acoustic_data_choice.currentIndex()] == 0:
|
||||||
|
self.lineEdit_noise_file.clear()
|
||||||
|
|
||||||
self.lineEdit_profile_tail_value.clear()
|
elif stg.noise_method[self.combobox_acoustic_data_choice.currentIndex()] == 1:
|
||||||
self.lineEdit_profile_tail_value.setText("0.0000")
|
self.lineEdit_val1.clear()
|
||||||
|
self.lineEdit_val1.setText("0.00")
|
||||||
|
|
||||||
self.verticalLayout_groupbox_plot_profile_tail.removeWidget(self.canvas_profile_tail)
|
self.lineEdit_val2.clear()
|
||||||
self.canvas_profile_tail = FigureCanvas()
|
self.lineEdit_val2.setText("0.00")
|
||||||
self.verticalLayout_groupbox_plot_profile_tail.addWidget(self.canvas_profile_tail)
|
|
||||||
|
|
||||||
self.lineEdit_SNR_criterion.setText("0.00")
|
self.lineEdit_profile_tail_value.clear()
|
||||||
self.lineEdit_horizontal_average.setText("0.00")
|
self.lineEdit_profile_tail_value.setText("0.0000")
|
||||||
|
|
||||||
# --- Clear SNR plot ---
|
self.verticalLayout_groupbox_plot_profile_tail.removeWidget(self.canvas_profile_tail)
|
||||||
self.verticalLayout_groupbox_plot_SNR.removeWidget(self.toolbar_SNR)
|
self.canvas_profile_tail = FigureCanvas()
|
||||||
self.verticalLayout_groupbox_plot_SNR.removeWidget(self.scroll_SNR)
|
self.verticalLayout_groupbox_plot_profile_tail.addWidget(self.canvas_profile_tail)
|
||||||
|
|
||||||
self.canvas_SNR = FigureCanvas()
|
self.lineEdit_SNR_criterion.setText("0.00")
|
||||||
self.toolbar_SNR = NavigationToolBar(self.canvas_SNR, self)
|
self.lineEdit_horizontal_average.setText("0.00")
|
||||||
self.scroll_SNR.setWidget(self.canvas_SNR)
|
|
||||||
|
|
||||||
self.verticalLayout_groupbox_plot_SNR.addWidget(self.toolbar_SNR)
|
# --- Clear SNR plot ---
|
||||||
self.verticalLayout_groupbox_plot_SNR.addWidget(self.scroll_SNR)
|
self.verticalLayout_groupbox_plot_SNR.removeWidget(self.toolbar_SNR)
|
||||||
|
self.verticalLayout_groupbox_plot_SNR.removeWidget(self.scroll_SNR)
|
||||||
|
|
||||||
# --- Clear BS plot ---
|
self.canvas_SNR = FigureCanvas()
|
||||||
self.verticalLayout_groupbox_plot_pre_processed_data_2D_field.removeWidget(self.toolbar_BS)
|
self.toolbar_SNR = NavigationToolBar(self.canvas_SNR, self)
|
||||||
self.verticalLayout_groupbox_plot_pre_processed_data_2D_field.removeWidget(self.scroll_BS)
|
self.scroll_SNR.setWidget(self.canvas_SNR)
|
||||||
|
|
||||||
self.canvas_BS = FigureCanvas()
|
self.verticalLayout_groupbox_plot_SNR.addWidget(self.toolbar_SNR)
|
||||||
self.toolbar_BS = NavigationToolBar(self.canvas_BS, self)
|
self.verticalLayout_groupbox_plot_SNR.addWidget(self.scroll_SNR)
|
||||||
self.scroll_BS.setWidget(self.canvas_BS)
|
|
||||||
|
|
||||||
self.verticalLayout_groupbox_plot_pre_processed_data_2D_field.addWidget(self.toolbar_BS)
|
# --- Clear BS plot ---
|
||||||
self.verticalLayout_groupbox_plot_pre_processed_data_2D_field.addWidget(self.scroll_BS)
|
self.verticalLayout_groupbox_plot_pre_processed_data_2D_field.removeWidget(self.toolbar_BS)
|
||||||
|
self.verticalLayout_groupbox_plot_pre_processed_data_2D_field.removeWidget(self.scroll_BS)
|
||||||
|
|
||||||
self.combobox_frequency_profile.clear()
|
self.canvas_BS = FigureCanvas()
|
||||||
|
self.toolbar_BS = NavigationToolBar(self.canvas_BS, self)
|
||||||
|
self.scroll_BS.setWidget(self.canvas_BS)
|
||||||
|
|
||||||
self.verticalLayout_groupbox_plot_profile.removeWidget(self.toolbar_profile)
|
self.verticalLayout_groupbox_plot_pre_processed_data_2D_field.addWidget(self.toolbar_BS)
|
||||||
self.verticalLayout_groupbox_plot_profile.removeWidget(self.canvas_profile)
|
self.verticalLayout_groupbox_plot_pre_processed_data_2D_field.addWidget(self.scroll_BS)
|
||||||
|
|
||||||
self.canvas_profile = FigureCanvas()
|
self.combobox_frequency_profile.clear()
|
||||||
self.toolbar_profile = NavigationToolBar(self.canvas_profile, self)
|
|
||||||
|
|
||||||
self.verticalLayout_groupbox_plot_profile.addWidget(self.toolbar_profile)
|
self.verticalLayout_groupbox_plot_profile.removeWidget(self.toolbar_profile)
|
||||||
self.verticalLayout_groupbox_plot_profile.addWidget(self.canvas_profile)
|
self.verticalLayout_groupbox_plot_profile.removeWidget(self.canvas_profile)
|
||||||
|
|
||||||
self.slider.setValue(1)
|
self.canvas_profile = FigureCanvas()
|
||||||
self.slider.setMaximum(10)
|
self.toolbar_profile = NavigationToolBar(self.canvas_profile, self)
|
||||||
|
|
||||||
self.slider.setValue(0)
|
self.verticalLayout_groupbox_plot_profile.addWidget(self.toolbar_profile)
|
||||||
self.slider.setMaximum(10)
|
self.verticalLayout_groupbox_plot_profile.addWidget(self.canvas_profile)
|
||||||
|
|
||||||
|
self.slider.setValue(1)
|
||||||
|
self.slider.setMaximum(10)
|
||||||
|
|
||||||
|
self.slider.setValue(0)
|
||||||
|
self.slider.setMaximum(10)
|
||||||
|
|
||||||
def open_dialog_box(self):
|
def open_dialog_box(self):
|
||||||
|
|
||||||
|
|
@ -1221,11 +1259,19 @@ class SignalProcessingTab(QWidget):
|
||||||
|
|
||||||
def remove_point_with_snr_filter(self):
|
def remove_point_with_snr_filter(self):
|
||||||
|
|
||||||
if len(stg.BS_noise_raw_data) == 0:
|
if len(stg.filename_BS_raw_data) == 0:
|
||||||
|
msgBox = QMessageBox()
|
||||||
|
msgBox.setWindowTitle("Compute noise from profile tail error")
|
||||||
|
msgBox.setIcon(QMessageBox.Warning)
|
||||||
|
msgBox.setText("Download acoustic data in previous tab before applying SNR filter")
|
||||||
|
msgBox.setStandardButtons(QMessageBox.Ok)
|
||||||
|
msgBox.exec()
|
||||||
|
|
||||||
|
elif len(stg.BS_noise_raw_data) == 0:
|
||||||
msgBox = QMessageBox()
|
msgBox = QMessageBox()
|
||||||
msgBox.setWindowTitle("SNR filter Error")
|
msgBox.setWindowTitle("SNR filter Error")
|
||||||
msgBox.setIcon(QMessageBox.Warning)
|
msgBox.setIcon(QMessageBox.Warning)
|
||||||
msgBox.setText("Load Noise data from acoustic data tab before using SNR filter")
|
msgBox.setText("Define noise data (file or profile tail) before using SNR filter")
|
||||||
msgBox.setStandardButtons(QMessageBox.Ok)
|
msgBox.setStandardButtons(QMessageBox.Ok)
|
||||||
msgBox.exec()
|
msgBox.exec()
|
||||||
|
|
||||||
|
|
@ -1504,105 +1550,123 @@ class SignalProcessingTab(QWidget):
|
||||||
|
|
||||||
def compute_averaged_BS_data(self):
|
def compute_averaged_BS_data(self):
|
||||||
|
|
||||||
kernel_avg = np.ones(2 * int(float(self.lineEdit_horizontal_average.text().replace(",", "."))) + 1)
|
if len(stg.filename_BS_raw_data) == 0:
|
||||||
print(kernel_avg)
|
msgBox = QMessageBox()
|
||||||
|
msgBox.setWindowTitle("Compute noise from profile tail error")
|
||||||
|
msgBox.setIcon(QMessageBox.Warning)
|
||||||
|
msgBox.setText("Download acoustic data in previous tab before applying SNR filter")
|
||||||
|
msgBox.setStandardButtons(QMessageBox.Ok)
|
||||||
|
msgBox.exec()
|
||||||
|
|
||||||
stg.Nb_cells_to_average_BS_signal[self.combobox_acoustic_data_choice.currentIndex()] = (
|
elif len(stg.BS_noise_raw_data) == 0:
|
||||||
float(self.lineEdit_horizontal_average.text().replace(",", ".")))
|
msgBox = QMessageBox()
|
||||||
|
msgBox.setWindowTitle("SNR filter Error")
|
||||||
if stg.time_cross_section[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,):
|
msgBox.setIcon(QMessageBox.Warning)
|
||||||
|
msgBox.setText("Define noise data (file or profile tail) before using SNR filter")
|
||||||
if stg.depth_cross_section[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,):
|
msgBox.setStandardButtons(QMessageBox.Ok)
|
||||||
|
msgBox.exec()
|
||||||
x_time = stg.time_cross_section[self.combobox_acoustic_data_choice.currentIndex()]
|
|
||||||
y_depth = stg.depth_cross_section[self.combobox_acoustic_data_choice.currentIndex()]
|
|
||||||
|
|
||||||
elif stg.depth[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,):
|
|
||||||
|
|
||||||
x_time = stg.time_cross_section[self.combobox_acoustic_data_choice.currentIndex()]
|
|
||||||
y_depth = stg.depth[self.combobox_acoustic_data_choice.currentIndex()]
|
|
||||||
|
|
||||||
else:
|
else:
|
||||||
|
|
||||||
if stg.depth_cross_section[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,):
|
kernel_avg = np.ones(2 * int(float(self.lineEdit_horizontal_average.text().replace(",", "."))) + 1)
|
||||||
|
print(kernel_avg)
|
||||||
|
|
||||||
x_time = stg.time[self.combobox_acoustic_data_choice.currentIndex()]
|
stg.Nb_cells_to_average_BS_signal[self.combobox_acoustic_data_choice.currentIndex()] = (
|
||||||
y_depth = stg.depth_cross_section[self.combobox_acoustic_data_choice.currentIndex()]
|
float(self.lineEdit_horizontal_average.text().replace(",", ".")))
|
||||||
|
|
||||||
elif stg.depth[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,):
|
if stg.time_cross_section[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,):
|
||||||
|
|
||||||
x_time = stg.time[self.combobox_acoustic_data_choice.currentIndex()]
|
if stg.depth_cross_section[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,):
|
||||||
y_depth = stg.depth[self.combobox_acoustic_data_choice.currentIndex()]
|
|
||||||
|
|
||||||
if stg.BS_stream_bed_pre_process_SNR[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,):
|
x_time = stg.time_cross_section[self.combobox_acoustic_data_choice.currentIndex()]
|
||||||
|
y_depth = stg.depth_cross_section[self.combobox_acoustic_data_choice.currentIndex()]
|
||||||
|
|
||||||
stg.BS_stream_bed_pre_process_average[self.combobox_acoustic_data_choice.currentIndex()] = (deepcopy(
|
elif stg.depth[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,):
|
||||||
stg.BS_stream_bed_pre_process_SNR[self.combobox_acoustic_data_choice.currentIndex()]))
|
|
||||||
|
|
||||||
for f, _ in enumerate(stg.freq[self.combobox_acoustic_data_choice.currentIndex()]):
|
x_time = stg.time_cross_section[self.combobox_acoustic_data_choice.currentIndex()]
|
||||||
for i in range(y_depth.shape[1]):
|
y_depth = stg.depth[self.combobox_acoustic_data_choice.currentIndex()]
|
||||||
|
|
||||||
stg.BS_stream_bed_pre_process_average[self.combobox_acoustic_data_choice.currentIndex()][f, i, :] = (
|
else:
|
||||||
convolve(stg.BS_stream_bed_pre_process_SNR[self.combobox_acoustic_data_choice.currentIndex()][f, i, :],
|
|
||||||
kernel_avg))
|
|
||||||
|
|
||||||
elif stg.BS_cross_section_pre_process_SNR[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,):
|
if stg.depth_cross_section[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,):
|
||||||
|
|
||||||
stg.BS_cross_section_pre_process_average[self.combobox_acoustic_data_choice.currentIndex()] = (deepcopy(
|
x_time = stg.time[self.combobox_acoustic_data_choice.currentIndex()]
|
||||||
stg.BS_cross_section_pre_process_SNR[self.combobox_acoustic_data_choice.currentIndex()]))
|
y_depth = stg.depth_cross_section[self.combobox_acoustic_data_choice.currentIndex()]
|
||||||
|
|
||||||
for f, _ in enumerate(stg.freq[self.combobox_acoustic_data_choice.currentIndex()]):
|
elif stg.depth[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,):
|
||||||
for i in range(y_depth.shape[1]):
|
|
||||||
|
|
||||||
stg.BS_cross_section_pre_process_average[self.combobox_acoustic_data_choice.currentIndex()][f, i, :] = (
|
x_time = stg.time[self.combobox_acoustic_data_choice.currentIndex()]
|
||||||
convolve(stg.BS_cross_section_pre_process_SNR[self.combobox_acoustic_data_choice.currentIndex()][f, i, :],
|
y_depth = stg.depth[self.combobox_acoustic_data_choice.currentIndex()]
|
||||||
kernel_avg))
|
|
||||||
|
|
||||||
elif stg.BS_raw_data_pre_process_SNR[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,):
|
if stg.BS_stream_bed_pre_process_SNR[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,):
|
||||||
|
|
||||||
stg.BS_raw_data_pre_process_average[self.combobox_acoustic_data_choice.currentIndex()] = (deepcopy(
|
stg.BS_stream_bed_pre_process_average[self.combobox_acoustic_data_choice.currentIndex()] = (deepcopy(
|
||||||
stg.BS_raw_data_pre_process_SNR[self.combobox_acoustic_data_choice.currentIndex()]))
|
stg.BS_stream_bed_pre_process_SNR[self.combobox_acoustic_data_choice.currentIndex()]))
|
||||||
|
|
||||||
for f, _ in enumerate(stg.freq[self.combobox_acoustic_data_choice.currentIndex()]):
|
for f, _ in enumerate(stg.freq[self.combobox_acoustic_data_choice.currentIndex()]):
|
||||||
for i in range(y_depth.shape[1]):
|
for i in range(y_depth.shape[1]):
|
||||||
|
|
||||||
stg.BS_raw_data_pre_process_average[self.combobox_acoustic_data_choice.currentIndex()][f, i, :] = (
|
stg.BS_stream_bed_pre_process_average[self.combobox_acoustic_data_choice.currentIndex()][f, i, :] = (
|
||||||
convolve(stg.BS_raw_data_pre_process_SNR[self.combobox_acoustic_data_choice.currentIndex()][f, i, :],
|
convolve(stg.BS_stream_bed_pre_process_SNR[self.combobox_acoustic_data_choice.currentIndex()][f, i, :],
|
||||||
kernel_avg))
|
kernel_avg))
|
||||||
|
|
||||||
elif stg.BS_stream_bed[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,):
|
elif stg.BS_cross_section_pre_process_SNR[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,):
|
||||||
|
|
||||||
stg.BS_stream_bed_pre_process_average[self.combobox_acoustic_data_choice.currentIndex()] = (deepcopy(
|
stg.BS_cross_section_pre_process_average[self.combobox_acoustic_data_choice.currentIndex()] = (deepcopy(
|
||||||
stg.BS_stream_bed[self.combobox_acoustic_data_choice.currentIndex()]))
|
stg.BS_cross_section_pre_process_SNR[self.combobox_acoustic_data_choice.currentIndex()]))
|
||||||
|
|
||||||
for f, _ in enumerate(stg.freq[self.combobox_acoustic_data_choice.currentIndex()]):
|
for f, _ in enumerate(stg.freq[self.combobox_acoustic_data_choice.currentIndex()]):
|
||||||
for i in range(y_depth.shape[1]):
|
for i in range(y_depth.shape[1]):
|
||||||
stg.BS_stream_bed_pre_process_average[self.combobox_acoustic_data_choice.currentIndex()][f, i, :] = (
|
|
||||||
convolve(stg.BS_stream_bed[self.combobox_acoustic_data_choice.currentIndex()][f, i, :], kernel_avg))
|
|
||||||
|
|
||||||
elif stg.BS_cross_section[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,):
|
stg.BS_cross_section_pre_process_average[self.combobox_acoustic_data_choice.currentIndex()][f, i, :] = (
|
||||||
|
convolve(stg.BS_cross_section_pre_process_SNR[self.combobox_acoustic_data_choice.currentIndex()][f, i, :],
|
||||||
|
kernel_avg))
|
||||||
|
|
||||||
stg.BS_cross_section_pre_process_average[self.combobox_acoustic_data_choice.currentIndex()] = (deepcopy(
|
elif stg.BS_raw_data_pre_process_SNR[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,):
|
||||||
stg.BS_cross_section[self.combobox_acoustic_data_choice.currentIndex()]))
|
|
||||||
|
|
||||||
for f, _ in enumerate(stg.freq[self.combobox_acoustic_data_choice.currentIndex()]):
|
stg.BS_raw_data_pre_process_average[self.combobox_acoustic_data_choice.currentIndex()] = (deepcopy(
|
||||||
for i in range(y_depth.shape[1]):
|
stg.BS_raw_data_pre_process_SNR[self.combobox_acoustic_data_choice.currentIndex()]))
|
||||||
stg.BS_cross_section_pre_process_average[self.combobox_acoustic_data_choice.currentIndex()][f, i, :] = (
|
|
||||||
convolve(stg.BS_cross_section[self.combobox_acoustic_data_choice.currentIndex()][f, i, :],
|
|
||||||
kernel_avg))
|
|
||||||
|
|
||||||
elif stg.BS_raw_data[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,):
|
for f, _ in enumerate(stg.freq[self.combobox_acoustic_data_choice.currentIndex()]):
|
||||||
|
for i in range(y_depth.shape[1]):
|
||||||
|
|
||||||
stg.BS_raw_data_pre_process_average[self.combobox_acoustic_data_choice.currentIndex()] = (deepcopy(
|
stg.BS_raw_data_pre_process_average[self.combobox_acoustic_data_choice.currentIndex()][f, i, :] = (
|
||||||
stg.BS_raw_data[self.combobox_acoustic_data_choice.currentIndex()]))
|
convolve(stg.BS_raw_data_pre_process_SNR[self.combobox_acoustic_data_choice.currentIndex()][f, i, :],
|
||||||
|
kernel_avg))
|
||||||
|
|
||||||
for f, _ in enumerate(stg.freq[self.combobox_acoustic_data_choice.currentIndex()]):
|
elif stg.BS_stream_bed[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,):
|
||||||
for i in range(y_depth.shape[1]):
|
|
||||||
stg.BS_raw_data_pre_process_average[self.combobox_acoustic_data_choice.currentIndex()][f, i, :] = (
|
|
||||||
convolve(stg.BS_raw_data[self.combobox_acoustic_data_choice.currentIndex()][f, i, :], kernel_avg))
|
|
||||||
|
|
||||||
self.plot_pre_processed_BS_signal()
|
stg.BS_stream_bed_pre_process_average[self.combobox_acoustic_data_choice.currentIndex()] = (deepcopy(
|
||||||
self.update_plot_pre_processed_profile()
|
stg.BS_stream_bed[self.combobox_acoustic_data_choice.currentIndex()]))
|
||||||
|
|
||||||
|
for f, _ in enumerate(stg.freq[self.combobox_acoustic_data_choice.currentIndex()]):
|
||||||
|
for i in range(y_depth.shape[1]):
|
||||||
|
stg.BS_stream_bed_pre_process_average[self.combobox_acoustic_data_choice.currentIndex()][f, i, :] = (
|
||||||
|
convolve(stg.BS_stream_bed[self.combobox_acoustic_data_choice.currentIndex()][f, i, :], kernel_avg))
|
||||||
|
|
||||||
|
elif stg.BS_cross_section[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,):
|
||||||
|
|
||||||
|
stg.BS_cross_section_pre_process_average[self.combobox_acoustic_data_choice.currentIndex()] = (deepcopy(
|
||||||
|
stg.BS_cross_section[self.combobox_acoustic_data_choice.currentIndex()]))
|
||||||
|
|
||||||
|
for f, _ in enumerate(stg.freq[self.combobox_acoustic_data_choice.currentIndex()]):
|
||||||
|
for i in range(y_depth.shape[1]):
|
||||||
|
stg.BS_cross_section_pre_process_average[self.combobox_acoustic_data_choice.currentIndex()][f, i, :] = (
|
||||||
|
convolve(stg.BS_cross_section[self.combobox_acoustic_data_choice.currentIndex()][f, i, :],
|
||||||
|
kernel_avg))
|
||||||
|
|
||||||
|
elif stg.BS_raw_data[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,):
|
||||||
|
|
||||||
|
stg.BS_raw_data_pre_process_average[self.combobox_acoustic_data_choice.currentIndex()] = (deepcopy(
|
||||||
|
stg.BS_raw_data[self.combobox_acoustic_data_choice.currentIndex()]))
|
||||||
|
|
||||||
|
for f, _ in enumerate(stg.freq[self.combobox_acoustic_data_choice.currentIndex()]):
|
||||||
|
for i in range(y_depth.shape[1]):
|
||||||
|
stg.BS_raw_data_pre_process_average[self.combobox_acoustic_data_choice.currentIndex()][f, i, :] = (
|
||||||
|
convolve(stg.BS_raw_data[self.combobox_acoustic_data_choice.currentIndex()][f, i, :], kernel_avg))
|
||||||
|
|
||||||
|
self.plot_pre_processed_BS_signal()
|
||||||
|
self.update_plot_pre_processed_profile()
|
||||||
|
|
||||||
def plot_pre_processed_profile(self):
|
def plot_pre_processed_profile(self):
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue