diff --git a/View/sediment_calibration_tab.py b/View/sediment_calibration_tab.py index 923e576..2d7563a 100644 --- a/View/sediment_calibration_tab.py +++ b/View/sediment_calibration_tab.py @@ -876,7 +876,7 @@ class SedimentCalibrationTab(QWidget): return self.update_acoustic_data() - # self.compute_depth_2D() + self.compute_depth_2D() def update_acoustic_data(self): self.combobox_acoustic_data_choice.clear() @@ -934,11 +934,13 @@ class SedimentCalibrationTab(QWidget): self.compute_FCB() def plot_acoustic_recording(self): + data_id = self.combobox_acoustic_data_choice.currentIndex() + # --- Record frequencies for calibration --- stg.frequencies_for_calibration.clear() stg.frequencies_for_calibration.append( ( - stg.freq[self.combobox_acoustic_data_choice.currentIndex()][ + stg.freq[data_id][ self.combobox_freq1.currentIndex() ], self.combobox_freq1.currentIndex() @@ -946,7 +948,7 @@ class SedimentCalibrationTab(QWidget): ) stg.frequencies_for_calibration.append( ( - stg.freq[self.combobox_acoustic_data_choice.currentIndex()][ + stg.freq[data_id][ self.combobox_freq2.currentIndex() ], self.combobox_freq2.currentIndex() @@ -955,7 +957,7 @@ class SedimentCalibrationTab(QWidget): stg.frequency_for_inversion = tuple() stg.frequency_for_inversion = ( - stg.freq[self.combobox_acoustic_data_choice.currentIndex()][ + stg.freq[data_id][ self.combobox_freq2.currentIndex() ], self.combobox_freq2.currentIndex() @@ -973,18 +975,18 @@ class SedimentCalibrationTab(QWidget): self.verticalLayout_groupbox_data_plot.addWidget(self.canvas_BS) if stg.BS_stream_bed_pre_process_average[ - self.combobox_acoustic_data_choice.currentIndex() + data_id ].shape != (0,): val_min = np.nanmin( stg.BS_stream_bed_pre_process_average[ - self.combobox_acoustic_data_choice.currentIndex() + data_id ][ self.combobox_freq2.currentIndex(), :, : ] ) val_max = np.nanmax( stg.BS_stream_bed_pre_process_average[ - self.combobox_acoustic_data_choice.currentIndex() + data_id ][ self.combobox_freq2.currentIndex(), :, : ] @@ -992,346 +994,346 @@ class SedimentCalibrationTab(QWidget): if val_min == 0: val_min = 1e-5 - if stg.time_cross_section[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,): - if stg.depth_cross_section[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,): + if stg.time_cross_section[data_id].shape != (0,): + if stg.depth_cross_section[data_id].shape != (0,): self.axis_BS.pcolormesh( - stg.time_cross_section[self.combobox_acoustic_data_choice.currentIndex()][ + stg.time_cross_section[data_id][ self.combobox_freq2.currentIndex(), :], - -stg.depth_cross_section[self.combobox_acoustic_data_choice.currentIndex()][ + -stg.depth_cross_section[data_id][ self.combobox_freq2.currentIndex(), :], - stg.BS_stream_bed_pre_process_average[self.combobox_acoustic_data_choice.currentIndex()][ + stg.BS_stream_bed_pre_process_average[data_id][ self.combobox_freq2.currentIndex(), :, :], cmap='viridis', norm=LogNorm(vmin=val_min, vmax=val_max)) else: self.axis_BS.pcolormesh( - stg.time_cross_section[self.combobox_acoustic_data_choice.currentIndex()][ + stg.time_cross_section[data_id][ self.combobox_freq2.currentIndex(), :], - -stg.depth[self.combobox_acoustic_data_choice.currentIndex()][ + -stg.depth[data_id][ self.combobox_freq2.currentIndex(), :], - stg.BS_stream_bed_pre_process_average[self.combobox_acoustic_data_choice.currentIndex()][ + stg.BS_stream_bed_pre_process_average[data_id][ self.combobox_freq2.currentIndex(), :, :], cmap='viridis', norm=LogNorm(vmin=val_min, vmax=val_max)) else: - if stg.depth_cross_section[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,): + if stg.depth_cross_section[data_id].shape != (0,): self.axis_BS.pcolormesh( - stg.time[self.combobox_acoustic_data_choice.currentIndex()][ + stg.time[data_id][ self.combobox_freq2.currentIndex(), :], - -stg.depth_cross_section[self.combobox_acoustic_data_choice.currentIndex()][ + -stg.depth_cross_section[data_id][ self.combobox_freq2.currentIndex(), :], - stg.BS_stream_bed_pre_process_average[self.combobox_acoustic_data_choice.currentIndex()][ + stg.BS_stream_bed_pre_process_average[data_id][ self.combobox_freq2.currentIndex(), :, :], cmap='viridis', norm=LogNorm(vmin=val_min, vmax=val_max)) else: self.axis_BS.pcolormesh( - stg.time[self.combobox_acoustic_data_choice.currentIndex()][ + stg.time[data_id][ self.combobox_freq2.currentIndex(), :], - -stg.depth[self.combobox_acoustic_data_choice.currentIndex()][ + -stg.depth[data_id][ self.combobox_freq2.currentIndex(), :], - stg.BS_stream_bed_pre_process_average[self.combobox_acoustic_data_choice.currentIndex()][ + stg.BS_stream_bed_pre_process_average[data_id][ self.combobox_freq2.currentIndex(), :, :], cmap='viridis', norm=LogNorm(vmin=val_min, vmax=val_max)) - elif stg.BS_stream_bed_pre_process_SNR[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,): + elif stg.BS_stream_bed_pre_process_SNR[data_id].shape != (0,): val_min = np.nanmin( - stg.BS_stream_bed_pre_process_SNR[self.combobox_acoustic_data_choice.currentIndex()][ + stg.BS_stream_bed_pre_process_SNR[data_id][ self.combobox_freq2.currentIndex(), :, :]) val_max = np.nanmax( - stg.BS_stream_bed_pre_process_SNR[self.combobox_acoustic_data_choice.currentIndex()][ + stg.BS_stream_bed_pre_process_SNR[data_id][ self.combobox_freq2.currentIndex(), :, :]) if val_min == 0: val_min = 1e-5 - if stg.time_cross_section[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,): - if stg.depth_cross_section[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,): + if stg.time_cross_section[data_id].shape != (0,): + if stg.depth_cross_section[data_id].shape != (0,): self.axis_BS.pcolormesh( - stg.time_cross_section[self.combobox_acoustic_data_choice.currentIndex()][ + stg.time_cross_section[data_id][ self.combobox_freq2.currentIndex(), :], - -stg.depth_cross_section[self.combobox_acoustic_data_choice.currentIndex()][ + -stg.depth_cross_section[data_id][ self.combobox_freq2.currentIndex(), :], - stg.BS_stream_bed_pre_process_SNR[self.combobox_acoustic_data_choice.currentIndex()][ + stg.BS_stream_bed_pre_process_SNR[data_id][ self.combobox_freq2.currentIndex(), :, :], cmap='viridis', norm=LogNorm(vmin=val_min, vmax=val_max)) else: self.axis_BS.pcolormesh( - stg.time_cross_section[self.combobox_acoustic_data_choice.currentIndex()][ + stg.time_cross_section[data_id][ self.combobox_freq2.currentIndex(), :], - -stg.depth[self.combobox_acoustic_data_choice.currentIndex()][ + -stg.depth[data_id][ self.combobox_freq2.currentIndex(), :], - stg.BS_stream_bed_pre_process_SNR[self.combobox_acoustic_data_choice.currentIndex()][ + stg.BS_stream_bed_pre_process_SNR[data_id][ self.combobox_freq2.currentIndex(), :, :], cmap='viridis', norm=LogNorm(vmin=val_min, vmax=val_max)) else: - if stg.depth_cross_section[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,): + if stg.depth_cross_section[data_id].shape != (0,): self.axis_BS.pcolormesh( - stg.time[self.combobox_acoustic_data_choice.currentIndex()][ + stg.time[data_id][ self.combobox_freq2.currentIndex(), :], - -stg.depth_cross_section[self.combobox_acoustic_data_choice.currentIndex()][ + -stg.depth_cross_section[data_id][ self.combobox_freq2.currentIndex(), :], - stg.BS_stream_bed_pre_process_SNR[self.combobox_acoustic_data_choice.currentIndex()][ + stg.BS_stream_bed_pre_process_SNR[data_id][ self.combobox_freq2.currentIndex(), :, :], cmap='viridis', norm=LogNorm(vmin=val_min, vmax=val_max)) else: self.axis_BS.pcolormesh( - stg.time[self.combobox_acoustic_data_choice.currentIndex()][ + stg.time[data_id][ self.combobox_freq2.currentIndex(), :], - -stg.depth[self.combobox_acoustic_data_choice.currentIndex()][ + -stg.depth[data_id][ self.combobox_freq2.currentIndex(), :], - stg.BS_stream_bed_pre_process_SNR[self.combobox_acoustic_data_choice.currentIndex()][ + stg.BS_stream_bed_pre_process_SNR[data_id][ self.combobox_freq2.currentIndex(), :, :], cmap='viridis', norm=LogNorm(vmin=val_min, vmax=val_max)) - elif stg.BS_stream_bed[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,): + elif stg.BS_stream_bed[data_id].shape != (0,): val_min = np.nanmin( - stg.BS_stream_bed[self.combobox_acoustic_data_choice.currentIndex()][self.combobox_freq2.currentIndex(), + stg.BS_stream_bed[data_id][self.combobox_freq2.currentIndex(), :, :]) val_max = np.nanmax( - stg.BS_stream_bed[self.combobox_acoustic_data_choice.currentIndex()][self.combobox_freq2.currentIndex(), + stg.BS_stream_bed[data_id][self.combobox_freq2.currentIndex(), :, :]) if val_min == 0: val_min = 1e-5 - if stg.time_cross_section[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,): - if stg.depth_cross_section[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,): + if stg.time_cross_section[data_id].shape != (0,): + if stg.depth_cross_section[data_id].shape != (0,): self.axis_BS.pcolormesh( - stg.time_cross_section[self.combobox_acoustic_data_choice.currentIndex()][ + stg.time_cross_section[data_id][ self.combobox_freq2.currentIndex(), :], - -stg.depth_cross_section[self.combobox_acoustic_data_choice.currentIndex()][ + -stg.depth_cross_section[data_id][ self.combobox_freq2.currentIndex(), :], - stg.BS_stream_bed[self.combobox_acoustic_data_choice.currentIndex()][self.combobox_freq2.currentIndex(), + stg.BS_stream_bed[data_id][self.combobox_freq2.currentIndex(), :, :], cmap='viridis', norm=LogNorm(vmin=val_min, vmax=val_max)) else: self.axis_BS.pcolormesh( - stg.time_cross_section[self.combobox_acoustic_data_choice.currentIndex()][ + stg.time_cross_section[data_id][ self.combobox_freq2.currentIndex(), :], - -stg.depth[self.combobox_acoustic_data_choice.currentIndex()][ + -stg.depth[data_id][ self.combobox_freq2.currentIndex(), :], - stg.BS_stream_bed[self.combobox_acoustic_data_choice.currentIndex()][self.combobox_freq2.currentIndex(), + stg.BS_stream_bed[data_id][self.combobox_freq2.currentIndex(), :, :], cmap='viridis', norm=LogNorm(vmin=val_min, vmax=val_max)) else: - if stg.depth_cross_section[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,): + if stg.depth_cross_section[data_id].shape != (0,): self.axis_BS.pcolormesh( - stg.time[self.combobox_acoustic_data_choice.currentIndex()][ + stg.time[data_id][ self.combobox_freq2.currentIndex(), :], - -stg.depth_cross_section[self.combobox_acoustic_data_choice.currentIndex()][ + -stg.depth_cross_section[data_id][ self.combobox_freq2.currentIndex(), :], - stg.BS_stream_bed[self.combobox_acoustic_data_choice.currentIndex()][self.combobox_freq2.currentIndex(), + stg.BS_stream_bed[data_id][self.combobox_freq2.currentIndex(), :, :], cmap='viridis', norm=LogNorm(vmin=val_min, vmax=val_max)) else: self.axis_BS.pcolormesh( - stg.time[self.combobox_acoustic_data_choice.currentIndex()][ + stg.time[data_id][ self.combobox_freq2.currentIndex(), :], - -stg.depth[self.combobox_acoustic_data_choice.currentIndex()][ + -stg.depth[data_id][ self.combobox_freq2.currentIndex(), :], - stg.BS_stream_bed[self.combobox_acoustic_data_choice.currentIndex()][self.combobox_freq2.currentIndex(), + stg.BS_stream_bed[data_id][self.combobox_freq2.currentIndex(), :, :], cmap='viridis', norm=LogNorm(vmin=val_min, vmax=val_max)) - elif stg.BS_cross_section_pre_process_average[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,): + elif stg.BS_cross_section_pre_process_average[data_id].shape != (0,): val_min = np.nanmin( - stg.BS_cross_section_pre_process_average[self.combobox_acoustic_data_choice.currentIndex()][ + stg.BS_cross_section_pre_process_average[data_id][ self.combobox_freq2.currentIndex(), :, :]) val_max = np.nanmax( - stg.BS_cross_section_pre_process_average[self.combobox_acoustic_data_choice.currentIndex()][ + stg.BS_cross_section_pre_process_average[data_id][ self.combobox_freq2.currentIndex(), :, :]) if val_min == 0: val_min = 1e-5 - if stg.time_cross_section[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,): - if stg.depth_cross_section[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,): + if stg.time_cross_section[data_id].shape != (0,): + if stg.depth_cross_section[data_id].shape != (0,): self.axis_BS.pcolormesh( - stg.time_cross_section[self.combobox_acoustic_data_choice.currentIndex()][ + stg.time_cross_section[data_id][ self.combobox_freq2.currentIndex(), :], - -stg.depth_cross_section[self.combobox_acoustic_data_choice.currentIndex()][ + -stg.depth_cross_section[data_id][ self.combobox_freq2.currentIndex(), :], - stg.BS_cross_section_pre_process_average[self.combobox_acoustic_data_choice.currentIndex()][ + stg.BS_cross_section_pre_process_average[data_id][ self.combobox_freq2.currentIndex(), :, :], cmap='viridis', norm=LogNorm(vmin=val_min, vmax=val_max)) else: self.axis_BS.pcolormesh( - stg.time_cross_section[self.combobox_acoustic_data_choice.currentIndex()][ + stg.time_cross_section[data_id][ self.combobox_freq2.currentIndex(), :], - -stg.depth[self.combobox_acoustic_data_choice.currentIndex()][ + -stg.depth[data_id][ self.combobox_freq2.currentIndex(), :], - stg.BS_cross_section_pre_process_average[self.combobox_acoustic_data_choice.currentIndex()][ + stg.BS_cross_section_pre_process_average[data_id][ self.combobox_freq2.currentIndex(), :, :], cmap='viridis', norm=LogNorm(vmin=val_min, vmax=val_max)) else: - if stg.depth_cross_section[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,): + if stg.depth_cross_section[data_id].shape != (0,): self.axis_BS.pcolormesh( - stg.time[self.combobox_acoustic_data_choice.currentIndex()][ + stg.time[data_id][ self.combobox_freq2.currentIndex(), :], - -stg.depth_cross_section[self.combobox_acoustic_data_choice.currentIndex()][ + -stg.depth_cross_section[data_id][ self.combobox_freq2.currentIndex(), :], - stg.BS_cross_section_pre_process_average[self.combobox_acoustic_data_choice.currentIndex()][ + stg.BS_cross_section_pre_process_average[data_id][ self.combobox_freq2.currentIndex(), :, :], cmap='viridis', norm=LogNorm(vmin=val_min, vmax=val_max)) else: self.axis_BS.pcolormesh( - stg.time[self.combobox_acoustic_data_choice.currentIndex()][ + stg.time[data_id][ self.combobox_freq2.currentIndex(), :], - -stg.depth[self.combobox_acoustic_data_choice.currentIndex()][ + -stg.depth[data_id][ self.combobox_freq2.currentIndex(), :], - stg.BS_cross_section_pre_process_average[self.combobox_acoustic_data_choice.currentIndex()][ + stg.BS_cross_section_pre_process_average[data_id][ self.combobox_freq2.currentIndex(), :, :], cmap='viridis', norm=LogNorm(vmin=val_min, vmax=val_max)) - elif stg.BS_cross_section_pre_process_SNR[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,): + elif stg.BS_cross_section_pre_process_SNR[data_id].shape != (0,): val_min = np.nanmin( - stg.BS_cross_section_pre_process_SNR[self.combobox_acoustic_data_choice.currentIndex()][ + stg.BS_cross_section_pre_process_SNR[data_id][ self.combobox_freq2.currentIndex(), :, :]) val_max = np.nanmax( - stg.BS_cross_section_pre_process_SNR[self.combobox_acoustic_data_choice.currentIndex()][ + stg.BS_cross_section_pre_process_SNR[data_id][ self.combobox_freq2.currentIndex(), :, :]) if val_min == 0: val_min = 1e-5 - if stg.time_cross_section[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,): - if stg.depth_cross_section[self.combobox_acoustic_data_choice.currentIndex()].shape != (0): + if stg.time_cross_section[data_id].shape != (0,): + if stg.depth_cross_section[data_id].shape != (0): self.axis_BS.pcolormesh( - stg.time_cross_section[self.combobox_acoustic_data_choice.currentIndex()][ + stg.time_cross_section[data_id][ self.combobox_freq2.currentIndex(), :], - -stg.depth_cross_section[self.combobox_acoustic_data_choice.currentIndex()][ + -stg.depth_cross_section[data_id][ self.combobox_freq2.currentIndex(), :], - stg.BS_cross_section_pre_process_SNR[self.combobox_acoustic_data_choice.currentIndex()][ + stg.BS_cross_section_pre_process_SNR[data_id][ self.combobox_freq2.currentIndex(), :, :], cmap='viridis', norm=LogNorm(vmin=val_min, vmax=val_max)) else: self.axis_BS.pcolormesh( - stg.time_cross_section[self.combobox_acoustic_data_choice.currentIndex()][ + stg.time_cross_section[data_id][ self.combobox_freq2.currentIndex(), :], - -stg.depth[self.combobox_acoustic_data_choice.currentIndex()][ + -stg.depth[data_id][ self.combobox_freq2.currentIndex(), :], - stg.BS_cross_section_pre_process_SNR[self.combobox_acoustic_data_choice.currentIndex()][ + stg.BS_cross_section_pre_process_SNR[data_id][ self.combobox_freq2.currentIndex(), :, :], cmap='viridis', norm=LogNorm(vmin=val_min, vmax=val_max)) else: - if stg.depth_cross_section[self.combobox_acoustic_data_choice.currentIndex()].shape != (0): + if stg.depth_cross_section[data_id].shape != (0): self.axis_BS.pcolormesh( - stg.time[self.combobox_acoustic_data_choice.currentIndex()][ + stg.time[data_id][ self.combobox_freq2.currentIndex(), :], - -stg.depth_cross_section[self.combobox_acoustic_data_choice.currentIndex()][ + -stg.depth_cross_section[data_id][ self.combobox_freq2.currentIndex(), :], - stg.BS_cross_section_pre_process_SNR[self.combobox_acoustic_data_choice.currentIndex()][ + stg.BS_cross_section_pre_process_SNR[data_id][ self.combobox_freq2.currentIndex(), :, :], cmap='viridis', norm=LogNorm(vmin=val_min, vmax=val_max)) else: self.axis_BS.pcolormesh( - stg.time[self.combobox_acoustic_data_choice.currentIndex()][ + stg.time[data_id][ self.combobox_freq2.currentIndex(), :], - -stg.depth[self.combobox_acoustic_data_choice.currentIndex()][ + -stg.depth[data_id][ self.combobox_freq2.currentIndex(), :], - stg.BS_cross_section_pre_process_SNR[self.combobox_acoustic_data_choice.currentIndex()][ + stg.BS_cross_section_pre_process_SNR[data_id][ self.combobox_freq2.currentIndex(), :, :], cmap='viridis', norm=LogNorm(vmin=val_min, vmax=val_max)) - elif stg.BS_cross_section[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,): + elif stg.BS_cross_section[data_id].shape != (0,): val_min = np.nanmin( - stg.BS_cross_section[self.combobox_acoustic_data_choice.currentIndex()][ + stg.BS_cross_section[data_id][ self.combobox_freq2.currentIndex(), :, :]) val_max = np.nanmax( - stg.BS_cross_section[self.combobox_acoustic_data_choice.currentIndex()][ + stg.BS_cross_section[data_id][ self.combobox_freq2.currentIndex(), :, :]) if val_min == 0: val_min = 1e-5 - if stg.time_cross_section[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,): - if stg.depth_cross_section[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,): + if stg.time_cross_section[data_id].shape != (0,): + if stg.depth_cross_section[data_id].shape != (0,): self.axis_BS.pcolormesh( - stg.time_cross_section[self.combobox_acoustic_data_choice.currentIndex()][ + stg.time_cross_section[data_id][ self.combobox_freq2.currentIndex(), :], - -stg.depth_cross_section[self.combobox_acoustic_data_choice.currentIndex()][ + -stg.depth_cross_section[data_id][ self.combobox_freq2.currentIndex(), :], - stg.BS_cross_section[self.combobox_acoustic_data_choice.currentIndex()][ + stg.BS_cross_section[data_id][ self.combobox_freq2.currentIndex(), :, :], cmap='viridis', norm=LogNorm(vmin=val_min, vmax=val_max)) else: self.axis_BS.pcolormesh( - stg.time_cross_section[self.combobox_acoustic_data_choice.currentIndex()][ + stg.time_cross_section[data_id][ self.combobox_freq2.currentIndex(), :], - -stg.depth[self.combobox_acoustic_data_choice.currentIndex()][ + -stg.depth[data_id][ self.combobox_freq2.currentIndex(), :], - stg.BS_cross_section[self.combobox_acoustic_data_choice.currentIndex()][ + stg.BS_cross_section[data_id][ self.combobox_freq2.currentIndex(), :, :], cmap='viridis', norm=LogNorm(vmin=val_min, vmax=val_max)) else: - if stg.depth_cross_section[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,): + if stg.depth_cross_section[data_id].shape != (0,): self.axis_BS.pcolormesh( - stg.time[self.combobox_acoustic_data_choice.currentIndex()][ + stg.time[data_id][ self.combobox_freq2.currentIndex(), :], - -stg.depth_cross_section[self.combobox_acoustic_data_choice.currentIndex()][ + -stg.depth_cross_section[data_id][ self.combobox_freq2.currentIndex(), :], - stg.BS_cross_section[self.combobox_acoustic_data_choice.currentIndex()][ + stg.BS_cross_section[data_id][ self.combobox_freq2.currentIndex(), :, :], cmap='viridis', norm=LogNorm(vmin=val_min, vmax=val_max)) else: self.axis_BS.pcolormesh( - stg.time[self.combobox_acoustic_data_choice.currentIndex()][ + stg.time[data_id][ self.combobox_freq2.currentIndex(), :], - -stg.depth[self.combobox_acoustic_data_choice.currentIndex()][ + -stg.depth[data_id][ self.combobox_freq2.currentIndex(), :], - stg.BS_cross_section[self.combobox_acoustic_data_choice.currentIndex()][ + stg.BS_cross_section[data_id][ self.combobox_freq2.currentIndex(), :, :], cmap='viridis', norm=LogNorm(vmin=val_min, vmax=val_max)) - elif stg.BS_raw_data_pre_process_average[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,): + elif stg.BS_raw_data_pre_process_average[data_id].shape != (0,): - val_min = np.nanmin(stg.BS_raw_data_pre_process_average[self.combobox_acoustic_data_choice.currentIndex()][ + val_min = np.nanmin(stg.BS_raw_data_pre_process_average[data_id][ self.combobox_freq2.currentIndex(), :, :]) - val_max = np.nanmax(stg.BS_raw_data_pre_process_average[self.combobox_acoustic_data_choice.currentIndex()][ + val_max = np.nanmax(stg.BS_raw_data_pre_process_average[data_id][ self.combobox_freq2.currentIndex(), :, :]) if val_min == 0: val_min = 1e-5 self.axis_BS.pcolormesh( - stg.time[self.combobox_acoustic_data_choice.currentIndex()][self.combobox_freq2.currentIndex(), :], - -stg.depth[self.combobox_acoustic_data_choice.currentIndex()][self.combobox_freq2.currentIndex(), :], - stg.BS_raw_data_pre_process_average[self.combobox_acoustic_data_choice.currentIndex()][ + stg.time[data_id][self.combobox_freq2.currentIndex(), :], + -stg.depth[data_id][self.combobox_freq2.currentIndex(), :], + stg.BS_raw_data_pre_process_average[data_id][ self.combobox_freq2.currentIndex(), :, :], cmap='viridis', norm=LogNorm(vmin=val_min, vmax=val_max)) - elif stg.BS_raw_data_pre_process_SNR[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,): + elif stg.BS_raw_data_pre_process_SNR[data_id].shape != (0,): - val_min = np.nanmin(stg.BS_raw_data_pre_process_SNR[self.combobox_acoustic_data_choice.currentIndex()][ + val_min = np.nanmin(stg.BS_raw_data_pre_process_SNR[data_id][ self.combobox_freq2.currentIndex(), :, :]) - val_max = np.nanmax(stg.BS_raw_data_pre_process_SNR[self.combobox_acoustic_data_choice.currentIndex()][ + val_max = np.nanmax(stg.BS_raw_data_pre_process_SNR[data_id][ self.combobox_freq2.currentIndex(), :, :]) if val_min == 0: val_min = 1e-5 self.axis_BS.pcolormesh( - stg.time[self.combobox_acoustic_data_choice.currentIndex()][self.combobox_freq2.currentIndex(), :], - -stg.depth[self.combobox_acoustic_data_choice.currentIndex()][self.combobox_freq2.currentIndex(), :], - stg.BS_raw_data_pre_process_SNR[self.combobox_acoustic_data_choice.currentIndex()][ + stg.time[data_id][self.combobox_freq2.currentIndex(), :], + -stg.depth[data_id][self.combobox_freq2.currentIndex(), :], + stg.BS_raw_data_pre_process_SNR[data_id][ self.combobox_freq2.currentIndex(), :, :], cmap='viridis', norm=LogNorm(vmin=val_min, vmax=val_max)) - elif stg.BS_raw_data[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,): + elif stg.BS_raw_data[data_id].shape != (0,): - val_min = np.nanmin(stg.BS_raw_data[self.combobox_acoustic_data_choice.currentIndex()][ + val_min = np.nanmin(stg.BS_raw_data[data_id][ self.combobox_freq2.currentIndex(), :, :]) - val_max = np.nanmax(stg.BS_raw_data[self.combobox_acoustic_data_choice.currentIndex()][ + val_max = np.nanmax(stg.BS_raw_data[data_id][ self.combobox_freq2.currentIndex(), :, :]) if val_min == 0: val_min = 1e-5 self.axis_BS.pcolormesh( - stg.time[self.combobox_acoustic_data_choice.currentIndex()][self.combobox_freq2.currentIndex(), :], - -stg.depth[self.combobox_acoustic_data_choice.currentIndex()][self.combobox_freq2.currentIndex(), :], - stg.BS_raw_data[self.combobox_acoustic_data_choice.currentIndex()][ + stg.time[data_id][self.combobox_freq2.currentIndex(), :], + -stg.depth[data_id][self.combobox_freq2.currentIndex(), :], + stg.BS_raw_data[data_id][ self.combobox_freq2.currentIndex(), :, :], cmap='viridis', norm=LogNorm(vmin=val_min, vmax=val_max)) @@ -1370,16 +1372,16 @@ class SedimentCalibrationTab(QWidget): # --- Plot vertical red line for position of FCB profile --- if stg.sand_sample_target_indice: - if stg.depth_cross_section[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,): + if stg.depth_cross_section[data_id].shape != (0,): - if stg.time_cross_section[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,): + if stg.time_cross_section[data_id].shape != (0,): self.red_line_plot_return, = ( self.axis_BS.plot( - stg.time_cross_section[self.combobox_acoustic_data_choice.currentIndex()][ + stg.time_cross_section[data_id][ self.combobox_freq2.currentIndex(), stg.sand_sample_target_indice[0][1]] * - np.ones(stg.depth_cross_section[self.combobox_acoustic_data_choice.currentIndex()].shape[1]), - -stg.depth_cross_section[self.combobox_acoustic_data_choice.currentIndex()][ + np.ones(stg.depth_cross_section[data_id].shape[1]), + -stg.depth_cross_section[data_id][ self.combobox_freq2.currentIndex(), :], color='red', linestyle="solid", linewidth=2)) @@ -1387,23 +1389,23 @@ class SedimentCalibrationTab(QWidget): self.red_line_plot_return, = ( self.axis_BS.plot( - stg.time[self.combobox_acoustic_data_choice.currentIndex()][ + stg.time[data_id][ self.combobox_freq2.currentIndex(), stg.sand_sample_target_indice[0][1]] * - np.ones(stg.depth_cross_section[self.combobox_acoustic_data_choice.currentIndex()].shape[1]), - -stg.depth_cross_section[self.combobox_acoustic_data_choice.currentIndex()][ + np.ones(stg.depth_cross_section[data_id].shape[1]), + -stg.depth_cross_section[data_id][ self.combobox_freq2.currentIndex(), :], color='red', linestyle="solid", linewidth=2)) else: - if stg.time_cross_section[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,): + if stg.time_cross_section[data_id].shape != (0,): self.red_line_plot_return, = ( self.axis_BS.plot( - stg.time_cross_section[self.combobox_acoustic_data_choice.currentIndex()][ + stg.time_cross_section[data_id][ self.combobox_freq2.currentIndex(), stg.sand_sample_target_indice[0][1]] * - np.ones(stg.depth[self.combobox_acoustic_data_choice.currentIndex()].shape[1]), - -stg.depth[self.combobox_acoustic_data_choice.currentIndex()][ + np.ones(stg.depth[data_id].shape[1]), + -stg.depth[data_id][ self.combobox_freq2.currentIndex(), :], color='red', linestyle="solid", linewidth=2)) @@ -1411,10 +1413,10 @@ class SedimentCalibrationTab(QWidget): self.red_line_plot_return, = ( self.axis_BS.plot( - stg.time[self.combobox_acoustic_data_choice.currentIndex()][ + stg.time[data_id][ self.combobox_freq2.currentIndex(), stg.sand_sample_target_indice[0][1]] * - np.ones(stg.depth[self.combobox_acoustic_data_choice.currentIndex()].shape[1]), - -stg.depth[self.combobox_acoustic_data_choice.currentIndex()][ + np.ones(stg.depth[data_id].shape[1]), + -stg.depth[data_id][ self.combobox_freq2.currentIndex(), :], color='red', linestyle="solid", linewidth=2)) @@ -1944,13 +1946,12 @@ class SedimentCalibrationTab(QWidget): def compute_depth_2D(self): if self.combobox_acoustic_data_choice.count() > 0: - for k in range(self.combobox_acoustic_data_choice.count()): + while len(stg.depth_2D) <= k: + stg.depth_2D.append(np.array([])) if stg.depth_cross_section[k].shape != (0,): - if stg.time_cross_section[k].shape != (0,): - stg.depth_2D[k] = ( np.zeros((stg.freq[k].shape[0], stg.depth_cross_section[k].shape[1], @@ -1964,7 +1965,6 @@ class SedimentCalibrationTab(QWidget): axis=1)) elif stg.time[k].shape != (0,): - stg.depth_2D[k] = ( np.zeros((stg.freq[k].shape[0], stg.depth_cross_section[k].shape[1], @@ -1979,9 +1979,7 @@ class SedimentCalibrationTab(QWidget): axis=1)) elif stg.depth[k].shape != (0,): - if stg.time_cross_section[k].shape != (0,): - stg.depth_2D[k] = ( np.zeros((stg.freq[k].shape[0], stg.depth[k].shape[1], @@ -1996,7 +1994,6 @@ class SedimentCalibrationTab(QWidget): axis=1)) elif stg.time[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,): - stg.depth_2D[k] = ( np.zeros((stg.freq[k].shape[0], stg.depth[k].shape[1],