mirror of
https://forgemia.inra.fr/theophile.terraz/acoused.git
synced 2026-10-30 03:10:40 +01:00
Signal processing: Fix open study file crash.
This commit is contained in:
1 parent
413e8fb18e
commit
0cd9964594
4 files changed
+45
-30
No files matched your search
@@ -107,18 +107,18 @@ class ReadTableForOpen:
|
||||
FROM AcousticFile
|
||||
WHERE (acoustic_data = {k})
|
||||
'''
|
||||
data = self.execute(query)
|
||||
data = self.execute(query)[0]
|
||||
print("data acoustic file", data)
|
||||
|
||||
stg.filename_BS_raw_data.append(
|
||||
[str(y[1]) + '.aqa' for y in data][0]
|
||||
str(data[1]) + '.aqa'
|
||||
)
|
||||
stg.ABS_name.append([z[2] for z in data][0])
|
||||
stg.path_BS_noise_data.append([z[3] for z in data][0])
|
||||
stg.filename_BS_noise_data.append([z[4] for z in data][0])
|
||||
stg.noise_method.append([z[5] for z in data][0])
|
||||
stg.noise_value.append([z[6] for z in data][0])
|
||||
stg.data_preprocessed.append([z[7] for z in data][0])
|
||||
stg.ABS_name.append(data[2])
|
||||
stg.path_BS_noise_data.append(data[3])
|
||||
stg.filename_BS_noise_data.append(data[4])
|
||||
stg.noise_method.append(data[5])
|
||||
stg.noise_value.append(data[6])
|
||||
stg.data_preprocessed.append(data[7])
|
||||
|
||||
logger.debug("data acoustic file:")
|
||||
logger.debug(f"- {stg.filename_BS_raw_data}")
|
||||
@@ -370,6 +370,7 @@ class ReadTableForOpen:
|
||||
stg.time_noise.append(np.array([]))
|
||||
stg.depth_noise.append(np.array([]))
|
||||
stg.BS_noise_raw_data.append(np.array([]))
|
||||
stg.BS_noise_averaged_data.append(np.array([]))
|
||||
else:
|
||||
stg.time_noise.append(
|
||||
np_f64_parse(time).reshape(
|
||||
@@ -390,6 +391,7 @@ class ReadTableForOpen:
|
||||
)
|
||||
)
|
||||
)
|
||||
stg.BS_noise_averaged_data.append(np.array([]))
|
||||
|
||||
def read_table_BS_raw_data_SNR(self, query, i):
|
||||
np_f64_parse = lambda d: np.frombuffer(d, dtype=np.float64)
|
||||
@@ -406,9 +408,11 @@ class ReadTableForOpen:
|
||||
SNR_vars = [
|
||||
(stg.SNR_raw_data, stg.BS_raw_data),
|
||||
(stg.SNR_cross_section, stg.BS_cross_section),
|
||||
(stg.SNR_cross_section, stg.BS_stream_bed),
|
||||
(stg.SNR_stream_bed, stg.BS_stream_bed),
|
||||
]
|
||||
|
||||
stg.SNR_stream_bed.append(np.array([]))
|
||||
|
||||
for dest, resh in SNR_vars:
|
||||
SNR = np_f64_parse(next(it))
|
||||
|
||||
@@ -417,7 +421,6 @@ class ReadTableForOpen:
|
||||
else:
|
||||
dest.append(SNR.reshape(resh[i].shape))
|
||||
|
||||
|
||||
def read_table_BS_raw_data_rest(self, query, i):
|
||||
np_f64_parse = lambda d: np.frombuffer(d, dtype=np.float64)
|
||||
data = self.execute(
|
||||
@@ -481,16 +484,21 @@ class ReadTableForOpen:
|
||||
WHERE (acoustic_data = {s})
|
||||
'''
|
||||
|
||||
data3 = self.execute(query3)
|
||||
data = self.execute(query3)
|
||||
x = data[0]
|
||||
|
||||
stg.temperature = [x[1] for x in data3][0]
|
||||
stg.tmin.append([(x[2], x[3]) for x in data3])
|
||||
stg.tmax.append([(x[4], x[5]) for x in data3])
|
||||
stg.rmin.append([(x[6], x[7]) for x in data3])
|
||||
stg.rmax.append([(x[8], x[9]) for x in data3])
|
||||
stg.freq_bottom_detection.append([(x[10], x[11]) for x in data3])
|
||||
stg.SNR_filter_value.append([x[12] for x in data3])
|
||||
stg.Nb_cells_to_average_BS_signal.append([x[13] for x in data3])
|
||||
stg.temperature = [x[1]][0]
|
||||
stg.tmin.append((x[2], x[3]))
|
||||
stg.tmax.append((x[4], x[5]))
|
||||
stg.rmin.append((x[6], x[7]))
|
||||
stg.rmax.append((x[8], x[9]))
|
||||
stg.freq_bottom_detection.append((x[10], x[11]))
|
||||
stg.SNR_filter_value.append(x[12])
|
||||
stg.Nb_cells_to_average_BS_signal.append(x[13])
|
||||
|
||||
logger.debug(f"stg.tmin: {stg.tmin}")
|
||||
logger.debug(f"stg.tmin: {stg.tmax}")
|
||||
logger.debug(f"stg.SNR_filter_value: {stg.SNR_filter_value}")
|
||||
|
||||
def read_table_sediment_file(self):
|
||||
query = f'''
|
||||
|
||||
Reference in new issue
Block a user