Measurements Information group box has been standardized between Aquascat and UBSediflow: the same characteristics are used and value are displayed according to the frequency. Note that the modifications have been made for delete and clear data (but not yet finished).

dev-brahim
brahim 2024-05-06 10:44:57 +02:00
parent e08d769f79
commit b881cd7312
5 changed files with 995 additions and 1474 deletions

File diff suppressed because it is too large Load Diff

View File

@ -5,8 +5,7 @@ import pandas as pd
import matplotlib.pyplot as plt
from matplotlib.colors import LogNorm
# path_BS_raw_data = "/home/bmoudjed/Documents/3 SSC acoustic meas project/Graphical interface project/" \
# "Data/Acoustic_data/20180107123500.aqa"
# path_BS_raw_data = "/home/bmoudjed/Documents/2 Data/Confluence_Rhône_Isere_2018/Acoustic_data/20180107123500.aqa"
# path_BS_raw_data = "/home/bmoudjed/Documents/3 SSC acoustic meas project/Graphical interface project/" \
# "Data/AcousticNoise_data/20180107121600.aqa"
@ -16,11 +15,11 @@ class AcousticDataLoader:
def __init__(self, path_BS_raw_data: str):
self.path_BS_raw_data = path_BS_raw_data
print(self.path_BS_raw_data)
# --- Load Backscatter acoustic raw data with RawAquascatData class ---
self._data_BS = RawAquascatData(self.path_BS_raw_data)
print(self._data_BS.V.shape)
self._BS_raw_data = np.swapaxes(self._data_BS.V, 0, 1)
print(f"BS raw data shape = {self._BS_raw_data.shape}")
@ -38,19 +37,19 @@ class AcousticDataLoader:
self._date = self._data_BS.date.date()
self._hour = self._data_BS.date.time()
self._nb_profiles = self._data_BS.NumProfiles
self._nb_profiles_per_sec = self._data_BS.ProfileRate
self._nb_cells = self._data_BS.NumCells
self._cell_size = self._data_BS.cellSize
self._pulse_length = self._data_BS.TxPulseLength
self._nb_pings_per_sec = self._data_BS.PingRate
self._nb_pings_averaged_per_profile = self._data_BS.Average
self._kt = self._data_BS.Kt
self._gain_rx = self._data_BS.RxGain
self._gain_tx = self._data_BS.TxGain
self._nb_profiles = [self._data_BS.NumProfiles]*self._freq.shape[0]
self._nb_profiles_per_sec = [self._data_BS.ProfileRate]*self._freq.shape[0]
self._nb_cells = [self._data_BS.NumCells]*self._freq.shape[0]
self._cell_size = [self._data_BS.cellSize]*self._freq.shape[0]
self._pulse_length = [self._data_BS.TxPulseLength]*self._freq.shape[0]
self._nb_pings_per_sec = [self._data_BS.PingRate]*self._freq.shape[0]
self._nb_pings_averaged_per_profile = [self._data_BS.Average]*self._freq.shape[0]
self._kt = self._data_BS.Kt.tolist()
self._gain_rx = self._data_BS.RxGain.tolist()
self._gain_tx = self._data_BS.TxGain.tolist()
print(self._r[0, :][1] - self._r[1, :][0])
print(self._kt)
# print(self._r[0, :][1] - self._r[1, :][0])
# print(type(self._nb_cells), self._nb_cells)
# self._snr = np.array([])
# self._snr_reshape = np.array([])

View File

@ -32,7 +32,7 @@ from Model.udt_extract.raw_extract import raw_extract
# path_BS_raw_data0 = ("/home/bmoudjed/Documents/3 SSC acoustic meas project/Graphical interface project/Data/Raw_data_udt/")
# filename0 = "raw_20210519_130643.udt"
# path_BS_raw_data0 = ("/home/bmoudjed/Documents/3 SSC acoustic meas project/Graphical interface project/Data/Raw_data_udt/")
# path_BS_raw_data0 = ("/home/bmoudjed/Documents/2 Data/APAVER_2021/Raw_data_udt/")
# filename0 = "raw_20210520_085958.udt"
# filename = "raw_20210519_115128.udt"
@ -54,23 +54,36 @@ class AcousticDataLoaderUBSediFlow:
= raw_extract(self.path_BS_raw_data)
print(f"device_name : {device_name}")
print(f"time_begin : {time_begin}")
print(f"date begin : {time_begin.date()}")
print(f"time begin : {time_begin.time()}")
print(f"settings_dict : {settings_dict}")
# --- Date and Hour of measurements read on udt data file ---
filename = self.path_BS_raw_data[-23:]
date_and_time = datetime.datetime(year=int(filename[4:8]),
month=int(filename[8:10]),
day=int(filename[10:12]),
hour=int(filename[13:15]),
minute=int(filename[15:17]),
second=int(filename[17:19]))
self._date = date_and_time.date()
# # --- Date and Hour of measurements read on udt data file ---
# filename = self.path_BS_raw_data[-23:]
# date_and_time = datetime.datetime(year=int(filename[4:8]),
# month=int(filename[8:10]),
# day=int(filename[10:12]),
# hour=int(filename[13:15]),
# minute=int(filename[15:17]),
# second=int(filename[17:19]))
self._date = time_begin.date()
print(f"date : {self._date}")
self._hour = date_and_time.time()
self._hour = time_begin.time()
print(f"time : {self._hour}")
self._freq = np.array([[]])
self._nb_profiles = []
self._nb_profiles_per_sec = []
self._nb_cells = []
self._cell_size = []
self._pulse_length = []
self._nb_pings_per_sec = []
self._nb_pings_averaged_per_profile = []
self._kt = []
self._gain_rx = []
self._gain_tx = []
self._r = np.array([[]])
self._time = np.array([[]])
self._time_snr = np.array([[]])
@ -78,18 +91,29 @@ class AcousticDataLoaderUBSediFlow:
# self._SNR_data = np.array([[[]]])
time_len = []
time_snr_len = []
for config in param_us_dicts.keys():
# print("-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x")
# print(f"config : {config} \n")
for channel in param_us_dicts[config].keys():
print("-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x")
# print(f"channel : {channel} \n")
print(param_us_dicts[config][channel])
# print("param_us_dicts[config][channel] ", param_us_dicts[config][channel])
# print("param_us_dicts ", param_us_dicts)
# print(data_us_dicts[config][channel]['echo_avg_profile'])
# --- Frequencies ---
self._freq = np.append(self._freq, param_us_dicts[config][channel]['f0'])
self._nb_cells = np.append(self._nb_cells, param_us_dicts[config][channel]['n_cell'])
self._cell_size = np.append(self._cell_size, param_us_dicts[config][channel]['r_dcell'])
self._pulse_length = np.append(self._pulse_length, 0)
self._nb_pings_per_sec = np.append(self._nb_pings_per_sec, param_us_dicts[config][channel]['prf'])
self._nb_pings_averaged_per_profile = np.append(self._nb_pings_averaged_per_profile, param_us_dicts[config][channel]['n_p'])
self._kt = np.append(self._kt, 0)
self._gain_rx = np.append(self._gain_rx, param_us_dicts[config][channel]['a0'])
self._gain_tx = np.append(self._gain_tx, param_us_dicts[config][channel]['a1'])
# --- Depth for each frequencies ---
print("r_dcell : ", param_us_dicts[config][channel]['r_dcell'])
print("n_cell : ", param_us_dicts[config][channel]['n_cell'])
@ -145,6 +169,10 @@ class AcousticDataLoaderUBSediFlow:
self._time = np.append(self._time, time, axis=0)
print(f"self._time.shape {self._time.shape}")
self._nb_profiles = np.append(self._nb_profiles, self._time.shape[1])
self._nb_profiles_per_sec = np.append(self._nb_profiles_per_sec,
param_us_dicts[config][channel]['n_avg'])
# --- SNR Time for each frequencies ---
# time_snr = [[(t - data_us_dicts[config][channel]['snr_doppler_avg_profile']['time'][0]).total_seconds()
# for t in data_us_dicts[config][channel]['snr_doppler_avg_profile']['time']]]
@ -600,7 +628,7 @@ class AcousticDataLoaderUBSediFlow:
# fig.colorbar(pcm, ax=ax, shrink=1, location='right')
# plt.show()
def reshape_BS_raw_cross_section(self):
def reshape_BS_raw_data(self):
BS_raw_cross_section = np.reshape(self._BS_raw_data,
(self._r.shape[1]*self._time.shape[1], len(self._freq)),
order="F")

File diff suppressed because it is too large Load Diff

View File

@ -61,13 +61,14 @@ BS_stream_bed = [] # BS_data_section = BS data in the section. Values NaN o
BS_noise_cross_section = np.array([]) # BS_noise_cros_section = BS_noise_data[:, :, tmin:tmax] (former Noise_data)
SNR_cross_section = np.array([]) # SNR_data = snr[:, :, tmin:tmax]
SNR_stream_bed = np.array([])
t_cross_section = []
time_cross_section = []
t_snr = np.array([])
depth_cross_section = []
depth_bottom = []
val_bottom = []
ind_bottom = []
freq_bottom_detection = []
depth_bottom_detection_1st_int_area = []
# --- 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
@ -164,6 +165,8 @@ filename_save_as = ""
dirname_open = ""
filename_open = ""
read_table_trigger = 0