Compare commits

...

5 Commits

7 changed files with 159 additions and 52 deletions

View File

@ -560,7 +560,6 @@ class ReadTableForOpen:
+ list(stg.radius_grain_sand) + list(stg.radius_grain_sand)
) )
@trace
def read_table_table_sediment_data(self): def read_table_table_sediment_data(self):
np_f64_parse = lambda d: np.frombuffer(d, dtype=np.float64) np_f64_parse = lambda d: np.frombuffer(d, dtype=np.float64)
@ -618,7 +617,6 @@ class ReadTableForOpen:
logger.debug(f"fine: {stg.Ctot_fine}, sand: {stg.sample_sand}") logger.debug(f"fine: {stg.Ctot_fine}, sand: {stg.sample_sand}")
@trace
def read_table_table_calibration_parameters(self): def read_table_table_calibration_parameters(self):
np_f64_parse = lambda d: np.frombuffer(d, dtype=np.float64) np_f64_parse = lambda d: np.frombuffer(d, dtype=np.float64)
@ -681,7 +679,6 @@ class ReadTableForOpen:
) )
) )
@trace
def read_table_table_calibration(self): def read_table_table_calibration(self):
np_f64_parse = lambda d: np.frombuffer(d, dtype=np.float64) np_f64_parse = lambda d: np.frombuffer(d, dtype=np.float64)
@ -714,7 +711,6 @@ class ReadTableForOpen:
stg.depth_real = np_f64_parse(next(it)).tolist() stg.depth_real = np_f64_parse(next(it)).tolist()
stg.lin_reg = np_f64_parse(next(it)).tolist() stg.lin_reg = np_f64_parse(next(it)).tolist()
@trace
def read_table_table_notes(self): def read_table_table_notes(self):
np_f64_parse = lambda d: np.frombuffer(d, dtype=np.float64) np_f64_parse = lambda d: np.frombuffer(d, dtype=np.float64)

View File

@ -81,6 +81,7 @@ class AcousticDataTab(QWidget):
super().__init__() super().__init__()
self._setup_icons() self._setup_icons()
self._setup_attrs()
self.calib_kt = CalibrationConstantKt() self.calib_kt = CalibrationConstantKt()
@ -731,10 +732,12 @@ class AcousticDataTab(QWidget):
self.icon_between = QPixmap(path_icon("between.png")) self.icon_between = QPixmap(path_icon("between.png"))
self.icon_refresh = QIcon(path_icon("update.png")) self.icon_refresh = QIcon(path_icon("update.png"))
def _setup_attrs(self):
self.fig_profile = None
self.fig_BS = None
# -------------------- Functions for Acoustic dataTab -------------------- # -------------------- Functions for Acoustic dataTab --------------------
@trace
def full_update(self): def full_update(self):
logger.debug(f"{__name__}: Update") logger.debug(f"{__name__}: Update")
self.blockSignals(True) self.blockSignals(True)
@ -1393,6 +1396,7 @@ class AcousticDataTab(QWidget):
self.open_acoustic_data() self.open_acoustic_data()
@trace
def open_acoustic_data(self): def open_acoustic_data(self):
# --- Fill lineEdit with path and file names + load acoustic data --- # --- Fill lineEdit with path and file names + load acoustic data ---
# --- fill date, hour and measurements information + fill frequency combobox for bottom detection --- # --- fill date, hour and measurements information + fill frequency combobox for bottom detection ---
@ -2379,6 +2383,9 @@ class AcousticDataTab(QWidget):
layout.removeWidget(self.toolbar_BS) layout.removeWidget(self.toolbar_BS)
layout.removeWidget(self.scroll_BS) layout.removeWidget(self.scroll_BS)
if self.fig_BS is not None:
self.fig_BS.clear()
self.fig_BS, self.axis_BS = plt.subplots( self.fig_BS, self.axis_BS = plt.subplots(
nrows=stg.freq[file_id].shape[0], nrows=stg.freq[file_id].shape[0],
ncols=1, sharex=False, sharey=False, ncols=1, sharex=False, sharey=False,
@ -2465,6 +2472,9 @@ class AcousticDataTab(QWidget):
return return
if len(self.axis_BS.tolist()) != stg.freq[data_id].shape[0]: if len(self.axis_BS.tolist()) != stg.freq[data_id].shape[0]:
if self.fig_BS is not None:
self.fig_BS.clear()
self.fig_BS, self.axis_BS = plt.subplots( self.fig_BS, self.axis_BS = plt.subplots(
nrows=stg.freq[data_id].shape[0], nrows=stg.freq[data_id].shape[0],
ncols=1, ncols=1,
@ -2553,6 +2563,9 @@ class AcousticDataTab(QWidget):
self.verticalLayout_groupbox_plot_profile.removeWidget(self.canvas_plot_profile) self.verticalLayout_groupbox_plot_profile.removeWidget(self.canvas_plot_profile)
# --- Figure to plot profiles --- # --- Figure to plot profiles ---
if self.fig_profile is not None:
self.fig_profile.clear()
self.fig_profile, self.axis_profile = plt.subplots(nrows=1, ncols=1, layout="constrained") self.fig_profile, self.axis_profile = plt.subplots(nrows=1, ncols=1, layout="constrained")
self.canvas_plot_profile = FigureCanvas(self.fig_profile) self.canvas_plot_profile = FigureCanvas(self.fig_profile)
self.toolbar_profile = NavigationToolBar(self.canvas_plot_profile, self) self.toolbar_profile = NavigationToolBar(self.canvas_plot_profile, self)
@ -2867,10 +2880,9 @@ class AcousticDataTab(QWidget):
break break
else: else:
ind_bottom = np.where( ind_bottom = np.where(
(BS_smooth[ind_min:ind_max, d]) (BS_smooth[ind_min:ind_max, d]) == val_bottom[d]
== val_bottom[d]
)[0][0] )[0][0]
np.append(stg.ind_bottom, ind_bottom) # np.append(stg.ind_bottom, ind_bottom)
r_bottom[d] = depth_data[data_id][ r_bottom[d] = depth_data[data_id][
freq_id, ind_bottom + ind_min freq_id, ind_bottom + ind_min

View File

@ -64,6 +64,7 @@ class AcousticInversionTab(QWidget):
self.inv_hc = AcousticInversionMethodHighConcentration() self.inv_hc = AcousticInversionMethodHighConcentration()
self._setup_icons() self._setup_icons()
self._setup_attrs()
self._setup_general_layout(widget_tab) self._setup_general_layout(widget_tab)
self._setup_connections() self._setup_connections()
@ -444,7 +445,14 @@ class AcousticInversionTab(QWidget):
self.pushbutton_plot_sand_sample_choice\ self.pushbutton_plot_sand_sample_choice\
.clicked.connect(self.plot_measured_vs_inverted_SSC_sand) .clicked.connect(self.plot_measured_vs_inverted_SSC_sand)
@trace def _setup_attrs(self):
self.figure_SSC_fine = None
self.figure_SSC_sand = None
self.figure_vertical_profile_SSC_fine = None
self.figure_vertical_profile_SSC_sand = None
self.figure_measured_vs_inverted_fine = None
self.figure_measured_vs_inverted_sand = None
def full_update(self): def full_update(self):
logger.debug(f"{__name__}: Update") logger.debug(f"{__name__}: Update")
self.blockSignals(True) self.blockSignals(True)
@ -585,6 +593,9 @@ class AcousticInversionTab(QWidget):
self.verticalLayout_groupbox_plot_SSC_fine.removeWidget(self.toolbar_SSC_fine) self.verticalLayout_groupbox_plot_SSC_fine.removeWidget(self.toolbar_SSC_fine)
self.verticalLayout_groupbox_plot_SSC_fine.removeWidget(self.canvas_SSC_fine) self.verticalLayout_groupbox_plot_SSC_fine.removeWidget(self.canvas_SSC_fine)
if self.figure_SSC_fine is not None:
self.figure_SSC_fine.clear()
self.figure_SSC_fine, self.axis_SSC_fine = plt.subplots( self.figure_SSC_fine, self.axis_SSC_fine = plt.subplots(
nrows=1, ncols=1, layout="constrained" nrows=1, ncols=1, layout="constrained"
) )
@ -710,6 +721,9 @@ class AcousticInversionTab(QWidget):
self.verticalLayout_groupbox_plot_vertical_profile_fine\ self.verticalLayout_groupbox_plot_vertical_profile_fine\
.removeWidget(self.canvas_profile_fine) .removeWidget(self.canvas_profile_fine)
if self.figure_vertical_profile_SSC_fine is not None:
self.figure_vertical_profile_SSC_fine.clear()
fig, ax = plt.subplots(nrows=1, ncols=1, layout="constrained") fig, ax = plt.subplots(nrows=1, ncols=1, layout="constrained")
self.figure_vertical_profile_SSC_fine = fig self.figure_vertical_profile_SSC_fine = fig
self.axis_vertical_profile_SSC_fine = ax self.axis_vertical_profile_SSC_fine = ax
@ -990,6 +1004,9 @@ class AcousticInversionTab(QWidget):
self.canvas_inverted_vs_measured_SSC_fine, self self.canvas_inverted_vs_measured_SSC_fine, self
) )
else: else:
if self.figure_measured_vs_inverted_fine is not None:
self.figure_measured_vs_inverted_fine.clear()
fig, ax = plt.subplots(nrows=1, ncols=1, layout="constrained") fig, ax = plt.subplots(nrows=1, ncols=1, layout="constrained")
self.figure_measured_vs_inverted_fine = fig self.figure_measured_vs_inverted_fine = fig
@ -1130,6 +1147,9 @@ class AcousticInversionTab(QWidget):
self.canvas_SSC_sand = FigureCanvas() self.canvas_SSC_sand = FigureCanvas()
self.toolbar_SSC_sand = NavigationToolBar(self.canvas_SSC_sand, self) self.toolbar_SSC_sand = NavigationToolBar(self.canvas_SSC_sand, self)
else: else:
if self.figure_SSC_sand is not None:
self.figure_SSC_sand.clear()
self.figure_SSC_sand, self.axis_SSC_sand = plt.subplots( self.figure_SSC_sand, self.axis_SSC_sand = plt.subplots(
nrows=1, ncols=1, layout="constrained" nrows=1, ncols=1, layout="constrained"
) )
@ -1254,8 +1274,14 @@ class AcousticInversionTab(QWidget):
self.verticalLayout_groupbox_plot_vertical_profile_sand.removeWidget(self.toolbar_profile_sand) self.verticalLayout_groupbox_plot_vertical_profile_sand.removeWidget(self.toolbar_profile_sand)
self.verticalLayout_groupbox_plot_vertical_profile_sand.removeWidget(self.canvas_profile_sand) self.verticalLayout_groupbox_plot_vertical_profile_sand.removeWidget(self.canvas_profile_sand)
self.figure_vertical_profile_SSC_sand, self.axis_vertical_profile_SSC_sand = plt.subplots( if self.figure_vertical_profile_SSC_sand is not None:
nrows=1, ncols=1, layout="constrained") self.figure_vertical_profile_SSC_sand.clear()
fig, ax = plt.subplots(
nrows=1, ncols=1, layout="constrained"
)
self.figure_vertical_profile_SSC_sand = fig
self.axis_vertical_profile_SSC_sand = ax
self.canvas_profile_sand = FigureCanvas(self.figure_vertical_profile_SSC_sand) self.canvas_profile_sand = FigureCanvas(self.figure_vertical_profile_SSC_sand)
self.toolbar_profile_sand = NavigationToolBar(self.canvas_profile_sand, self) self.toolbar_profile_sand = NavigationToolBar(self.canvas_profile_sand, self)
@ -1620,8 +1646,13 @@ class AcousticInversionTab(QWidget):
self.verticalLayout_groupbox_plot_measured_vs_inverted_SSC_sand.removeWidget( self.verticalLayout_groupbox_plot_measured_vs_inverted_SSC_sand.removeWidget(
self.canvas_inverted_vs_measured_SSC_sand) self.canvas_inverted_vs_measured_SSC_sand)
self.figure_measured_vs_inverted_sand, self.axis_measured_vs_inverted_sand = ( if self.figure_measured_vs_inverted_sand is not None:
plt.subplots(nrows=1, ncols=1, layout="constrained")) self.figure_measured_vs_inverted_sand.clear()
fig, ax = plt.subplots(nrows=1, ncols=1, layout="constrained")
self.figure_measured_vs_inverted_sand = fig
self.axis_measured_vs_inverted_sand = ax
self.canvas_inverted_vs_measured_SSC_sand = FigureCanvas(self.figure_measured_vs_inverted_sand) self.canvas_inverted_vs_measured_SSC_sand = FigureCanvas(self.figure_measured_vs_inverted_sand)
self.toolbar_inverted_vs_measured_SSC_sand = NavigationToolBar(self.canvas_inverted_vs_measured_SSC_sand, self) self.toolbar_inverted_vs_measured_SSC_sand = NavigationToolBar(self.canvas_inverted_vs_measured_SSC_sand, self)

View File

@ -153,7 +153,6 @@ class NoteTab(QWidget):
## ---------- Functions ---------- ## ---------- Functions ----------
## ------------------------------- ## -------------------------------
@trace
def full_update(self): def full_update(self):
self.blockSignals(True) self.blockSignals(True)
self.textEdit.blockSignals(True) self.textEdit.blockSignals(True)

View File

@ -64,6 +64,7 @@ class SampleDataTab(QWidget):
super().__init__() super().__init__()
icon_folder = QIcon(os.path.join("icons", "folder.png")) icon_folder = QIcon(os.path.join("icons", "folder.png"))
self._setup_attrs()
### --- General layout of widgets --- ### --- General layout of widgets ---
@ -257,6 +258,11 @@ class SampleDataTab(QWidget):
self.combobox_PSD_plot.currentTextChanged.connect(self.plot_PSD_fine_and_sand_sediments) self.combobox_PSD_plot.currentTextChanged.connect(self.plot_PSD_fine_and_sand_sediments)
def _setup_attrs(self):
self.figure_plot_sample_position_on_transect = None
self.figure_total_concentration = None
self.figure_plot_PSD = None
# -------------------- Functions for Sample Data Tab -------------------- # -------------------- Functions for Sample Data Tab --------------------
def retranslate_data_sample_tab(self): def retranslate_data_sample_tab(self):
@ -280,7 +286,6 @@ class SampleDataTab(QWidget):
self.groupbox_plot_PSD.setTitle(_translate("CONSTANT_STRING", cs.DISTRIBUTION_PLOT)) self.groupbox_plot_PSD.setTitle(_translate("CONSTANT_STRING", cs.DISTRIBUTION_PLOT))
@trace
def full_update(self): def full_update(self):
logger.debug(f"{__name__}: Update") logger.debug(f"{__name__}: Update")
self.blockSignals(True) self.blockSignals(True)
@ -790,6 +795,9 @@ class SampleDataTab(QWidget):
self.verticalLayout_groupbox_plot_transect\ self.verticalLayout_groupbox_plot_transect\
.removeWidget(self.canvas_plot_sample_position_on_transect) .removeWidget(self.canvas_plot_sample_position_on_transect)
if self.figure_plot_sample_position_on_transect is not None:
self.figure_plot_sample_position_on_transect.clear()
fig, axis = plt.subplots(nrows=1, ncols=1, layout="constrained") fig, axis = plt.subplots(nrows=1, ncols=1, layout="constrained")
self.figure_plot_sample_position_on_transect = fig self.figure_plot_sample_position_on_transect = fig
@ -1415,6 +1423,9 @@ class SampleDataTab(QWidget):
self.verticalLayout_groupbox_plot_total_concentration.removeWidget(self.canvas_plot_total_concentration) self.verticalLayout_groupbox_plot_total_concentration.removeWidget(self.canvas_plot_total_concentration)
self.verticalLayout_groupbox_plot_total_concentration.removeWidget(self.toolbar_plot_total_concentration) self.verticalLayout_groupbox_plot_total_concentration.removeWidget(self.toolbar_plot_total_concentration)
if self.figure_total_concentration is not None:
self.figure_total_concentration.clear()
self.figure_total_concentration, self.axis_total_concentration \ self.figure_total_concentration, self.axis_total_concentration \
= plt.subplots(nrows=1, ncols=1, layout="constrained") = plt.subplots(nrows=1, ncols=1, layout="constrained")
self.canvas_plot_total_concentration = FigureCanvas(self.figure_total_concentration) self.canvas_plot_total_concentration = FigureCanvas(self.figure_total_concentration)
@ -1700,6 +1711,9 @@ class SampleDataTab(QWidget):
self.verticalLayout_groupbox_plot_PSD.removeWidget(self.canvas_plot_PSD) self.verticalLayout_groupbox_plot_PSD.removeWidget(self.canvas_plot_PSD)
self.verticalLayout_groupbox_plot_PSD.removeWidget(self.toolbar_plot_PSD) self.verticalLayout_groupbox_plot_PSD.removeWidget(self.toolbar_plot_PSD)
if self.figure_plot_PSD is not None:
self.figure_plot_PSD.clear()
self.figure_plot_PSD, self.axis_plot_PSD \ self.figure_plot_PSD, self.axis_plot_PSD \
= plt.subplots(nrows=1, ncols=2, layout="constrained") = plt.subplots(nrows=1, ncols=2, layout="constrained")
self.canvas_plot_PSD = FigureCanvas(self.figure_plot_PSD) self.canvas_plot_PSD = FigureCanvas(self.figure_plot_PSD)

View File

@ -63,6 +63,7 @@ class SedimentCalibrationTab(QWidget):
self.inv_hc = AcousticInversionMethodHighConcentration() self.inv_hc = AcousticInversionMethodHighConcentration()
self._setup_icons() self._setup_icons()
self._setup_attrs()
self._setup_widgets() self._setup_widgets()
def _path_icon(self, icon): def _path_icon(self, icon):
@ -84,6 +85,10 @@ class SedimentCalibrationTab(QWidget):
self.icon_approved = QIcon(self._path_icon("approved.png")) self.icon_approved = QIcon(self._path_icon("approved.png"))
self.icon_no_approved = QIcon(self._path_icon("no_approved.png")) self.icon_no_approved = QIcon(self._path_icon("no_approved.png"))
def _setup_attrs(self):
self.fig_BS = None
self.fig_Mfine = None
self.fig_FCB = None
def _setup_widgets(self): def _setup_widgets(self):
self.verticalLayoutMain = QVBoxLayout(self._widget_tab) self.verticalLayoutMain = QVBoxLayout(self._widget_tab)
@ -859,7 +864,6 @@ class SedimentCalibrationTab(QWidget):
self.fit_FCB_profile_with_linear_regression_and_compute_alphaS self.fit_FCB_profile_with_linear_regression_and_compute_alphaS
) )
@trace
def full_update(self): def full_update(self):
logger.debug(f"{__name__}: Update") logger.debug(f"{__name__}: Update")
self.blockSignals(True) self.blockSignals(True)
@ -1030,6 +1034,10 @@ class SedimentCalibrationTab(QWidget):
# --- Plot acoustic data recording --- # --- Plot acoustic data recording ---
self.verticalLayout_groupbox_data_plot.removeWidget(self.toolbar_BS) self.verticalLayout_groupbox_data_plot.removeWidget(self.toolbar_BS)
self.verticalLayout_groupbox_data_plot.removeWidget(self.canvas_BS) self.verticalLayout_groupbox_data_plot.removeWidget(self.canvas_BS)
if self.fig_BS is not None:
self.fig_BS.clear()
self.fig_BS, self.axis_BS = plt.subplots( self.fig_BS, self.axis_BS = plt.subplots(
nrows=1, ncols=1, sharex=True, sharey=False, nrows=1, ncols=1, sharex=True, sharey=False,
layout='constrained' layout='constrained'
@ -1393,6 +1401,10 @@ class SedimentCalibrationTab(QWidget):
# --- Plot profile of the concentration of the fine sediments --- # --- Plot profile of the concentration of the fine sediments ---
self.verticalLayout_groupbox_interpolate_plot.removeWidget(self.canvas_Mfine) self.verticalLayout_groupbox_interpolate_plot.removeWidget(self.canvas_Mfine)
self.verticalLayout_groupbox_interpolate_plot.removeWidget(self.toolbar_Mfine) self.verticalLayout_groupbox_interpolate_plot.removeWidget(self.toolbar_Mfine)
if self.fig_Mfine is not None:
self.fig_Mfine.clear()
self.fig_Mfine, self.ax_Mfine = plt.subplots(1, 1, layout="constrained") self.fig_Mfine, self.ax_Mfine = plt.subplots(1, 1, layout="constrained")
self.canvas_Mfine = FigureCanvas(self.fig_Mfine) self.canvas_Mfine = FigureCanvas(self.fig_Mfine)
self.toolbar_Mfine = NavigationToolBar(self.canvas_Mfine, self) self.toolbar_Mfine = NavigationToolBar(self.canvas_Mfine, self)
@ -2326,6 +2338,9 @@ class SedimentCalibrationTab(QWidget):
self.verticalLayout_groupbox_FCB_plot.removeWidget(self.canvas_FCB) self.verticalLayout_groupbox_FCB_plot.removeWidget(self.canvas_FCB)
self.verticalLayout_groupbox_FCB_plot.removeWidget(self.toolbar_FCB) self.verticalLayout_groupbox_FCB_plot.removeWidget(self.toolbar_FCB)
if self.fig_FCB is not None:
self.fig_FCB.clear()
self.fig_FCB, self.axis_FCB = plt.subplots( self.fig_FCB, self.axis_FCB = plt.subplots(
nrows=1, ncols=1, layout="constrained" nrows=1, ncols=1, layout="constrained"
) )

View File

@ -75,6 +75,7 @@ class SignalProcessingTab(QWidget):
self._setup_icons() self._setup_icons()
self._setup_attrs()
### --- General layout of widgets --- ### --- General layout of widgets ---
@ -511,7 +512,13 @@ class SignalProcessingTab(QWidget):
self.icon_clear = QIcon(path_icon("clear.png")) self.icon_clear = QIcon(path_icon("clear.png"))
self.icon_apply = QIcon(path_icon("circle_green_arrow_right.png")) self.icon_apply = QIcon(path_icon("circle_green_arrow_right.png"))
@trace def _setup_attrs(self):
self.fig_profile_tail = None
self.fig_noise = None
self.fig_SNR = None
self.fig_BS = None
self.figure_profile = None
def full_update(self): def full_update(self):
logger.debug(f"{__name__}: Update") logger.debug(f"{__name__}: Update")
self.blockSignals(True) self.blockSignals(True)
@ -783,44 +790,61 @@ class SignalProcessingTab(QWidget):
msgBox.exec() msgBox.exec()
else: else:
data_id = self.combobox_acoustic_data_choice.currentIndex()
freq_noise_id = self.combobox_freq_noise_from_profile_tail.currentIndex()
if stg.BS_mean[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,): if stg.BS_mean[data_id].shape == (0,):
return
self.verticalLayout_groupbox_plot_profile_tail.removeWidget(self.canvas_profile_tail) 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') if self.fig_profile_tail is not None:
self.fig_profile_tail.clear()
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.canvas_profile_tail = FigureCanvas(self.fig_profile_tail)
self.verticalLayout_groupbox_plot_profile_tail.addWidget(self.canvas_profile_tail) self.verticalLayout_groupbox_plot_profile_tail.addWidget(self.canvas_profile_tail)
self.axis_profile_tail.plot( self.axis_profile_tail.plot(
-stg.depth[self.combobox_acoustic_data_choice.currentIndex()][self.combobox_freq_noise_from_profile_tail.currentIndex()], -stg.depth[data_id][freq_noise_id],
stg.BS_mean[self.combobox_acoustic_data_choice.currentIndex()][self.combobox_freq_noise_from_profile_tail.currentIndex()], stg.BS_mean[data_id][freq_noise_id],
color="blue", linewidth=1) color="blue", linewidth=1
)
self.axis_profile_tail.plot( self.axis_profile_tail.plot(
-stg.depth[self.combobox_acoustic_data_choice.currentIndex()][ -stg.depth[data_id][freq_noise_id],
self.combobox_freq_noise_from_profile_tail.currentIndex()], float(self.lineEdit_profile_tail_value.text().replace(",", "."))
float(self.lineEdit_profile_tail_value.text().replace(",", ".")) * * np.ones(stg.depth[data_id][freq_noise_id].shape[0]),
np.ones(stg.depth[self.combobox_acoustic_data_choice.currentIndex()][ linestyle='dashed', linewidth=2, color='red'
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.set_yscale('log')
self.axis_profile_tail.tick_params(axis='both', labelsize=8) self.axis_profile_tail.tick_params(axis='both', labelsize=8)
self.axis_profile_tail.text(.98, .03, "Depth (m)", self.axis_profile_tail.text(
fontsize=8, fontweight='bold', fontname="DejaVu Sans", c="black", alpha=0.9, .98, .03, "Depth (m)",
horizontalalignment='right', verticalalignment='bottom', rotation='horizontal', fontsize=8, fontweight='bold',
transform=self.axis_profile_tail.transAxes) fontname="DejaVu Sans", c="black", alpha=0.9,
self.axis_profile_tail.text(.1, .45, "BS signal (v)", horizontalalignment='right',
fontsize=8, fontweight='bold', fontname="DejaVu Sans", c="black", alpha=0.9, verticalalignment='bottom', rotation='horizontal',
horizontalalignment='right', verticalalignment='bottom', rotation='vertical', transform=self.axis_profile_tail.transAxes
transform=self.axis_profile_tail.transAxes) )
self.axis_profile_tail.text(.98, .85, self.axis_profile_tail.text(
stg.freq_text[self.combobox_acoustic_data_choice.currentIndex()][ .1, .45, "BS signal (v)",
self.combobox_freq_noise_from_profile_tail.currentIndex()], fontsize=8, fontweight='bold',
fontsize=10, fontweight='bold', fontname="DejaVu Sans", c="black", alpha=0.5, fontname="DejaVu Sans", 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[data_id][freq_noise_id],
fontsize=10, fontweight='bold',
fontname="DejaVu Sans", c="black", alpha=0.5,
horizontalalignment='right', verticalalignment='bottom', horizontalalignment='right', verticalalignment='bottom',
transform=self.axis_profile_tail.transAxes) transform=self.axis_profile_tail.transAxes
)
self.fig_profile_tail.canvas.draw_idle() self.fig_profile_tail.canvas.draw_idle()
@ -1142,7 +1166,12 @@ class SignalProcessingTab(QWidget):
def plot_noise(self): def plot_noise(self):
self.horizontalLayout_groupbox_plot_noise_data.removeWidget(self.canvas_noise) self.horizontalLayout_groupbox_plot_noise_data.removeWidget(self.canvas_noise)
self.fig_noise, self.axis_noise = plt.subplots(nrows=1, ncols=1, layout="constrained") if self.fig_noise is not None:
self.fig_noise.clear()
self.fig_noise, self.axis_noise = plt.subplots(
nrows=1, ncols=1, layout="constrained"
)
self.canvas_noise = FigureCanvas(self.fig_noise) self.canvas_noise = FigureCanvas(self.fig_noise)
self.horizontalLayout_groupbox_plot_noise_data.addWidget(self.canvas_noise) self.horizontalLayout_groupbox_plot_noise_data.addWidget(self.canvas_noise)
@ -1190,6 +1219,9 @@ class SignalProcessingTab(QWidget):
self.verticalLayout_groupbox_plot_SNR.removeWidget(self.toolbar_SNR) self.verticalLayout_groupbox_plot_SNR.removeWidget(self.toolbar_SNR)
self.verticalLayout_groupbox_plot_SNR.removeWidget(self.scroll_SNR) self.verticalLayout_groupbox_plot_SNR.removeWidget(self.scroll_SNR)
if self.fig_SNR is not None:
self.fig_SNR.clear()
self.fig_SNR, self.axis_SNR = plt.subplots( self.fig_SNR, self.axis_SNR = plt.subplots(
nrows=stg.freq[data_id].shape[0], ncols=1, nrows=stg.freq[data_id].shape[0], ncols=1,
sharex=True, sharey=False, layout='constrained' sharex=True, sharey=False, layout='constrained'
@ -1370,6 +1402,9 @@ class SignalProcessingTab(QWidget):
self.verticalLayout_groupbox_plot_pre_processed_data_2D_field\ self.verticalLayout_groupbox_plot_pre_processed_data_2D_field\
.removeWidget(self.scroll_BS) .removeWidget(self.scroll_BS)
if self.fig_BS is not None:
self.fig_BS.clear()
self.fig_BS, self.axis_BS = plt.subplots( self.fig_BS, self.axis_BS = plt.subplots(
nrows=stg.freq[data_id].shape[0], ncols=1, nrows=stg.freq[data_id].shape[0], ncols=1,
sharex=True, sharey=False, layout="constrained" sharex=True, sharey=False, layout="constrained"
@ -1601,7 +1636,12 @@ class SignalProcessingTab(QWidget):
self.verticalLayout_groupbox_plot_profile.removeWidget(self.toolbar_profile) self.verticalLayout_groupbox_plot_profile.removeWidget(self.toolbar_profile)
self.verticalLayout_groupbox_plot_profile.removeWidget(self.canvas_profile) self.verticalLayout_groupbox_plot_profile.removeWidget(self.canvas_profile)
self.figure_profile, self.axis_profile = plt.subplots(nrows=1, ncols=1, layout="constrained") if self.figure_profile is not None:
self.figure_profile.clear()
self.figure_profile, self.axis_profile = plt.subplots(
nrows=1, ncols=1, layout="constrained"
)
self.canvas_profile = FigureCanvas(self.figure_profile) self.canvas_profile = FigureCanvas(self.figure_profile)
self.toolbar_profile = NavigationToolBar(self.canvas_profile, self) self.toolbar_profile = NavigationToolBar(self.canvas_profile, self)