BS_cross_section_SNR_filter is renamed BS_cross_section_pre_process_SNR. BS_cross_section_averaged is renamed BS_cross_section_pre_process_average. BS_cross_section_averaged_SNR is renamed BS_cross_section_pre_process_SNR_average. BS_stream_bed_SNR_filter is renamed BS_stream_bed_pre_process_SNR. BS_stream_bed_averaged is renamed BS_stream_bed_pre_process_average. BS_stream_bed_averaged_SNR is renamed BS_stream_bed_pre_process_SNR_average.

dev-brahim
brahim 2024-02-13 16:55:40 +01:00
parent 85a816d922
commit 335cef9d76
2 changed files with 116 additions and 107 deletions

View File

@ -1157,13 +1157,13 @@ class SignalProcessingTab(QWidget):
if stg.BS_stream_bed.size == 0:
stg.BS_cross_section_SNR_filter = deepcopy(stg.BS_cross_section)
stg.BS_cross_section_pre_process_SNR = deepcopy(stg.BS_cross_section)
# stg.Noise_data = deepcopy(stg.BS_noise_averaged_data[:, :, :stg.t.shape[1]])
# stg.SNR_data_average = np.divide(
# (stg.BS_stream_bed_SNR_filter - stg.Noise_data) ** 2, stg.Noise_data ** 2)
# (stg.BS_stream_bed_pre_process_SNR - stg.Noise_data) ** 2, stg.Noise_data ** 2)
for f, _ in enumerate(stg.freq):
stg.BS_cross_section_SNR_filter[
stg.BS_cross_section_pre_process_SNR[
f,
np.where(stg.SNR_cross_section[f, :, :] < self.spinbox_SNR_criterion.value())[0],
np.where(stg.SNR_cross_section[f, :, :] < self.spinbox_SNR_criterion.value())[1]] \
@ -1171,25 +1171,25 @@ class SignalProcessingTab(QWidget):
else:
stg.BS_stream_bed_SNR_filter = deepcopy(stg.BS_stream_bed)
stg.BS_stream_bed_pre_process_SNR = deepcopy(stg.BS_stream_bed)
# stg.Noise_data = deepcopy(stg.BS_noise_averaged_data[:, :, :stg.t.shape[1]])
# stg.SNR_data_average = np.divide(
# (stg.BS_stream_bed_SNR_filter - stg.Noise_data) ** 2, stg.Noise_data ** 2)
# (stg.BS_stream_bed_pre_process_SNR - stg.Noise_data) ** 2, stg.Noise_data ** 2)
for f, _ in enumerate(stg.freq):
stg.BS_stream_bed_SNR_filter[
stg.BS_stream_bed_pre_process_SNR[
f,
np.where(stg.SNR_stream_bed[f, :, :] < self.spinbox_SNR_criterion.value())[0],
np.where(stg.SNR_stream_bed[f, :, :] < self.spinbox_SNR_criterion.value())[1]] \
= np.nan
# elif stg.BS_stream_bed_averaged.size != 0:
# stg.BS_stream_bed_SNR_filter = deepcopy(stg.BS_stream_bed_averaged)
# elif stg.BS_stream_bed_pre_process_average.size != 0:
# stg.BS_stream_bed_pre_process_SNR = deepcopy(stg.BS_stream_bed_pre_process_average)
# BS_noise_cross_section = deepcopy(stg.BS_noise_averaged_data[:, :, :stg.t.shape[1]])
# print("BS_noise_cross_section.shape ", BS_noise_cross_section.shape)
# stg.SNR_data_average = np.divide(
# (stg.BS_stream_bed_SNR_filter - BS_noise_cross_section) ** 2, BS_noise_cross_section ** 2)
# (stg.BS_stream_bed_pre_process_SNR - BS_noise_cross_section) ** 2, BS_noise_cross_section ** 2)
#
# print(stg.SNR_data_average[0, :, :])
@ -1207,7 +1207,7 @@ class SignalProcessingTab(QWidget):
# print("----------------------------------------------")
# print(np.where(stg.SNR_data_average[f, :, :] < self.spinbox_SNR_criterion.value())[0])
# print(np.where(stg.SNR_data_average[f, :, :] < self.spinbox_SNR_criterion.value())[1])
# stg.BS_stream_bed_SNR_filter[
# stg.BS_stream_bed_pre_process_SNR[
# f,
# np.where(stg.SNR_data_average[f, :, :] < self.spinbox_SNR_criterion.value())[0],
# np.where(stg.SNR_data_average[f, :, :] < self.spinbox_SNR_criterion.value())[1]] \
@ -1241,24 +1241,24 @@ class SignalProcessingTab(QWidget):
if stg.BS_stream_bed.size == 0:
val_min = np.nanmin(stg.BS_cross_section_SNR_filter[f, :, :])
val_max = np.nanmax(stg.BS_cross_section_SNR_filter[f, :, :])
val_min = np.nanmin(stg.BS_cross_section_pre_process_SNR[f, :, :])
val_max = np.nanmax(stg.BS_cross_section_pre_process_SNR[f, :, :])
if val_min == 0:
val_min = 1e-5
pcm = self.axis_BS[f].pcolormesh(stg.t[f, :], -stg.r[f, :], stg.BS_cross_section_SNR_filter[f, :, :],
pcm = self.axis_BS[f].pcolormesh(stg.t[f, :], -stg.r[f, :], stg.BS_cross_section_pre_process_SNR[f, :, :],
cmap='viridis', norm=LogNorm(vmin=val_min, vmax=val_max))
else:
val_min = np.nanmin(stg.BS_stream_bed_SNR_filter[f, :, :])
val_max = np.nanmax(stg.BS_stream_bed_SNR_filter[f, :, :])
val_min = np.nanmin(stg.BS_stream_bed_pre_process_SNR[f, :, :])
val_max = np.nanmax(stg.BS_stream_bed_pre_process_SNR[f, :, :])
if val_min == 0:
val_min = 1e-5
pcm = self.axis_BS[f].pcolormesh(stg.t[f, :], -stg.r[f, :], stg.BS_stream_bed_SNR_filter[f, :, :],
pcm = self.axis_BS[f].pcolormesh(stg.t[f, :], -stg.r[f, :], stg.BS_stream_bed_pre_process_SNR[f, :, :],
cmap='viridis', norm=LogNorm(vmin=val_min, vmax=val_max))
self.axis_BS[f].plot(stg.t[f, :], -stg.r_bottom,
@ -1289,44 +1289,44 @@ class SignalProcessingTab(QWidget):
filter_convolve = np.ones(2*self.spinbox_average_horizontal.value()+1)
print(filter_convolve)
if stg.BS_stream_bed_SNR_filter.size != 0:
if stg.BS_stream_bed_pre_process_SNR.size != 0:
stg.BS_stream_bed_averaged_SNR = deepcopy(stg.BS_stream_bed_SNR_filter)
# print(f"1/ stg.BS_stream_bed_averaged : {stg.BS_stream_bed_averaged_SNR}")
stg.BS_stream_bed_pre_process_SNR_average = deepcopy(stg.BS_stream_bed_pre_process_SNR)
# print(f"1/ stg.BS_stream_bed_pre_process_average : {stg.BS_stream_bed_pre_process_SNR_average}")
for f, _ in enumerate(stg.freq):
for i in range(stg.r.shape[1]):
stg.BS_stream_bed_averaged_SNR[f, i, :] \
= convolve1d(stg.BS_stream_bed_SNR_filter[f, i, :], weights=filter_convolve) / len(filter_convolve)
# stg.BS_stream_bed_averaged[i, f, :] \
stg.BS_stream_bed_pre_process_SNR_average[f, i, :] \
= convolve1d(stg.BS_stream_bed_pre_process_SNR[f, i, :], weights=filter_convolve) / len(filter_convolve)
# stg.BS_stream_bed_pre_process_average[i, f, :] \
# = convolve1d(stg.BS_cross_section[i, f, :], weights=filter_convolve) / filter_convolve.shape[0]
return stg.BS_stream_bed_averaged_SNR
return stg.BS_stream_bed_pre_process_SNR_average
elif stg.BS_cross_section_SNR_filter.size != 0:
elif stg.BS_cross_section_pre_process_SNR.size != 0:
stg.BS_cross_section_averaged_SNR = deepcopy(stg.BS_cross_section_SNR_filter)
print(f"2/ stg.BS_cross_section_averaged : {stg.BS_cross_section_averaged_SNR}")
stg.BS_cross_section_pre_process_SNR_average = deepcopy(stg.BS_cross_section_pre_process_SNR)
print(f"2/ stg.BS_cross_section_averaged : {stg.BS_cross_section_pre_process_SNR_average}")
for f, _ in enumerate(stg.freq):
for i in range(stg.r.shape[1]):
stg.BS_cross_section_averaged_SNR[f, i, :] \
= convolve1d(stg.BS_cross_section_SNR_filter[f, i, :],
stg.BS_cross_section_pre_process_SNR_average[f, i, :] \
= convolve1d(stg.BS_cross_section_pre_process_SNR[f, i, :],
weights=filter_convolve) / len(filter_convolve)
return stg.BS_cross_section_averaged_SNR
return stg.BS_cross_section_pre_process_SNR_average
elif stg.BS_stream_bed.size != 0:
stg.BS_stream_bed_averaged = deepcopy(stg.BS_stream_bed)
# print(f"3/ stg.BS_stream_bed_averaged : {stg.BS_stream_bed_averaged.shape}")
print(stg.BS_stream_bed_averaged[0, 10, :50])
stg.BS_stream_bed_pre_process_average = deepcopy(stg.BS_stream_bed)
# print(f"3/ stg.BS_stream_bed_pre_process_average : {stg.BS_stream_bed_pre_process_average.shape}")
print(stg.BS_stream_bed_pre_process_average[0, 10, :50])
for f, _ in enumerate(stg.freq):
for i in range(stg.r.shape[1]):
stg.BS_stream_bed_averaged[f, i, :] \
stg.BS_stream_bed_pre_process_average[f, i, :] \
= convolve1d(stg.BS_stream_bed[f, i, :],
weights=filter_convolve) / len(filter_convolve)
print(stg.BS_stream_bed_averaged[0, 10, :50])
print(stg.BS_stream_bed_pre_process_average[0, 10, :50])
return stg.BS_stream_bed_averaged
return stg.BS_stream_bed_pre_process_average
elif stg.BS_cross_section.size != 0:
@ -1356,11 +1356,11 @@ class SignalProcessingTab(QWidget):
self.axis_profile[0].cla()
self.axis_profile[1].cla()
if stg.BS_stream_bed_averaged_SNR.size != 0:
if stg.BS_stream_bed_pre_process_SNR_average.size != 0:
# --- Plot profile ---
self.axis_profile[0].plot(
stg.BS_stream_bed_averaged_SNR[self.combobox_frequency_profile.currentIndex(), :, self.slider.value() - 1],
stg.BS_stream_bed_pre_process_SNR_average[self.combobox_frequency_profile.currentIndex(), :, self.slider.value() - 1],
-stg.r[self.combobox_frequency_profile.currentIndex(), :],
linestyle='solid', color='k', linewidth=1)
self.axis_profile[0].text(.95, .05, stg.freq_text[self.combobox_frequency_profile.currentIndex()],
@ -1371,19 +1371,19 @@ class SignalProcessingTab(QWidget):
# --- Plot transect with profile position ---
self.axis_profile[1].cla()
val_min = np.nanmin(stg.BS_stream_bed_averaged_SNR[self.combobox_frequency_profile.currentIndex(), :, :])
val_max = np.nanmax(stg.BS_stream_bed_averaged_SNR[self.combobox_frequency_profile.currentIndex(), :, :])
val_min = np.nanmin(stg.BS_stream_bed_pre_process_SNR_average[self.combobox_frequency_profile.currentIndex(), :, :])
val_max = np.nanmax(stg.BS_stream_bed_pre_process_SNR_average[self.combobox_frequency_profile.currentIndex(), :, :])
if val_min == 0:
val_min = 1e-5
self.axis_profile[1].pcolormesh(stg.t[self.combobox_frequency_profile.currentIndex(), :],
-stg.r[self.combobox_frequency_profile.currentIndex(), :],
stg.BS_stream_bed_averaged_SNR[self.combobox_frequency_profile.currentIndex(), :, :],
stg.BS_stream_bed_pre_process_SNR_average[self.combobox_frequency_profile.currentIndex(), :, :],
cmap='viridis', norm=LogNorm(vmin=val_min, vmax=val_max))
elif stg.BS_cross_section_averaged_SNR.size != 0:
elif stg.BS_cross_section_pre_process_SNR_average.size != 0:
# --- Plot profile ---
self.axis_profile[0].plot(
stg.BS_cross_section_averaged_SNR[self.combobox_frequency_profile.currentIndex(), :,
stg.BS_cross_section_pre_process_SNR_average[self.combobox_frequency_profile.currentIndex(), :,
self.slider.value() - 1],
-stg.r[self.combobox_frequency_profile.currentIndex(), :],
linestyle='solid', color='k', linewidth=1)
@ -1395,21 +1395,21 @@ class SignalProcessingTab(QWidget):
# --- Plot transect with profile position ---
self.axis_profile[1].cla()
val_min = np.nanmin(stg.BS_cross_section_averaged_SNR[self.combobox_frequency_profile.currentIndex(), :, :])
val_max = np.nanmax(stg.BS_cross_section_averaged_SNR[self.combobox_frequency_profile.currentIndex(), :, :])
val_min = np.nanmin(stg.BS_cross_section_pre_process_SNR_average[self.combobox_frequency_profile.currentIndex(), :, :])
val_max = np.nanmax(stg.BS_cross_section_pre_process_SNR_average[self.combobox_frequency_profile.currentIndex(), :, :])
if val_min == 0:
val_min = 1e-5
self.axis_profile[1].pcolormesh(stg.t[self.combobox_frequency_profile.currentIndex(), :],
-stg.r[self.combobox_frequency_profile.currentIndex(), :],
stg.BS_cross_section_averaged_SNR[
stg.BS_cross_section_pre_process_SNR_average[
self.combobox_frequency_profile.currentIndex(), :, :],
cmap='viridis', norm=LogNorm(vmin=val_min, vmax=val_max))
elif stg.BS_stream_bed_SNR_filter.size != 0:
elif stg.BS_stream_bed_pre_process_SNR.size != 0:
# --- Plot profile ---
self.axis_profile[0].plot(
stg.BS_stream_bed_SNR_filter[self.combobox_frequency_profile.currentIndex(), :, self.slider.value() - 1],
stg.BS_stream_bed_pre_process_SNR[self.combobox_frequency_profile.currentIndex(), :, self.slider.value() - 1],
-stg.r[self.combobox_frequency_profile.currentIndex(), :],
linestyle='solid', color='k', linewidth=1)
self.axis_profile[0].text(.95, .05, stg.freq_text[self.combobox_frequency_profile.currentIndex()],
@ -1420,19 +1420,19 @@ class SignalProcessingTab(QWidget):
# --- Plot transect with profile position ---
self.axis_profile[1].cla()
val_min = np.nanmin(stg.BS_stream_bed_SNR_filter[self.combobox_frequency_profile.currentIndex(), :, :])
val_max = np.nanmax(stg.BS_stream_bed_SNR_filter[self.combobox_frequency_profile.currentIndex(), :, :])
val_min = np.nanmin(stg.BS_stream_bed_pre_process_SNR[self.combobox_frequency_profile.currentIndex(), :, :])
val_max = np.nanmax(stg.BS_stream_bed_pre_process_SNR[self.combobox_frequency_profile.currentIndex(), :, :])
if val_min == 0:
val_min = 1e-5
self.axis_profile[1].pcolormesh(stg.t[self.combobox_frequency_profile.currentIndex(), :],
-stg.r[self.combobox_frequency_profile.currentIndex(), :],
stg.BS_stream_bed_SNR_filter[self.combobox_frequency_profile.currentIndex(), :, :],
stg.BS_stream_bed_pre_process_SNR[self.combobox_frequency_profile.currentIndex(), :, :],
cmap='viridis', norm=LogNorm(vmin=val_min, vmax=val_max))
elif stg.BS_cross_section_SNR_filter.size != 0:
elif stg.BS_cross_section_pre_process_SNR.size != 0:
# --- Plot profile ---
self.axis_profile[0].plot(
stg.BS_cross_section_SNR_filter[self.combobox_frequency_profile.currentIndex(), :,
stg.BS_cross_section_pre_process_SNR[self.combobox_frequency_profile.currentIndex(), :,
self.slider.value() - 1],
-stg.r[self.combobox_frequency_profile.currentIndex(), :],
linestyle='solid', color='k', linewidth=1)
@ -1444,13 +1444,13 @@ class SignalProcessingTab(QWidget):
# --- Plot transect with profile position ---
self.axis_profile[1].cla()
val_min = np.nanmin(stg.BS_cross_section_SNR_filter[self.combobox_frequency_profile.currentIndex(), :, :])
val_max = np.nanmax(stg.BS_cross_section_SNR_filter[self.combobox_frequency_profile.currentIndex(), :, :])
val_min = np.nanmin(stg.BS_cross_section_pre_process_SNR[self.combobox_frequency_profile.currentIndex(), :, :])
val_max = np.nanmax(stg.BS_cross_section_pre_process_SNR[self.combobox_frequency_profile.currentIndex(), :, :])
if val_min == 0:
val_min = 1e-5
self.axis_profile[1].pcolormesh(stg.t[self.combobox_frequency_profile.currentIndex(), :],
-stg.r[self.combobox_frequency_profile.currentIndex(), :],
stg.BS_cross_section_SNR_filter[
stg.BS_cross_section_pre_process_SNR[
self.combobox_frequency_profile.currentIndex(), :, :],
cmap='viridis', norm=LogNorm(vmin=val_min, vmax=val_max))
@ -1567,40 +1567,40 @@ class SignalProcessingTab(QWidget):
filter_convolve = np.ones(self.spinbox_average_horizontal.value())
print(filter_convolve)
if stg.BS_stream_bed_SNR_filter.size != 0:
if stg.BS_stream_bed_pre_process_SNR.size != 0:
# stg.BS_stream_bed_averaged = np.zeros((stg.r.shape[0], stg.freq.shape[0], stg.t.shape[0]))
# stg.BS_stream_bed_averaged = np.zeros((stg.freq.shape[0], stg.r.shape[1], stg.t.shape[1]))
stg.BS_stream_bed_averaged = deepcopy(stg.BS_stream_bed_SNR_filter)
print(f"1/ stg.BS_stream_bed_averaged : {stg.BS_stream_bed_averaged}")
# stg.BS_stream_bed_pre_process_average = np.zeros((stg.r.shape[0], stg.freq.shape[0], stg.t.shape[0]))
# stg.BS_stream_bed_pre_process_average = np.zeros((stg.freq.shape[0], stg.r.shape[1], stg.t.shape[1]))
stg.BS_stream_bed_pre_process_average = deepcopy(stg.BS_stream_bed_pre_process_SNR)
print(f"1/ stg.BS_stream_bed_pre_process_average : {stg.BS_stream_bed_pre_process_average}")
for f, _ in enumerate(stg.freq):
for i in range(stg.r.shape[1]):
stg.BS_stream_bed_averaged[f, i, :] \
= convolve1d(stg.BS_stream_bed_SNR_filter[f, i, :], weights=filter_convolve) / len(filter_convolve)
# stg.BS_stream_bed_averaged[i, f, :] \
stg.BS_stream_bed_pre_process_average[f, i, :] \
= convolve1d(stg.BS_stream_bed_pre_process_SNR[f, i, :], weights=filter_convolve) / len(filter_convolve)
# stg.BS_stream_bed_pre_process_average[i, f, :] \
# = convolve1d(stg.BS_cross_section[i, f, :], weights=filter_convolve) / filter_convolve.shape[0]
elif stg.BS_cross_section_SNR_filter.size != 0:
elif stg.BS_cross_section_pre_process_SNR.size != 0:
stg.BS_cross_section_averaged = deepcopy(stg.BS_cross_section_SNR_filter)
stg.BS_cross_section_averaged = deepcopy(stg.BS_cross_section_pre_process_SNR)
print(f"2/ stg.BS_cross_section_averaged : {stg.BS_cross_section_averaged}")
for f, _ in enumerate(stg.freq):
for i in range(stg.r.shape[1]):
stg.BS_stream_bed_averaged[f, i, :] \
= convolve1d(stg.BS_cross_section_SNR_filter[f, i, :],
stg.BS_stream_bed_pre_process_average[f, i, :] \
= convolve1d(stg.BS_cross_section_pre_process_SNR[f, i, :],
weights=filter_convolve) / len(filter_convolve)
elif stg.BS_stream_bed.size != 0:
stg.BS_stream_bed_averaged = deepcopy(stg.BS_stream_bed)
print(f"3/ stg.BS_stream_bed_averaged : {stg.BS_stream_bed_averaged.shape}")
print(stg.BS_stream_bed_averaged[0, 10, :50])
stg.BS_stream_bed_pre_process_average = deepcopy(stg.BS_stream_bed)
print(f"3/ stg.BS_stream_bed_pre_process_average : {stg.BS_stream_bed_pre_process_average.shape}")
print(stg.BS_stream_bed_pre_process_average[0, 10, :50])
for f, _ in enumerate(stg.freq):
for i in range(stg.r.shape[1]):
stg.BS_stream_bed_averaged[f, i, :] \
stg.BS_stream_bed_pre_process_average[f, i, :] \
= convolve1d(stg.BS_stream_bed[f, i, :],
weights=filter_convolve) / len(filter_convolve)
print(stg.BS_stream_bed_averaged[0, 10, :50])
print(stg.BS_stream_bed_pre_process_average[0, 10, :50])
elif stg.BS_cross_section.size != 0:
@ -1627,14 +1627,14 @@ class SignalProcessingTab(QWidget):
self.slider.valueChanged.connect(self.update_plot_averaged_profile)
# fig, ax = plt.subplots(nrows=1, ncols=1)
# val_min = np.nanmin(stg.BS_stream_bed_averaged[self.combobox_frequency.currentIndex(), :, :])
# val_max = np.nanmax(stg.BS_stream_bed_averaged[self.combobox_frequency.currentIndex(), :, :])
# val_min = np.nanmin(stg.BS_stream_bed_pre_process_average[self.combobox_frequency.currentIndex(), :, :])
# val_max = np.nanmax(stg.BS_stream_bed_pre_process_average[self.combobox_frequency.currentIndex(), :, :])
# if val_min == 0:
# val_min = 1e-5
#
# ax.pcolormesh(stg.t[self.combobox_frequency.currentIndex(), :],
# -stg.r[self.combobox_frequency.currentIndex(), :],
# stg.BS_stream_bed_averaged[self.combobox_frequency.currentIndex(), :, :],
# stg.BS_stream_bed_pre_process_average[self.combobox_frequency.currentIndex(), :, :],
# cmap='viridis', norm=LogNorm(vmin=val_min, vmax=val_max))
#
# plt.show()
@ -1708,14 +1708,14 @@ class SignalProcessingTab(QWidget):
print(f"self.range_cells_function() shape : {self.range_cells_function().shape}")
R_real = np.repeat(self.range_cells_function()[:, :, np.newaxis], stg.t.shape[1], axis=2)
print(f"R_real shape : {R_real.shape}")
if (stg.BS_stream_bed_averaged.size == 0) and (stg.BS_stream_bed_SNR_filter.size == 0):
if (stg.BS_stream_bed_pre_process_average.size == 0) and (stg.BS_stream_bed_pre_process_SNR.size == 0):
stg.FCB = (np.log(stg.BS_stream_bed) + np.log(R_real) +
2 * stg.water_attenuation * R_real)
elif stg.BS_stream_bed_SNR_filter.size == 0:
stg.FCB = (np.log(stg.BS_stream_bed_averaged) + np.log(R_real) +
elif stg.BS_stream_bed_pre_process_SNR.size == 0:
stg.FCB = (np.log(stg.BS_stream_bed_pre_process_average) + np.log(R_real) +
2 * stg.water_attenuation * R_real)
else:
stg.FCB = (np.log(stg.BS_stream_bed_SNR_filter) + np.log(R_real) +
stg.FCB = (np.log(stg.BS_stream_bed_pre_process_SNR) + np.log(R_real) +
2 * stg.water_attenuation * R_real)
self.plot_FCB()
@ -1867,7 +1867,7 @@ class SignalProcessingTab(QWidget):
if stg.BS_stream_bed.size != 0:
if (stg.BS_stream_bed_averaged.size == 0) and (stg.BS_stream_bed_SNR_filter.size == 0):
if (stg.BS_stream_bed_pre_process_average.size == 0) and (stg.BS_stream_bed_pre_process_SNR.size == 0):
self.axis_plot_profile_position_on_transect.cla()
@ -1889,12 +1889,12 @@ class SignalProcessingTab(QWidget):
np.log(stg.BS_stream_bed[self.combobox_frequency.currentIndex(), :, :]),
cmap='Blues')
elif (stg.BS_stream_bed_averaged.size != 0) and (stg.BS_stream_bed_SNR_filter.size == 0):
elif (stg.BS_stream_bed_pre_process_average.size != 0) and (stg.BS_stream_bed_pre_process_SNR.size == 0):
self.axis_plot_profile_position_on_transect.cla()
val_min = np.nanmin(stg.BS_stream_bed_averaged[self.combobox_frequency.currentIndex(), :, :])
val_max = np.nanmax(stg.BS_stream_bed_averaged[self.combobox_frequency.currentIndex(), :, :])
val_min = np.nanmin(stg.BS_stream_bed_pre_process_average[self.combobox_frequency.currentIndex(), :, :])
val_max = np.nanmax(stg.BS_stream_bed_pre_process_average[self.combobox_frequency.currentIndex(), :, :])
if val_min == 0:
val_min = 1e-5
@ -1902,21 +1902,21 @@ class SignalProcessingTab(QWidget):
self.axis_plot_profile_position_on_transect.pcolormesh(
stg.t[self.combobox_frequency.currentIndex(), :],
-stg.r[self.combobox_frequency.currentIndex(), :],
stg.BS_stream_bed_averaged[self.combobox_frequency.currentIndex(), :, :],
stg.BS_stream_bed_pre_process_average[self.combobox_frequency.currentIndex(), :, :],
cmap='viridis', norm=LogNorm(vmin=val_min, vmax=val_max))
elif stg.ABS_name == "UB-SediFlow":
self.axis_plot_profile_position_on_transect.pcolormesh(
stg.t[self.combobox_frequency.currentIndex(), :],
-stg.r[self.combobox_frequency.currentIndex(), :],
np.log(stg.BS_stream_bed_averaged[self.combobox_frequency.currentIndex(), :, :]),
np.log(stg.BS_stream_bed_pre_process_average[self.combobox_frequency.currentIndex(), :, :]),
cmap='Blues')
elif stg.BS_stream_bed_SNR_filter.size != 0:
elif stg.BS_stream_bed_pre_process_SNR.size != 0:
self.axis_plot_profile_position_on_transect.cla()
val_min = np.nanmin(stg.BS_stream_bed_SNR_filter[self.combobox_frequency.currentIndex(), :, :])
val_max = np.nanmax(stg.BS_stream_bed_SNR_filter[self.combobox_frequency.currentIndex(), :, :])
val_min = np.nanmin(stg.BS_stream_bed_pre_process_SNR[self.combobox_frequency.currentIndex(), :, :])
val_max = np.nanmax(stg.BS_stream_bed_pre_process_SNR[self.combobox_frequency.currentIndex(), :, :])
if val_min == 0:
val_min = 1e-5
@ -1924,18 +1924,18 @@ class SignalProcessingTab(QWidget):
self.axis_plot_profile_position_on_transect.pcolormesh(
stg.t[self.combobox_frequency.currentIndex(), :],
-stg.r[self.combobox_frequency.currentIndex(), :],
stg.BS_stream_bed_SNR_filter[self.combobox_frequency.currentIndex(), :, :],
stg.BS_stream_bed_pre_process_SNR[self.combobox_frequency.currentIndex(), :, :],
cmap='viridis', norm=LogNorm(vmin=val_min, vmax=val_max))
elif stg.ABS_name == "UB-SediFlow":
self.axis_plot_profile_position_on_transect.pcolormesh(
stg.t[self.combobox_frequency.currentIndex(), :],
-stg.r[self.combobox_frequency.currentIndex(), :],
np.log(stg.BS_stream_bed_SNR_filter[self.combobox_frequency.currentIndex(), :, :]),
np.log(stg.BS_stream_bed_pre_process_SNR[self.combobox_frequency.currentIndex(), :, :]),
cmap='Blues')
else:
if (stg.BS_cross_section_averaged.size == 0) and (stg.BS_cross_section_SNR_filter.size == 0):
if (stg.BS_cross_section_averaged.size == 0) and (stg.BS_cross_section_pre_process_SNR.size == 0):
self.axis_plot_profile_position_on_transect.cla()
@ -1957,7 +1957,7 @@ class SignalProcessingTab(QWidget):
np.log(stg.BS_cross_section[self.combobox_frequency.currentIndex(), :, :]),
cmap='Blues')
elif (stg.BS_cross_section_averaged.size != 0) and (stg.BS_cross_section_SNR_filter.size == 0):
elif (stg.BS_cross_section_averaged.size != 0) and (stg.BS_cross_section_pre_process_SNR.size == 0):
self.axis_plot_profile_position_on_transect.cla()
@ -1979,12 +1979,12 @@ class SignalProcessingTab(QWidget):
np.log(stg.BS_cross_section_averaged[self.combobox_frequency.currentIndex(), :, :]),
cmap='Blues')
elif stg.BS_cross_section_SNR_filter.size != 0:
elif stg.BS_cross_section_pre_process_SNR.size != 0:
self.axis_plot_profile_position_on_transect.cla()
val_min = np.nanmin(stg.BS_cross_section_SNR_filter[self.combobox_frequency.currentIndex(), :, :])
val_max = np.nanmax(stg.BS_cross_section_SNR_filter[self.combobox_frequency.currentIndex(), :, :])
val_min = np.nanmin(stg.BS_cross_section_pre_process_SNR[self.combobox_frequency.currentIndex(), :, :])
val_max = np.nanmax(stg.BS_cross_section_pre_process_SNR[self.combobox_frequency.currentIndex(), :, :])
if val_min == 0:
val_min = 1e-5
@ -1992,13 +1992,13 @@ class SignalProcessingTab(QWidget):
self.axis_plot_profile_position_on_transect.pcolormesh(
stg.t[self.combobox_frequency.currentIndex(), :],
-stg.r[self.combobox_frequency.currentIndex(), :],
stg.BS_cross_section_SNR_filter[self.combobox_frequency.currentIndex(), :, :],
stg.BS_cross_section_pre_process_SNR[self.combobox_frequency.currentIndex(), :, :],
cmap='viridis', norm=LogNorm(vmin=val_min, vmax=val_max))
elif stg.ABS_name == "UB-SediFlow":
self.axis_plot_profile_position_on_transect.pcolormesh(
stg.t[self.combobox_frequency.currentIndex(), :],
-stg.r[self.combobox_frequency.currentIndex(), :],
np.log(stg.BS_cross_section_SNR_filter[self.combobox_frequency.currentIndex(), :, :]),
np.log(stg.BS_cross_section_pre_process_SNR[self.combobox_frequency.currentIndex(), :, :]),
cmap='Blues')
if stg.r_bottom.size != 0:
@ -2141,7 +2141,7 @@ class SignalProcessingTab(QWidget):
def plot_averaged_profile(self):
if stg.BS_stream_bed_averaged.size == 0:
if stg.BS_stream_bed_pre_process_average.size == 0:
for f, _ in enumerate(stg.freq):
self.axis_averaged_profile[f].cla()
@ -2158,7 +2158,7 @@ class SignalProcessingTab(QWidget):
for f, _ in enumerate(stg.freq):
self.axis_averaged_profile[f].cla()
self.axis_averaged_profile[f].plot(stg.BS_stream_bed_averaged[f, :, self.slider.value()-1], -stg.r[f, :],
self.axis_averaged_profile[f].plot(stg.BS_stream_bed_pre_process_average[f, :, self.slider.value()-1], -stg.r[f, :],
linestyle='solid', color='k', linewidth=1)
# self.axis_averaged_profile[f].set_ylim(-np.max(stg.r[f, :]), np.min(stg.r[f, :]))
self.axis_averaged_profile[f].text(.95, .05, stg.freq_text[f],
@ -2182,7 +2182,7 @@ class SignalProcessingTab(QWidget):
else:
if stg.BS_stream_bed_averaged.size == 0:
if stg.BS_stream_bed_pre_process_average.size == 0:
for f, _ in enumerate(stg.freq):
self.axis_averaged_profile[f].cla()
@ -2200,7 +2200,7 @@ class SignalProcessingTab(QWidget):
for f, _ in enumerate(stg.freq):
self.axis_averaged_profile[f].cla()
self.axis_averaged_profile[f].plot(stg.BS_stream_bed_averaged[f, :, self.slider.value() - 1],
self.axis_averaged_profile[f].plot(stg.BS_stream_bed_pre_process_average[f, :, self.slider.value() - 1],
-stg.r[f, :],
linestyle='solid', color='k', linewidth=1)
# self.axis_averaged_profile[f].set_ylim(-np.max(stg.r[f, :]), np.min(stg.r[f, :]))

View File

@ -67,12 +67,21 @@ ind_bottom = np.array([])
freq_bottom_detection = 0
# --- Processed data in Signal Processing Tab ---
BS_cross_section_SNR_filter = np.array([[[]]]) # BS data filtered with SNR values (remove point if SNR < value) - bottom is not detected
BS_stream_bed_SNR_filter = np.array([]) # BS data filtered with SNR values (remove point if SNR < value) - bottom is detected
BS_cross_section_averaged = np.array([[[]]]) # BS data averaged - bottom is not detected
BS_stream_bed_averaged = np.array([]) # BS data averaged - bottom is detected
BS_cross_section_averaged_SNR = np.array([[[]]]) # BS data averaged and filtered with SNR - bottom is not detected
BS_stream_bed_averaged_SNR = np.array([]) # BS data averaged and filtered with SNR - bottom is detected
# BS_cross_section_SNR_filter = np.array([[[]]]) # BS data filtered with SNR values (remove point if SNR < value) - bottom is not detected
# BS_stream_bed_SNR_filter = np.array([]) # BS data filtered with SNR values (remove point if SNR < value) - bottom is detected
# BS_cross_section_averaged = np.array([[[]]]) # BS data averaged - bottom is not detected
# BS_stream_bed_averaged = np.array([]) # BS data averaged - bottom is detected
# BS_cross_section_averaged_SNR = np.array([[[]]]) # BS data averaged and filtered with SNR - bottom is not detected
# BS_stream_bed_averaged_SNR = np.array([]) # BS data averaged and filtered with SNR - bottom is detected
BS_cross_section_pre_process_SNR = np.array([[[]]]) # BS data filtered with SNR values (remove point if SNR < value) - bottom is not detected
BS_cross_section_pre_process_average = np.array([[[]]]) # BS data averaged - bottom is not detected
BS_cross_section_pre_process_SNR_average = np.array([[[]]]) # BS data averaged and filtered with SNR - bottom is not detected
BS_stream_bed_pre_process_SNR = np.array([]) # BS data filtered with SNR values (remove point if SNR < value) - bottom is detected
BS_stream_bed_pre_process_average = np.array([]) # BS data averaged - bottom is detected
BS_stream_bed_pre_process_SNR_averaged = np.array([]) # BS data averaged and filtered with SNR - bottom is detected
time_average = np.array([])
SNR_data_average = np.array([]) # SNR data computed with BS signal averaged (not with BS raw signal)