diff --git a/View/acoustic_data_tab.py b/View/acoustic_data_tab.py index 0526c00..605aea7 100644 --- a/View/acoustic_data_tab.py +++ b/View/acoustic_data_tab.py @@ -4113,10 +4113,10 @@ class AcousticDataTab(QWidget): for k in range(stg.time_cross_section[self.fileListWidget.currentRow()].shape[1]): BS_smooth[:, k] = savgol_filter(BS_smooth[:, k], 10, 2) - fig1, ax1 = plt.subplots(nrows=1, ncols=1, layout="constrained") - pcm1 = ax1.pcolormesh(stg.time_cross_section[0][0, :], -stg.depth_cross_section[0][0, :], (BS_smooth[:, :]), cmap='Blues') - fig1.colorbar(pcm1, ax=ax1, shrink=1, location='right') - plt.show() + # fig1, ax1 = plt.subplots(nrows=1, ncols=1, layout="constrained") + # pcm1 = ax1.pcolormesh(stg.time_cross_section[0][0, :], -stg.depth_cross_section[0][0, :], (BS_smooth[:, :]), cmap='Blues') + # fig1.colorbar(pcm1, ax=ax1, shrink=1, location='right') + # plt.show() # ----------- Detecting the bottom ------------- # for d in range(stg.nb_profiles): diff --git a/View/sample_data_tab.py b/View/sample_data_tab.py index 6add6bb..bf6369f 100644 --- a/View/sample_data_tab.py +++ b/View/sample_data_tab.py @@ -948,6 +948,9 @@ class SampleDataTab(QWidget): self.tableWidget_sand.itemChanged.connect(self.plot_total_concentration) self.tableWidget_sand.itemChanged.connect(self.plot_PSD_fine_and_sand_sediments) + self.combobox_x_axis.currentIndexChanged.connect(self.plot_total_concentration) + self.combobox_y_axis.currentIndexChanged.connect(self.plot_total_concentration) + # --- Function to extract position of sample from table checkboxes to update plots --- def extract_position_list_and_color_list_from_table_checkboxes_fine(self): # if self.tableWidget_fine.columnCount() > 10: @@ -1420,7 +1423,7 @@ class SampleDataTab(QWidget): stg.time_fine[position_list_fine[k]]]) == np.nanmin(np.abs(stg.time_cross_section[ self.combobox_acoustic_data.currentIndex()][self.combobox_frequencies.currentIndex()] - - stg.time_fine[position_list_fine[k]])))[1][0]) + stg.time_fine[position_list_fine[k]])))[0][0]) depth_bottom_to_plot_fine.append( stg.depth_bottom[self.combobox_acoustic_data.currentIndex()][indices_bottom_fine[-1]]) @@ -1433,17 +1436,18 @@ class SampleDataTab(QWidget): np.abs(stg.time_cross_section[self.combobox_acoustic_data.currentIndex()][self.combobox_frequencies.currentIndex()] - stg.time_fine[position_list_fine[k]]) == np.nanmin( np.abs(stg.time_cross_section[self.combobox_acoustic_data.currentIndex()][self.combobox_frequencies.currentIndex()] - stg.time_fine[position_list_fine[k]])))[ - 1][0]) + 0][0]) depth_bottom_to_plot_fine.append( stg.depth_cross_section[self.combobox_acoustic_data.currentIndex()][ self.combobox_frequencies.currentIndex(), -1]) else: + indices_bottom_fine.append(np.where( np.abs(stg.time[self.combobox_acoustic_data.currentIndex()][self.combobox_frequencies.currentIndex()] - stg.time_fine[position_list_fine[k]]) == np.nanmin( np.abs(stg.time[self.combobox_acoustic_data.currentIndex()][self.combobox_frequencies.currentIndex()] - stg.time_fine[position_list_fine[k]])))[ - 1][0]) + 0][0]) depth_bottom_to_plot_fine.append( stg.depth[self.combobox_acoustic_data.currentIndex()][ self.combobox_frequencies.currentIndex(), -1]) @@ -1476,23 +1480,33 @@ class SampleDataTab(QWidget): [x / y for x, y in zip(sample_depth_to_plot_fine, depth_bottom_to_plot_fine)], s=100, facecolor=color_list_fine, edgecolor="None", alpha=0.5) - elif stg.BS_cross_section[self.combobox_acoustic_data.currentIndex()].shape != (0,): - - self.axis_total_concentration.scatter( - Ctot_fine_to_plot, - [x / y for x, y in zip(sample_depth_to_plot_fine, depth_bottom_to_plot_fine)], - # stg.depth_cross_section[self.combobox_acoustic_data.currentIndex()][ - # self.combobox_frequencies.currentIndex(), -1], - s=100, facecolor=color_list_fine, edgecolor="None", alpha=0.5) - else: - self.axis_total_concentration.scatter( - Ctot_fine_to_plot, - [x / y for x, y in zip(sample_depth_to_plot_fine, depth_bottom_to_plot_fine)], - # stg.depth[self.combobox_acoustic_data.currentIndex()][ - # self.combobox_frequencies.currentIndex(), -1], - s=100, facecolor=color_list_fine, edgecolor="None", alpha=0.5) + msgBox = QMessageBox() + msgBox.setWindowTitle("Axis choice Error") + msgBox.setIcon(QMessageBox.Warning) + msgBox.setText("Please detect bottom before plotting axis z/h") + msgBox.setStandardButtons(QMessageBox.Ok) + msgBox.exec() + + + # elif stg.BS_cross_section[self.combobox_acoustic_data.currentIndex()].shape != (0,): + # + # self.axis_total_concentration.scatter( + # Ctot_fine_to_plot, + # [x / y for x, y in zip(sample_depth_to_plot_fine, depth_bottom_to_plot_fine)], + # # stg.depth_cross_section[self.combobox_acoustic_data.currentIndex()][ + # # self.combobox_frequencies.currentIndex(), -1], + # s=100, facecolor=color_list_fine, edgecolor="None", alpha=0.5) + # + # else: + # + # self.axis_total_concentration.scatter( + # Ctot_fine_to_plot, + # [x / y for x, y in zip(sample_depth_to_plot_fine, depth_bottom_to_plot_fine)], + # # stg.depth[self.combobox_acoustic_data.currentIndex()][ + # # self.combobox_frequencies.currentIndex(), -1], + # s=100, facecolor=color_list_fine, edgecolor="None", alpha=0.5) self.axis_total_concentration.set_ylim(-1, 0) self.axis_total_concentration.set_xlabel(self.combobox_x_axis.currentText()) @@ -1508,23 +1522,32 @@ class SampleDataTab(QWidget): [x / y for x, y in zip(sample_depth_to_plot_fine, depth_bottom_to_plot_fine)], s=100, facecolor=color_list_fine, edgecolor="None", alpha=0.5) - elif stg.BS_cross_section[self.combobox_acoustic_data.currentIndex()].shape != (0,): - - self.axis_total_concentration.scatter( - Ctot_fine_percent_to_plot, - [x / y for x, y in zip(sample_depth_to_plot_fine, depth_bottom_to_plot_fine)], - # stg.depth_cross_section[self.combobox_acoustic_data.currentIndex()][ - # self.combobox_frequencies.currentIndex(), -1], - s=100, facecolor=color_list_fine, edgecolor="None", alpha=0.5) - else: - self.axis_total_concentration.scatter( - Ctot_fine_percent_to_plot, - [x / y for x, y in zip(sample_depth_to_plot_fine, depth_bottom_to_plot_fine)], - # stg.depth[self.combobox_acoustic_data.currentIndex()][ - # self.combobox_frequencies.currentIndex(), -1], - s=100, facecolor=color_list_fine, edgecolor="None", alpha=0.5) + msgBox = QMessageBox() + msgBox.setWindowTitle("Axis choice Error") + msgBox.setIcon(QMessageBox.Warning) + msgBox.setText("Please detect bottom before plotting axis z/h") + msgBox.setStandardButtons(QMessageBox.Ok) + msgBox.exec() + + # elif stg.BS_cross_section[self.combobox_acoustic_data.currentIndex()].shape != (0,): + # + # self.axis_total_concentration.scatter( + # Ctot_fine_percent_to_plot, + # [x / y for x, y in zip(sample_depth_to_plot_fine, depth_bottom_to_plot_fine)], + # # stg.depth_cross_section[self.combobox_acoustic_data.currentIndex()][ + # # self.combobox_frequencies.currentIndex(), -1], + # s=100, facecolor=color_list_fine, edgecolor="None", alpha=0.5) + # + # else: + # + # self.axis_total_concentration.scatter( + # Ctot_fine_percent_to_plot, + # [x / y for x, y in zip(sample_depth_to_plot_fine, depth_bottom_to_plot_fine)], + # # stg.depth[self.combobox_acoustic_data.currentIndex()][ + # # self.combobox_frequencies.currentIndex(), -1], + # s=100, facecolor=color_list_fine, edgecolor="None", alpha=0.5) self.axis_total_concentration.set_xlim(0, 100) self.axis_total_concentration.set_ylim(-1, 0) @@ -1537,6 +1560,7 @@ class SampleDataTab(QWidget): elif not (self.lineEdit_fine_sediment.text()) and (self.lineEdit_sand_sediment.text()): self.compute_Ctot_per_cent() + print("Ctot sand % ", stg.Ctot_sand_per_cent) # --- Read selected sand samples (checkboxes) --- position_list_sand, color_list_sand = self.extract_position_list_and_color_list_from_table_checkboxes_sand() @@ -1550,32 +1574,47 @@ class SampleDataTab(QWidget): Ctot_sand_percent_to_plot.append(stg.Ctot_sand_per_cent[position_list_sand[k]]) sample_depth_to_plot_sand.append(stg.depth_sand[position_list_sand[k]]) if stg.depth_bottom[self.combobox_acoustic_data.currentIndex()].shape != (0,): + indices_bottom_sand.append(np.where(np.abs( stg.time_cross_section[self.combobox_acoustic_data.currentIndex()][self.combobox_frequencies.currentIndex()] - stg.time_sand[ position_list_sand[k]]) == np.nanmin(np.abs(stg.time_cross_section[ self.combobox_acoustic_data.currentIndex()][self.combobox_frequencies.currentIndex()] - - stg.time_sand[k])))[1][0]) + stg.time_sand[k])))[0][0]) depth_bottom_to_plot_sand.append( stg.depth_bottom[self.combobox_acoustic_data.currentIndex()][indices_bottom_sand[-1]]) elif stg.time_cross_section[self.combobox_acoustic_data.currentIndex()].shape != (0,): + print("The test 0 : ", np.where(np.abs( + stg.time_cross_section[self.combobox_acoustic_data.currentIndex()][ + self.combobox_frequencies.currentIndex()] - stg.time_sand[ + position_list_sand[k]]) == + np.nanmin(np.abs(stg.time_cross_section[ + self.combobox_acoustic_data.currentIndex()][ + self.combobox_frequencies.currentIndex()] - + stg.time_sand[k])))) + indices_bottom_sand.append(np.where( np.abs(stg.time_cross_section[self.combobox_acoustic_data.currentIndex()][self.combobox_frequencies.currentIndex()] - stg.time_sand[position_list_sand[k]]) == np.nanmin( np.abs(stg.time_cross_section[self.combobox_acoustic_data.currentIndex()][self.combobox_frequencies.currentIndex()] - stg.time_sand[position_list_sand[k]])))[ - 1][0]) + 0][0]) depth_bottom_to_plot_sand.append( stg.depth_cross_section[self.combobox_acoustic_data.currentIndex()][ self.combobox_frequencies.currentIndex(), -1]) else: + print("The test 1 : ", np.where( + np.abs(stg.time[self.combobox_acoustic_data.currentIndex()][self.combobox_frequencies.currentIndex()] - stg.time_sand[position_list_sand[k]]) == + np.nanmin( + np.abs(stg.time[self.combobox_acoustic_data.currentIndex()][self.combobox_frequencies.currentIndex()] - stg.time_sand[position_list_sand[k]])))) + indices_bottom_sand.append(np.where( np.abs(stg.time[self.combobox_acoustic_data.currentIndex()][self.combobox_frequencies.currentIndex()] - stg.time_sand[position_list_sand[k]]) == np.nanmin( np.abs(stg.time[self.combobox_acoustic_data.currentIndex()][self.combobox_frequencies.currentIndex()] - stg.time_sand[position_list_sand[k]])))[ - 1][0]) + 0][0]) depth_bottom_to_plot_sand.append( stg.depth[self.combobox_acoustic_data.currentIndex()][ self.combobox_frequencies.currentIndex(), -1]) @@ -1585,6 +1624,7 @@ class SampleDataTab(QWidget): # --- Concentration (g/L) VS z (m) --- if (self.combobox_x_axis.currentIndex() == 0) and (self.combobox_y_axis.currentIndex() == 0): + print("Je suis dans 1") self.axis_total_concentration.scatter(Ctot_sand_to_plot, sample_depth_to_plot_sand, s=300, facecolor="None", edgecolor=color_list_sand, @@ -1594,6 +1634,8 @@ class SampleDataTab(QWidget): # --- Concentration (%) VS z (m) --- elif (self.combobox_x_axis.currentIndex() == 1) and (self.combobox_y_axis.currentIndex() == 0): + print("Je suis dans 2") + print("Ctot_sand_percent_to_plot ", Ctot_sand_percent_to_plot) self.axis_total_concentration.scatter(Ctot_sand_percent_to_plot, sample_depth_to_plot_sand, s=300, facecolor="None", edgecolor=color_list_sand, alpha=0.5) @@ -1603,7 +1645,7 @@ class SampleDataTab(QWidget): # --- Concentration (g/L) VS z / h --- elif (self.combobox_x_axis.currentIndex() == 0) and (self.combobox_y_axis.currentIndex() == 1): - + print("Je suis dans 3") if stg.BS_stream_bed[self.combobox_acoustic_data.currentIndex()].shape != (0,): self.axis_total_concentration.scatter( @@ -1612,23 +1654,32 @@ class SampleDataTab(QWidget): # stg.depth_bottom[self.combobox_acoustic_data.currentIndex()][indices_bottom_sand], s=300, facecolor="None", edgecolor=color_list_sand, alpha=0.5) - elif stg.BS_cross_section[self.combobox_acoustic_data.currentIndex()].shape != (0,): - - self.axis_total_concentration.scatter( - Ctot_sand_to_plot, - [x / y for x, y in zip(sample_depth_to_plot_sand, depth_bottom_to_plot_sand)], - # stg.depth_cross_section[self.combobox_acoustic_data.currentIndex()][ - # self.combobox_frequencies.currentIndex(), -1], - s=300, facecolor="None", edgecolor=color_list_sand, alpha=0.5) - else: - self.axis_total_concentration.scatter( - Ctot_sand_to_plot, - [x / y for x, y in zip(sample_depth_to_plot_sand, depth_bottom_to_plot_sand)], - # stg.depth[self.combobox_acoustic_data.currentIndex()][ - # self.combobox_frequencies.currentIndex(), -1], - s=300, facecolor="None", edgecolor=color_list_sand, alpha=0.5) + msgBox = QMessageBox() + msgBox.setWindowTitle("Axis choice Error") + msgBox.setIcon(QMessageBox.Warning) + msgBox.setText("Please detect bottom before plotting axis z/h") + msgBox.setStandardButtons(QMessageBox.Ok) + msgBox.exec() + + # elif stg.BS_cross_section[self.combobox_acoustic_data.currentIndex()].shape != (0,): + # + # self.axis_total_concentration.scatter( + # Ctot_sand_to_plot, + # [x / y for x, y in zip(sample_depth_to_plot_sand, depth_bottom_to_plot_sand)], + # # stg.depth_cross_section[self.combobox_acoustic_data.currentIndex()][ + # # self.combobox_frequencies.currentIndex(), -1], + # s=300, facecolor="None", edgecolor=color_list_sand, alpha=0.5) + # + # else: + # + # self.axis_total_concentration.scatter( + # Ctot_sand_to_plot, + # [x / y for x, y in zip(sample_depth_to_plot_sand, depth_bottom_to_plot_sand)], + # # stg.depth[self.combobox_acoustic_data.currentIndex()][ + # # self.combobox_frequencies.currentIndex(), -1], + # s=300, facecolor="None", edgecolor=color_list_sand, alpha=0.5) self.axis_total_concentration.set_ylim(-1, 0) self.axis_total_concentration.set_xlabel(self.combobox_x_axis.currentText()) @@ -1636,7 +1687,7 @@ class SampleDataTab(QWidget): # --- Concentration (%) VS z / h --- elif (self.combobox_x_axis.currentIndex() == 1) and (self.combobox_y_axis.currentIndex() == 1): - + print("Je suis dans 4") if stg.BS_stream_bed[self.combobox_acoustic_data.currentIndex()].shape != (0,): self.axis_total_concentration.scatter( @@ -1645,23 +1696,32 @@ class SampleDataTab(QWidget): # stg.depth_bottom[self.combobox_acoustic_data.currentIndex()][indices_bottom_sand], s=300, facecolor="None", edgecolor=color_list_sand, alpha=0.5) - elif stg.BS_cross_section[self.combobox_acoustic_data.currentIndex()].shape != (0,): - - self.axis_total_concentration.scatter( - Ctot_sand_percent_to_plot, - [x / y for x, y in zip(sample_depth_to_plot_sand, depth_bottom_to_plot_sand)], - # stg.depth_cross_section[self.combobox_acoustic_data.currentIndex()][ - # self.combobox_frequencies.currentIndex(), -1], - s=300, facecolor="None", edgecolor=color_list_sand, alpha=0.5) - else: - self.axis_total_concentration.scatter( - Ctot_sand_percent_to_plot, - [x / y for x, y in zip(sample_depth_to_plot_sand, depth_bottom_to_plot_sand)], - # stg.depth[self.combobox_acoustic_data.currentIndex()][ - # self.combobox_frequencies.currentIndex(), -1], - s=300, facecolor="None", edgecolor=color_list_sand, alpha=0.5) + msgBox = QMessageBox() + msgBox.setWindowTitle("Axis choice Error") + msgBox.setIcon(QMessageBox.Warning) + msgBox.setText("Please detect bottom before plotting axis z/h") + msgBox.setStandardButtons(QMessageBox.Ok) + msgBox.exec() + + # elif stg.BS_cross_section[self.combobox_acoustic_data.currentIndex()].shape != (0,): + # + # self.axis_total_concentration.scatter( + # Ctot_sand_percent_to_plot, + # [x / y for x, y in zip(sample_depth_to_plot_sand, depth_bottom_to_plot_sand)], + # # stg.depth_cross_section[self.combobox_acoustic_data.currentIndex()][ + # # self.combobox_frequencies.currentIndex(), -1], + # s=300, facecolor="None", edgecolor=color_list_sand, alpha=0.5) + # + # else: + # + # self.axis_total_concentration.scatter( + # Ctot_sand_percent_to_plot, + # [x / y for x, y in zip(sample_depth_to_plot_sand, depth_bottom_to_plot_sand)], + # # stg.depth[self.combobox_acoustic_data.currentIndex()][ + # # self.combobox_frequencies.currentIndex(), -1], + # s=300, facecolor="None", edgecolor=color_list_sand, alpha=0.5) self.axis_total_concentration.set_xlim(0, 100) self.axis_total_concentration.set_ylim(-1, 0) @@ -1682,9 +1742,9 @@ class SampleDataTab(QWidget): sample_depth_to_plot_fine = [] indices_bottom_fine = [] depth_bottom_to_plot_fine = [] - print("time fine ", stg.time_fine) + # print("time fine ", stg.time_fine) for k in range(len(position_list_fine)): - print("k = ", k, "type(k) = ", type(k)) + # print("k = ", k, "type(k) = ", type(k)) Ctot_fine_to_plot.append(stg.Ctot_fine[position_list_fine[k]]) Ctot_fine_percent_to_plot.append(stg.Ctot_fine_per_cent[position_list_fine[k]]) sample_depth_to_plot_fine.append(stg.depth_fine[position_list_fine[k]]) @@ -1694,7 +1754,7 @@ class SampleDataTab(QWidget): stg.time_fine[position_list_fine[k]]])) == np.nanmin(np.abs(stg.time_cross_section[ self.combobox_acoustic_data.currentIndex()][self.combobox_frequencies.currentIndex()] - - stg.time_fine[position_list_fine[k]])))[1][0]) + stg.time_fine[position_list_fine[k]])))[0][0]) print("indices_bottom_fine ", indices_bottom_fine) depth_bottom_to_plot_fine.append( stg.depth_bottom[self.combobox_acoustic_data.currentIndex()][indices_bottom_fine[-1]]) @@ -1709,7 +1769,7 @@ class SampleDataTab(QWidget): np.nanmin(np.abs(stg.time_cross_section[ self.combobox_acoustic_data.currentIndex()][ self.combobox_frequencies.currentIndex()] - - stg.time_fine[position_list_fine[k]])))[1][ + stg.time_fine[position_list_fine[k]])))[0][ 0]) print() depth_bottom_to_plot_fine.append( @@ -1722,7 +1782,7 @@ class SampleDataTab(QWidget): stg.time_fine[k])) == np.nanmin( np.abs(stg.time[self.combobox_acoustic_data.currentIndex()][self.combobox_frequencies.currentIndex()] - - stg.time_fine[k])))[1][0]) + - stg.time_fine[k])))[0][0]) depth_bottom_to_plot_fine.append( stg.depth[self.combobox_acoustic_data.currentIndex()][self.combobox_frequencies.currentIndex(), @@ -1764,7 +1824,7 @@ class SampleDataTab(QWidget): stg.time_cross_section[self.combobox_acoustic_data.currentIndex()][self.combobox_frequencies.currentIndex()] - stg.time_sand[ position_list_sand[k]]) == np.nanmin(np.abs(stg.time_cross_section[self.combobox_acoustic_data.currentIndex()][self.combobox_frequencies.currentIndex()] - - stg.time_sand[position_list_sand[k]])))[1][0]) + stg.time_sand[position_list_sand[k]])))[0][0]) depth_bottom_to_plot_sand.append(stg.depth_bottom[self.combobox_acoustic_data.currentIndex()][indices_bottom_sand[-1]]) @@ -1787,7 +1847,7 @@ class SampleDataTab(QWidget): np.abs( stg.time[self.combobox_acoustic_data.currentIndex()][self.combobox_frequencies.currentIndex()] - stg.time_sand[position_list_sand[k]]) == np.nanmin( - np.abs(stg.time[self.combobox_acoustic_data.currentIndex()][self.combobox_frequencies.currentIndex()] - stg.time_sand[position_list_sand[k]])))[1][0]) + np.abs(stg.time[self.combobox_acoustic_data.currentIndex()][self.combobox_frequencies.currentIndex()] - stg.time_sand[position_list_sand[k]])))[0][0]) depth_bottom_to_plot_sand.append( stg.depth[self.combobox_acoustic_data.currentIndex()][self.combobox_frequencies.currentIndex(), @@ -1840,33 +1900,42 @@ class SampleDataTab(QWidget): [x / y for x, y in zip(sample_depth_to_plot_sand, depth_bottom_to_plot_sand)], s=300, facecolor="None", edgecolor=color_list_sand, alpha=0.5) - elif stg.BS_cross_section[self.combobox_acoustic_data.currentIndex()].shape != (0,): - - self.axis_total_concentration.scatter( - Ctot_fine_to_plot, - stg.depth_cross_section[self.combobox_acoustic_data.currentIndex()][ - self.combobox_frequencies.currentIndex(), -1], - s=100, facecolor=color_list_fine, edgecolor="None", alpha=0.5) - - self.axis_total_concentration.scatter( - Ctot_sand_to_plot, - stg.depth_cross_section[self.combobox_acoustic_data.currentIndex()][ - self.combobox_frequencies.currentIndex(), -1], - s=300, facecolor="None", edgecolor=color_list_sand, alpha=0.5) - else: - self.axis_total_concentration.scatter( - Ctot_fine_to_plot, - stg.depth[self.combobox_acoustic_data.currentIndex()][ - self.combobox_frequencies.currentIndex(), -1], - s=100, facecolor=color_list_fine, edgecolor="None", alpha=0.5) + msgBox = QMessageBox() + msgBox.setWindowTitle("Axis choice Error") + msgBox.setIcon(QMessageBox.Warning) + msgBox.setText("Please detect bottom before plotting axis z/h") + msgBox.setStandardButtons(QMessageBox.Ok) + msgBox.exec() - self.axis_total_concentration.scatter( - Ctot_sand_to_plot, - stg.depth[self.combobox_acoustic_data.currentIndex()][ - self.combobox_frequencies.currentIndex(), -1], - s=300, facecolor="None", edgecolor=color_list_sand, alpha=0.5) + # elif stg.BS_cross_section[self.combobox_acoustic_data.currentIndex()].shape != (0,): + # + # self.axis_total_concentration.scatter( + # Ctot_fine_to_plot, + # stg.depth_cross_section[self.combobox_acoustic_data.currentIndex()][ + # self.combobox_frequencies.currentIndex(), -1], + # s=100, facecolor=color_list_fine, edgecolor="None", alpha=0.5) + # + # self.axis_total_concentration.scatter( + # Ctot_sand_to_plot, + # stg.depth_cross_section[self.combobox_acoustic_data.currentIndex()][ + # self.combobox_frequencies.currentIndex(), -1], + # s=300, facecolor="None", edgecolor=color_list_sand, alpha=0.5) + # + # else: + # + # self.axis_total_concentration.scatter( + # Ctot_fine_to_plot, + # stg.depth[self.combobox_acoustic_data.currentIndex()][ + # self.combobox_frequencies.currentIndex(), -1], + # s=100, facecolor=color_list_fine, edgecolor="None", alpha=0.5) + # + # self.axis_total_concentration.scatter( + # Ctot_sand_to_plot, + # stg.depth[self.combobox_acoustic_data.currentIndex()][ + # self.combobox_frequencies.currentIndex(), -1], + # s=300, facecolor="None", edgecolor=color_list_sand, alpha=0.5) self.axis_total_concentration.set_ylim(-1, 0) self.axis_total_concentration.set_xlabel(self.combobox_x_axis.currentText()) @@ -1887,29 +1956,38 @@ class SampleDataTab(QWidget): [x / y for x, y in zip(sample_depth_to_plot_sand, depth_bottom_to_plot_sand)], s=300, facecolor="None", edgecolor=color_list_sand, alpha=0.5) - elif stg.BS_cross_section[self.combobox_acoustic_data.currentIndex()].shape != (0,): - - self.axis_total_concentration.scatter( - Ctot_fine_percent_to_plot, - [x / y for x, y in zip(sample_depth_to_plot_fine, depth_bottom_to_plot_fine)], - s=100, facecolor=color_list_fine, edgecolor="None", alpha=0.5) - - self.axis_total_concentration.scatter( - Ctot_sand_percent_to_plot, - [x / y for x, y in zip(sample_depth_to_plot_sand, depth_bottom_to_plot_sand)], - s=300, facecolor="None", edgecolor=color_list_sand, alpha=0.5) - else: - self.axis_total_concentration.scatter( - Ctot_fine_percent_to_plot, - [x / y for x, y in zip(sample_depth_to_plot_fine, depth_bottom_to_plot_fine)], - s=100, facecolor=color_list_fine, edgecolor="None", alpha=0.5) + msgBox = QMessageBox() + msgBox.setWindowTitle("Axis choice Error") + msgBox.setIcon(QMessageBox.Warning) + msgBox.setText("Please detect bottom before plotting axis z/h") + msgBox.setStandardButtons(QMessageBox.Ok) + msgBox.exec() - self.axis_total_concentration.scatter( - Ctot_sand_percent_to_plot, - [x / y for x, y in zip(sample_depth_to_plot_sand, depth_bottom_to_plot_sand)], - s=300, facecolor="None", edgecolor=color_list_sand, alpha=0.5) + # elif stg.BS_cross_section[self.combobox_acoustic_data.currentIndex()].shape != (0,): + # + # self.axis_total_concentration.scatter( + # Ctot_fine_percent_to_plot, + # [x / y for x, y in zip(sample_depth_to_plot_fine, depth_bottom_to_plot_fine)], + # s=100, facecolor=color_list_fine, edgecolor="None", alpha=0.5) + # + # self.axis_total_concentration.scatter( + # Ctot_sand_percent_to_plot, + # [x / y for x, y in zip(sample_depth_to_plot_sand, depth_bottom_to_plot_sand)], + # s=300, facecolor="None", edgecolor=color_list_sand, alpha=0.5) + # + # else: + # + # self.axis_total_concentration.scatter( + # Ctot_fine_percent_to_plot, + # [x / y for x, y in zip(sample_depth_to_plot_fine, depth_bottom_to_plot_fine)], + # s=100, facecolor=color_list_fine, edgecolor="None", alpha=0.5) + # + # self.axis_total_concentration.scatter( + # Ctot_sand_percent_to_plot, + # [x / y for x, y in zip(sample_depth_to_plot_sand, depth_bottom_to_plot_sand)], + # s=300, facecolor="None", edgecolor=color_list_sand, alpha=0.5) self.axis_total_concentration.set_xlim(0, 100) self.axis_total_concentration.set_ylim(-1, 0)