mirror of
https://forgemia.inra.fr/theophile.terraz/acoused.git
synced 2026-10-30 03:10:40 +01:00
Aquascat data are adapted to UBSediFlow data. The 3D array backscatter acoustic signal is reshaped into frequency shape * depth shape * time shape. Depth and time arrays are transformed into 2D arrays: each line corresponds to a frequency. As the Aquascat data have the same depth and time values for all frequencies, we simply repeat the same line.
This commit is contained in:
1 parent
426c68c880
commit
0e4899da9c
2 files changed
+75
-56
No files matched your search
+48
-48
@@ -846,51 +846,51 @@ class AcousticDataTab(QWidget):
|
||||
|
||||
|
||||
def fill_table(self):
|
||||
if self.combobox_ABS_system_choice.currentIndex() == 1:
|
||||
if ((self.lineEdit_acoustic_file.text()) and (self.lineEdit_noise_file.text())):
|
||||
stg.DataFrame_acoustic = pd.DataFrame(
|
||||
np.concatenate((stg.time_reshape, stg.BS_raw_data_reshape, stg.snr_reshape), axis=1),
|
||||
columns=list(map(str, ["Time"] + ["BS - " + f for f in stg.freq_text] +
|
||||
["SNR - " + f for f in stg.freq_text])))
|
||||
self.tableModel = TableModel(stg.DataFrame_acoustic)
|
||||
self.tableView.setModel(self.tableModel)
|
||||
elif self.lineEdit_acoustic_file.text():
|
||||
stg.DataFrame_acoustic = pd.DataFrame(
|
||||
np.concatenate((stg.time_reshape, stg.BS_raw_data_reshape), axis=1),
|
||||
columns=list(map(str, ["Time"] + ["BS - " + f for f in stg.freq_text])))
|
||||
self.tableModel = TableModel(stg.DataFrame_acoustic)
|
||||
self.tableView.setModel(self.tableModel)
|
||||
else:
|
||||
msgBox = QMessageBox()
|
||||
msgBox.setWindowTitle("Fill table Error")
|
||||
msgBox.setIcon(QMessageBox.Warning)
|
||||
msgBox.setText("Download files before fill table")
|
||||
msgBox.setStandardButtons(QMessageBox.Ok)
|
||||
msgBox.exec()
|
||||
# if self.combobox_ABS_system_choice.currentIndex() == 2:
|
||||
# if ((self.lineEdit_acoustic_file.text()) and (self.lineEdit_noise_file.text())):
|
||||
# stg.DataFrame_acoustic = pd.DataFrame(
|
||||
# np.concatenate((stg.time_reshape, stg.BS_raw_data_reshape, stg.snr_reshape), axis=1),
|
||||
# columns=list(map(str, ["Time"] + ["BS - " + f for f in stg.freq_text] +
|
||||
# ["SNR - " + f for f in stg.freq_text])))
|
||||
# self.tableModel = TableModel(stg.DataFrame_acoustic)
|
||||
# self.tableView.setModel(self.tableModel)
|
||||
# elif self.lineEdit_acoustic_file.text():
|
||||
# stg.DataFrame_acoustic = pd.DataFrame(
|
||||
# np.concatenate((stg.time_reshape, stg.BS_raw_data_reshape), axis=1),
|
||||
# columns=list(map(str, ["Time"] + ["BS - " + f for f in stg.freq_text])))
|
||||
# self.tableModel = TableModel(stg.DataFrame_acoustic)
|
||||
# self.tableView.setModel(self.tableModel)
|
||||
# else:
|
||||
# msgBox = QMessageBox()
|
||||
# msgBox.setWindowTitle("Fill table Error")
|
||||
# msgBox.setIcon(QMessageBox.Warning)
|
||||
# msgBox.setText("Download files before fill table")
|
||||
# msgBox.setStandardButtons(QMessageBox.Ok)
|
||||
# msgBox.exec()
|
||||
|
||||
elif self.combobox_ABS_system_choice.currentIndex() == 2:
|
||||
if ((self.lineEdit_acoustic_file.text()) and (self.lineEdit_noise_file.text())):
|
||||
stg.DataFrame_acoustic = pd.DataFrame(
|
||||
np.concatenate((stg.time_reshape, stg.BS_raw_data_reshape, stg.time_snr_reshape, stg.snr_reshape), axis=1),
|
||||
columns=list(map(str, ["Time BS - " + f for f in stg.freq_text] +
|
||||
["BS - " + f for f in stg.freq_text] +
|
||||
["Time SNR - " + f for f in stg.freq_text] +
|
||||
["SNR - " + f for f in stg.freq_text])))
|
||||
self.tableModel = TableModel(stg.DataFrame_acoustic)
|
||||
self.tableView.setModel(self.tableModel)
|
||||
elif self.lineEdit_acoustic_file.text():
|
||||
stg.DataFrame_acoustic = pd.DataFrame(
|
||||
np.concatenate((stg.time_reshape, stg.BS_raw_data_reshape), axis=1),
|
||||
columns=list(map(str, ["Time BS - " + f for f in stg.freq_text] + ["BS - " + f for f in stg.freq_text])))
|
||||
self.tableModel = TableModel(stg.DataFrame_acoustic)
|
||||
self.tableView.setModel(self.tableModel)
|
||||
else:
|
||||
msgBox = QMessageBox()
|
||||
msgBox.setWindowTitle("Fill table Error")
|
||||
msgBox.setIcon(QMessageBox.Warning)
|
||||
msgBox.setText("Download files before fill table")
|
||||
msgBox.setStandardButtons(QMessageBox.Ok)
|
||||
msgBox.exec()
|
||||
# elif self.combobox_ABS_system_choice.currentIndex() == 1:
|
||||
if ((self.lineEdit_acoustic_file.text()) and (self.lineEdit_noise_file.text())):
|
||||
stg.DataFrame_acoustic = pd.DataFrame(
|
||||
np.concatenate((stg.time_reshape, stg.BS_raw_data_reshape, stg.time_snr_reshape, stg.snr_reshape), axis=1),
|
||||
columns=list(map(str, ["Time BS - " + f for f in stg.freq_text] +
|
||||
["BS - " + f for f in stg.freq_text] +
|
||||
["Time SNR - " + f for f in stg.freq_text] +
|
||||
["SNR - " + f for f in stg.freq_text])))
|
||||
self.tableModel = TableModel(stg.DataFrame_acoustic)
|
||||
self.tableView.setModel(self.tableModel)
|
||||
elif self.lineEdit_acoustic_file.text():
|
||||
stg.DataFrame_acoustic = pd.DataFrame(
|
||||
np.concatenate((stg.time_reshape, stg.BS_raw_data_reshape), axis=1),
|
||||
columns=list(map(str, ["Time BS - " + f for f in stg.freq_text] + ["BS - " + f for f in stg.freq_text])))
|
||||
self.tableModel = TableModel(stg.DataFrame_acoustic)
|
||||
self.tableView.setModel(self.tableModel)
|
||||
else:
|
||||
msgBox = QMessageBox()
|
||||
msgBox.setWindowTitle("Fill table Error")
|
||||
msgBox.setIcon(QMessageBox.Warning)
|
||||
msgBox.setText("Download files before fill table")
|
||||
msgBox.setStandardButtons(QMessageBox.Ok)
|
||||
msgBox.exec()
|
||||
|
||||
def export_table(self):
|
||||
if self.tableWidget.columnCount() == 10:
|
||||
@@ -978,7 +978,7 @@ class AcousticDataTab(QWidget):
|
||||
print(f"tmax {stg.tmax}")
|
||||
|
||||
pcm = self.axis_BS[f].pcolormesh(
|
||||
stg.time[f, int(stg.tmin[f]):int(stg.tmax[f])], stg.r[f, :],
|
||||
stg.time[f, int(stg.tmin[f]):int(stg.tmax[f])], -stg.r[f, :],
|
||||
stg.BS_raw_data[f, :, int(stg.tmin[f]):int(stg.tmax[f])],
|
||||
cmap='viridis', norm=LogNorm(vmin=val_min, vmax=val_max))
|
||||
|
||||
@@ -1054,7 +1054,7 @@ class AcousticDataTab(QWidget):
|
||||
|
||||
# print("stg.t[f, :].shape ", stg.t[f])
|
||||
# print("stg.r[f, :].shape ", stg.r[f, :])
|
||||
pcm = self.axis_BS[f].pcolormesh(stg.t[f, :], stg.r[f, :], stg.BS_data[f, :, :],
|
||||
pcm = self.axis_BS[f].pcolormesh(stg.t[f, :], -stg.r[f, :], stg.BS_data[f, :, :],
|
||||
cmap='viridis', norm=LogNorm(vmin=val_min, vmax=val_max))
|
||||
|
||||
self.axis_BS[f].text(1, .70, stg.freq_text[f],
|
||||
@@ -1180,7 +1180,7 @@ class AcousticDataTab(QWidget):
|
||||
# print(f"levels = {levels}")
|
||||
# print(f"norm = {norm.boundaries}")
|
||||
|
||||
cf = self.axis_SNR[f].contourf(x[f, :, :], y[f, :, :], stg.snr[f, :, :])#, levels, cmap='gist_rainbow', norm=norm)
|
||||
cf = self.axis_SNR[f].contourf(x[f, :, :], -y[f, :, :], stg.snr[f, :, :])#, levels, cmap='gist_rainbow', norm=norm)
|
||||
|
||||
self.axis_SNR[f].text(1, .70, stg.freq_text[f],
|
||||
fontsize=14, fontweight='bold', fontname="Ubuntu", c="black", alpha=0.5,
|
||||
@@ -1314,7 +1314,7 @@ class AcousticDataTab(QWidget):
|
||||
# print(f"norm = {norm.boundaries}")
|
||||
|
||||
cf = self.axis_SNR[f].contourf(x[f, :, int(stg.tmin_snr[f]):int(stg.tmax_snr[f])],
|
||||
y[f, :, int(stg.tmin_snr[f]):int(stg.tmax_snr[f])],
|
||||
-y[f, :, int(stg.tmin_snr[f]):int(stg.tmax_snr[f])],
|
||||
stg.snr[f, :, int(stg.tmin_snr[f]):int(stg.tmax_snr[f])]) # , levels, cmap='gist_rainbow', norm=norm)
|
||||
|
||||
self.axis_SNR[f].text(1, .70, stg.freq_text[f],
|
||||
|
||||
Reference in new issue
Block a user