Acoustic inversion: Fix fine and sand sample choice duplication.
parent
3e90455b4b
commit
815610ab20
|
|
@ -936,6 +936,7 @@ class AcousticInversionTab(QWidget):
|
|||
def fill_combobox_fine_sample(self):
|
||||
data_id = self.combobox_acoustic_data_choice.currentIndex()
|
||||
|
||||
self.combobox_fine_sample_choice.clear()
|
||||
self.combobox_fine_sample_choice.addItems(
|
||||
[f for f, _ in stg.sample_fine]
|
||||
)
|
||||
|
|
@ -1507,121 +1508,39 @@ class AcousticInversionTab(QWidget):
|
|||
# --- Plot sand SSC : measured vs inverted ---
|
||||
|
||||
def fill_combobox_sand_sample(self):
|
||||
data_id = self.combobox_acoustic_data_choice.currentIndex()
|
||||
|
||||
self.combobox_sand_sample_choice.addItems([f for f, _ in stg.sample_sand])
|
||||
self.combobox_sand_sample_choice.clear()
|
||||
self.combobox_sand_sample_choice.addItems(
|
||||
[f for f, _ in stg.sample_sand]
|
||||
)
|
||||
|
||||
# --- Get position (index, value) of sample in acoustic measurement space ---
|
||||
if ((stg.time_cross_section[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,)) and
|
||||
(stg.depth_cross_section[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,))):
|
||||
if stg.time_cross_section[data_id].shape != (0,):
|
||||
time_data = stg.time_cross_section
|
||||
else:
|
||||
time_data = stg.time
|
||||
|
||||
if stg.depth_cross_section[data_id].shape != (0,):
|
||||
depth_data = stg.depth_cross_section
|
||||
else:
|
||||
depth_data = stg.depth
|
||||
|
||||
freq = stg.frequency_for_inversion[1]
|
||||
for j in range(len(stg.time_sand)):
|
||||
time_diff = np.abs(time_data[data_id][freq] - stg.time_sand[j])
|
||||
depth_diff = np.abs(depth_data[data_id][freq] - (-stg.depth_sand[j]))
|
||||
|
||||
(stg.sand_sample_position.
|
||||
append(
|
||||
stg.sand_sample_position.append(
|
||||
(
|
||||
np.where(
|
||||
np.abs(stg.time_cross_section[self.combobox_acoustic_data_choice.currentIndex()][
|
||||
stg.frequency_for_inversion[1]] - stg.time_sand[j])
|
||||
==
|
||||
np.nanmin(np.abs(stg.time_cross_section[
|
||||
self.combobox_acoustic_data_choice.currentIndex()][
|
||||
stg.frequency_for_inversion[1]] - stg.time_sand[j]))
|
||||
time_diff == np.nanmin(time_diff)
|
||||
)[0][0],
|
||||
np.where(
|
||||
np.abs(stg.depth_cross_section[self.combobox_acoustic_data_choice.currentIndex()][
|
||||
stg.frequency_for_inversion[1]] - (-stg.depth_sand[j]))
|
||||
==
|
||||
np.nanmin(np.abs(stg.depth_cross_section[
|
||||
self.combobox_acoustic_data_choice.currentIndex()][
|
||||
stg.frequency_for_inversion[1]] - (-stg.depth_sand[j])))
|
||||
depth_diff == np.nanmin(depth_diff)
|
||||
)[0][0]
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
elif ((stg.time_cross_section[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,)) and
|
||||
(stg.depth[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,))):
|
||||
|
||||
for j in range(len(stg.time_sand)):
|
||||
|
||||
(stg.sand_sample_position.
|
||||
append(
|
||||
(
|
||||
np.where(
|
||||
np.abs(stg.time_cross_section[self.combobox_acoustic_data_choice.currentIndex()][
|
||||
stg.frequency_for_inversion[1]] - stg.time_sand[j])
|
||||
==
|
||||
np.nanmin(np.abs(stg.time_cross_section[
|
||||
self.combobox_acoustic_data_choice.currentIndex()][
|
||||
stg.frequency_for_inversion[1]] - stg.time_sand[j]))
|
||||
)[0][0],
|
||||
np.where(
|
||||
np.abs(stg.depth[self.combobox_acoustic_data_choice.currentIndex()][
|
||||
stg.frequency_for_inversion[1]] - (-stg.depth_sand[j]))
|
||||
==
|
||||
np.nanmin(np.abs(stg.depth[
|
||||
self.combobox_acoustic_data_choice.currentIndex()][
|
||||
stg.frequency_for_inversion[1]] - (-stg.depth_sand[j])))
|
||||
)[0][0]
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
elif ((stg.time[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,)) and
|
||||
(stg.depth_cross_section[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,))):
|
||||
|
||||
for j in range(len(stg.time_sand)):
|
||||
|
||||
(stg.sand_sample_position.
|
||||
append(
|
||||
(
|
||||
np.where(
|
||||
np.abs(stg.time[self.combobox_acoustic_data_choice.currentIndex()][
|
||||
stg.frequency_for_inversion[1]] - stg.time_sand[j])
|
||||
==
|
||||
np.nanmin(np.abs(stg.time[
|
||||
self.combobox_acoustic_data_choice.currentIndex()][
|
||||
stg.frequency_for_inversion[1]] - stg.time_sand[j]))
|
||||
)[0][0],
|
||||
np.where(
|
||||
np.abs(stg.depth_cross_section[self.combobox_acoustic_data_choice.currentIndex()][
|
||||
stg.frequency_for_inversion[1]] - (-stg.depth_sand[j]))
|
||||
==
|
||||
np.nanmin(np.abs(stg.depth_cross_section[
|
||||
self.combobox_acoustic_data_choice.currentIndex()][
|
||||
stg.frequency_for_inversion[1]] - (-stg.depth_sand[j])))
|
||||
)[0][0]
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
elif ((stg.time[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,)) and
|
||||
(stg.depth[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,))):
|
||||
|
||||
for j in range(len(stg.time_sand)):
|
||||
|
||||
(stg.sand_sample_position.
|
||||
append(
|
||||
(
|
||||
np.where(
|
||||
np.abs(stg.time[self.combobox_acoustic_data_choice.currentIndex()][
|
||||
stg.frequency_for_inversion[1]] - stg.time_sand[j])
|
||||
==
|
||||
np.nanmin(np.abs(stg.time[
|
||||
self.combobox_acoustic_data_choice.currentIndex()][
|
||||
stg.frequency_for_inversion[1]] - stg.time_sand[j]))
|
||||
)[0][0],
|
||||
np.where(
|
||||
np.abs(stg.depth[self.combobox_acoustic_data_choice.currentIndex()][
|
||||
stg.frequency_for_inversion[1]] - (-stg.depth_sand[j]))
|
||||
==
|
||||
np.nanmin(np.abs(stg.depth[
|
||||
self.combobox_acoustic_data_choice.currentIndex()][
|
||||
stg.frequency_for_inversion[1]] - (-stg.depth_sand[j])))
|
||||
)[0][0]
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
def plot_measured_vs_inverted_SSC_sand(self):
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue