Compare commits

..

No commits in common. "5ea7879896581d4537474b06d336a068396cfc2b" and "6dbd1e3e5cc00398b557f68234a59df2a7a92558" have entirely different histories.

4 changed files with 38 additions and 61 deletions

View File

@ -759,6 +759,7 @@ class AcousticDataTab(QWidget):
self.blockSignals(False) self.blockSignals(False)
def retranslate_acoustic_data_tab(self): def retranslate_acoustic_data_tab(self):
self.groupbox_info.setTitle(_translate("CONSTANT_STRING", cs.MEASUREMENTS_INFORMATION)) self.groupbox_info.setTitle(_translate("CONSTANT_STRING", cs.MEASUREMENTS_INFORMATION))
self.label_date_acoustic_file.setText(_translate("CONSTANT_STRING", cs.DATE) + ":") self.label_date_acoustic_file.setText(_translate("CONSTANT_STRING", cs.DATE) + ":")
@ -1201,18 +1202,10 @@ class AcousticDataTab(QWidget):
str("%4s" % stg.distance_from_ABS_to_free_surface[self.fileListWidget.currentRow()])) str("%4s" % stg.distance_from_ABS_to_free_surface[self.fileListWidget.currentRow()]))
def refresh_distance_from_ABS_to_free_surface(self): def refresh_distance_from_ABS_to_free_surface(self):
self.pushbutton_distance_from_ABS_to_free_surface.blockSignals(True) acoustic_data = AcousticDataLoader(
stg.path_BS_raw_data[self.fileListWidget.currentRow()] + "/" +
if self.combobox_ABS_system_choice.currentIndex() == 1: stg.filename_BS_raw_data[self.fileListWidget.currentRow()]
acoustic_data = AcousticDataLoader( )
stg.path_BS_raw_data[self.fileListWidget.currentRow()] + "/" +
stg.filename_BS_raw_data[self.fileListWidget.currentRow()]
)
elif self.combobox_ABS_system_choice.currentIndex() == 2:
acoustic_data = AcousticDataLoaderUBSediFlow(
stg.path_BS_raw_data[self.fileListWidget.currentRow()] + "/" +
stg.filename_BS_raw_data[self.fileListWidget.currentRow()]
)
stg.depth[self.fileListWidget.currentRow()] = acoustic_data._r stg.depth[self.fileListWidget.currentRow()] = acoustic_data._r
stg.depth_reshape[self.fileListWidget.currentRow()] = acoustic_data.reshape_r() stg.depth_reshape[self.fileListWidget.currentRow()] = acoustic_data.reshape_r()
@ -1238,8 +1231,6 @@ class AcousticDataTab(QWidget):
self.update_plot_backscattered_acoustic_signal_recording() self.update_plot_backscattered_acoustic_signal_recording()
self.update_plot_profile() self.update_plot_profile()
self.pushbutton_distance_from_ABS_to_free_surface.blockSignals(False)
def setup_temperature_value(self): def setup_temperature_value(self):
self.water_velocity() self.water_velocity()
self.water_attenuation() self.water_attenuation()
@ -1737,9 +1728,6 @@ class AcousticDataTab(QWidget):
self.fill_measurements_information_groupbox_cells() self.fill_measurements_information_groupbox_cells()
self.fill_measurements_information_groupbox_kt() self.fill_measurements_information_groupbox_kt()
self.water_velocity()
self.water_attenuation()
def fill_measurements_information_groupbox_datetime(self): def fill_measurements_information_groupbox_datetime(self):
file_id = self.fileListWidget.currentRow() file_id = self.fileListWidget.currentRow()
print("file_id ", file_id) print("file_id ", file_id)

View File

@ -14,7 +14,7 @@
# # # #
# You should have received a copy of the GNU General Public License # # You should have received a copy of the GNU General Public License #
# along with this program. If not, see <https://www.gnu.org/licenses/>. # # along with this program. If not, see <https://www.gnu.org/licenses/>. #
import math
# by Brahim MOUDJED # # by Brahim MOUDJED #
# ============================================================================== # # ============================================================================== #
@ -47,8 +47,6 @@ from matplotlib.backends.backend_qt5agg import NavigationToolbar2QT as Navigatio
from matplotlib.colors import LogNorm, BoundaryNorm from matplotlib.colors import LogNorm, BoundaryNorm
from os import path from os import path
from numba.np.arraymath import np_average
from View.show_popup_combobox import ComboBoxShowPopUpWindow from View.show_popup_combobox import ComboBoxShowPopUpWindow
from View.plot_noise_window import PlotNoiseWindow from View.plot_noise_window import PlotNoiseWindow
@ -1424,7 +1422,8 @@ class SignalProcessingTab(QWidget):
val_max = np.nanmax( val_max = np.nanmax(
BS_data[data_id][f, :, :] BS_data[data_id][f, :, :]
) )
if val_min == 0 or math.isinf(val_min):
if val_min == 0:
val_min = 1e-5 val_min = 1e-5
pcm = self.axis_BS[f].pcolormesh( pcm = self.axis_BS[f].pcolormesh(
@ -1460,10 +1459,10 @@ class SignalProcessingTab(QWidget):
self.fig_BS.supxlabel('Time (sec)', fontsize=10) self.fig_BS.supxlabel('Time (sec)', fontsize=10)
self.fig_BS.supylabel('Depth (m)', fontsize=10) self.fig_BS.supylabel('Depth (m)', fontsize=10)
# cbar = self.fig_BS.colorbar(pcm, ax=self.axis_BS[:], cbar = self.fig_BS.colorbar(pcm, ax=self.axis_BS[:],
# shrink=1, location='right') shrink=1, location='right')
# cbar.set_label(label='Acoustic backscatter signal (V)', cbar.set_label(label='Acoustic backscatter signal (V)',
# rotation=270, labelpad=10) rotation=270, labelpad=10)
self.fig_BS.canvas.draw_idle() self.fig_BS.canvas.draw_idle()
else: else:
self.verticalLayout_groupbox_plot_pre_processed_data_2D_field\ self.verticalLayout_groupbox_plot_pre_processed_data_2D_field\
@ -1509,8 +1508,15 @@ class SignalProcessingTab(QWidget):
msgBox.exec() msgBox.exec()
else: else:
data_id = self.combobox_acoustic_data_choice.currentIndex() data_id = self.combobox_acoustic_data_choice.currentIndex()
n_average = 2 * int(float(self.lineEdit_horizontal_average.text().replace(",", "."))) + 1 kernel_avg = np.ones(
kernel_avg = np.ones(n_average) 2 * int(
float(
self.lineEdit_horizontal_average\
.text()\
.replace(",", ".")
)
) + 1
)
logger.debug(f"kernel_avg: {kernel_avg}") logger.debug(f"kernel_avg: {kernel_avg}")
stg.Nb_cells_to_average_BS_signal[data_id] = ( stg.Nb_cells_to_average_BS_signal[data_id] = (
@ -1558,34 +1564,16 @@ class SignalProcessingTab(QWidget):
logger.debug(f"BS_data: {BS_data[data_id].shape}") logger.debug(f"BS_data: {BS_data[data_id].shape}")
# BS_data_ppa[data_id] = deepcopy(BS_data[data_id]) BS_data_ppa[data_id] = deepcopy(BS_data[data_id])
#
# for f, _ in enumerate(stg.freq[data_id]):
# for i in range(y_depth.shape[1]):
# BS_data_ppa[data_id][f, i, :] = (
# convolve(
# BS_data[data_id][f, i, :],
# kernel_avg
# )
# )
temp_list = []
for f, _ in enumerate(stg.freq[data_id]): for f, _ in enumerate(stg.freq[data_id]):
temp0 = np.array([])
for i in range(y_depth.shape[1]): for i in range(y_depth.shape[1]):
# temp = convolve(BS_data[data_id][f, i, :], kernel_avg, "same") / n_average BS_data_ppa[data_id][f, i, :] = (
temp = convolve(array=BS_data[data_id][f, i, :], convolve(
kernel=kernel_avg, BS_data[data_id][f, i, :],
nan_treatment='interpolate') kernel_avg
if temp0.shape == (0,): )
temp0 = np.array([temp]) )
else:
temp0 = np.append(temp0, np.array([temp]), axis=0)
temp_list.append(temp0)
BS_data_ppa[data_id] = np.array([temp_list[0]])
for j in range(stg.freq[data_id].shape[0]-1):
BS_data_ppa[data_id] = np.append(BS_data_ppa[data_id], np.array([temp_list[j+1]]), axis=0)
logger.debug( logger.debug(
f"BS_data_ppa: {BS_data_ppa[data_id].shape}" f"BS_data_ppa: {BS_data_ppa[data_id].shape}"

View File

@ -36,14 +36,14 @@
;;; We replace python-numba package by package variant without tests ;;; We replace python-numba package by package variant without tests
;; (define python-numba-no-check (define python-numba-no-check
;; (package (package
;; (inherit python-numba) (inherit python-numba)
;; (arguments `(#:tests? #f)))) (arguments `(#:tests? #f))))
;; (define rewrite-numba (define rewrite-numba
;; (package-input-rewriting/spec `(("python-numba" . (package-input-rewriting/spec `(("python-numba" .
;; ,(const python-numba-no-check))))) ,(const python-numba-no-check)))))
;;; New packages ;;; New packages
@ -204,9 +204,9 @@ user-defined extensions).")
(concatenate-manifests (concatenate-manifests
(list (packages->manifest (list python-pyqt-file-list-widget (list (packages->manifest (list python-pyqt-file-list-widget
python-qtrangeslider python-qtrangeslider
python-astropy)) (rewrite-numba python-astropy)))
(specifications->manifest (specifications->manifest
(list "python" "python-dateutil" "python-numba" (list "python" "python-dateutil"
"python-scipy" "python-scikit-learn" "python-scipy" "python-scikit-learn"
"python-pyqt@5" "python-pyqt5-sip" "python-pyqt@5" "python-pyqt5-sip"
"python-numpy@1" "python-pandas@1.5" "python-numpy@1" "python-pandas@1.5"

View File

@ -1,3 +1,4 @@
@ECHO OFF @ECHO OFF
acoused.exe > error.txt 2>&1 acoused.exe > error.txt 2>&1