diff --git a/View/sample_data_tab.py b/View/sample_data_tab.py index b125066..d6eda8e 100644 --- a/View/sample_data_tab.py +++ b/View/sample_data_tab.py @@ -986,36 +986,32 @@ class SampleDataTab(QWidget): 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]]) - if stg.depth_bottom[self.combobox_acoustic_data.currentIndex()].shape != (0,): - print("stg.time_fine ", stg.time_fine[position_list_fine[k]]) + # if stg.depth_bottom[self.combobox_acoustic_data.currentIndex()].shape != (0,): + # print("stg.time_fine ", stg.time_fine[position_list_fine[k]]) - indice_test = np.argmax(np.abs([stg.time_cross_section[self.combobox_acoustic_data.currentIndex()][ - self.combobox_frequencies.currentIndex()] - - stg.time_fine[position_list_fine[k]]])) - print("indice test ", indice_test) - print(np.where(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]])))) - indices_bottom_fine.append(np.where(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]])))[0][0]) - depth_bottom_to_plot_fine.append( - stg.depth_bottom[self.combobox_acoustic_data.currentIndex()][indices_bottom_fine[-1]]) + # if stg.time_cross_section[self.combobox_acoustic_data.currentIndex()].shape != (0,): + # + # indices_bottom_fine.append(np.where(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]])))[0][0]) + # + # elif stg.time[self.combobox_acoustic_data.currentIndex()].shape != (0,): + # + # 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]])))[0][0]) - print("depth_bottom_to_plot_fine ", depth_bottom_to_plot_fine) - print("indices_bottom_fine ", indices_bottom_fine) - - elif stg.time_cross_section[self.combobox_acoustic_data.currentIndex()].shape != (0,): + if stg.time_cross_section[self.combobox_acoustic_data.currentIndex()].shape != (0,): indices_bottom_fine.append(np.where( np.abs(stg.time_cross_section[self.combobox_acoustic_data.currentIndex()][ @@ -1024,9 +1020,7 @@ 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]])))[ 0][0]) - depth_bottom_to_plot_fine.append( - stg.depth_cross_section[self.combobox_acoustic_data.currentIndex()][ - self.combobox_frequencies.currentIndex(), -1]) + else: @@ -1038,10 +1032,29 @@ class SampleDataTab(QWidget): stg.time[self.combobox_acoustic_data.currentIndex()][self.combobox_frequencies.currentIndex()] - stg.time_fine[position_list_fine[k]])))[ 0][0]) + + print("indices_bottom_fine ", indices_bottom_fine) + + if stg.depth_cross_section[self.combobox_acoustic_data.currentIndex()].shape != (0,): + + depth_bottom_to_plot_fine.append( + stg.depth_cross_section[self.combobox_acoustic_data.currentIndex()][ + self.combobox_frequencies.currentIndex(), -1]) + + else: + depth_bottom_to_plot_fine.append( stg.depth[self.combobox_acoustic_data.currentIndex()][ self.combobox_frequencies.currentIndex(), -1]) + if stg.depth_bottom[self.combobox_acoustic_data.currentIndex()].shape != (0,): + depth_bottom_to_plot_fine.append( + stg.depth_bottom[self.combobox_acoustic_data.currentIndex()][indices_bottom_fine[-1]]) + + + + print("depth_bottom_to_plot_fine ", depth_bottom_to_plot_fine) + return Ctot_fine_to_plot, Ctot_fine_percent_to_plot, sample_depth_to_plot_fine, indices_bottom_fine, depth_bottom_to_plot_fine def extract_position_list_and_color_list_from_table_checkboxes_sand(self): @@ -1072,29 +1085,29 @@ class SampleDataTab(QWidget): Ctot_sand_to_plot.append(stg.Ctot_sand[position_list_sand[k]]) 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,): + # 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])))[0][0]) + # depth_bottom_to_plot_sand.append( + # stg.depth_bottom[self.combobox_acoustic_data.currentIndex()][indices_bottom_sand[-1]]) - 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])))[0][0]) - depth_bottom_to_plot_sand.append( - stg.depth_bottom[self.combobox_acoustic_data.currentIndex()][indices_bottom_sand[-1]]) + if stg.time_cross_section[self.combobox_acoustic_data.currentIndex()].shape != (0,): - 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])))) + # 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()][ @@ -1108,13 +1121,13 @@ class SampleDataTab(QWidget): 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]])))) + # 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( @@ -1124,10 +1137,26 @@ class SampleDataTab(QWidget): 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(), -1]) + + if stg.depth_cross_section[self.combobox_acoustic_data.currentIndex()].shape != (0,): + + depth_bottom_to_plot_sand.append( + stg.depth_cross_section[self.combobox_acoustic_data.currentIndex()][ + self.combobox_frequencies.currentIndex(), -1]) + + else: + depth_bottom_to_plot_sand.append( stg.depth[self.combobox_acoustic_data.currentIndex()][ self.combobox_frequencies.currentIndex(), -1]) + if stg.depth_bottom[self.combobox_acoustic_data.currentIndex()].shape != (0,): + depth_bottom_to_plot_sand.append( + stg.depth_bottom[self.combobox_acoustic_data.currentIndex()][indices_bottom_sand[-1]]) + return Ctot_sand_to_plot, Ctot_sand_percent_to_plot, sample_depth_to_plot_sand, indices_bottom_sand, depth_bottom_to_plot_sand def check_allChkBox(self, state):