File setting is created to store global variables used all along tabs. Acoustic data tab is re-write with global variables.

This commit is contained in:
brahim committed 2023-08-08 15:40:35 +02:00
1 parent 2905226f2a
commit 58138d0e4e
3 files changed
+405 -226

No files matched your search

+24 -21
View File
@@ -5,10 +5,10 @@ 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_noise_data = "/home/bmoudjed/Documents/3 SSC acoustic meas project/Graphical interface project/" \
"Data/AcousticNoise_data/20180107121600.aqa"
# path_BS_raw_data = "/home/bmoudjed/Documents/3 SSC acoustic meas project/Graphical interface project/" \
# "Data/Acoustic_data/20180107123500.aqa"
# path_noise_data = "/home/bmoudjed/Documents/3 SSC acoustic meas project/Graphical interface project/" \
# "Data/AcousticNoise_data/20180107121600.aqa"
class AcousticDataLoader():
@@ -39,29 +39,32 @@ class AcousticDataLoader():
self._gain_rx = self._data_BS.RxGain
self._gain_tx = self._data_BS.TxGain
self._snr = np.array([])
self._snr_reshape = np.array([])
self._time_snr = np.array([])
# self._snr = np.array([])
# self._snr_reshape = np.array([])
# self._time_snr = np.array([])
# print(type(self._gain_tx))
# print(["BS - " + f for f in self._freq_text])
# print(self._time.shape[0]*self._r.shape[0]*4)
# fig, ax = plt.subplots(nrows=1, ncols=1)
# ax.pcolormesh(self._time, self._r, np.flipud(self._BS_raw_data[:, 1, :]),
# ax.pcolormesh(self._time, self._r, (self._BS_raw_data[:, 1, :]),
# cmap='viridis',
# norm=LogNorm(vmin=1e-5, vmax=np.max(self._BS_raw_data[:, 0, :]))) # , shading='gouraud')
# ax.pcolormesh(range(self._BS_raw_data.shape[2]), range(self._BS_raw_data.shape[0]), self._BS_raw_data[:, 1, :], cmap='viridis',
# norm=LogNorm(vmin=1e-5, vmax=np.max(self._BS_raw_data[:, 0, :]))) # , shading='gouraud')
# # ax.pcolormesh(range(self._BS_raw_data.shape[2]), range(self._BS_raw_data.shape[0]), self._BS_raw_data[:, 1, :], cmap='viridis',
# # norm=LogNorm(vmin=1e-5, vmax=np.max(self._BS_raw_data[:, 0, :]))) # , shading='gouraud')
# plt.show()
# fig, ax = plt.subplots(nrows=1, ncols=1)
# ax.plot(self._BS_raw_data[:, 0, 100] , self._r)
# ax.set_ylim(2, 20)
# plt.show()
# print(self.reshape_BS_raw_cross_section()[0, 0])
# self.reshape_r()
# self.reshape_t()
# dataframe = self.concatenate_data()
# print(dataframe)
def reshape_BS_raw_cross_section(self):
BS_raw_cross_section = np.reshape(self._BS_raw_data,
(self._r.shape[0]*len(self._time), self._freq.shape[0]),
@@ -78,14 +81,14 @@ class AcousticDataLoader():
t = np.reshape(np.repeat(self._time, self._r.shape[0]), (self._time.shape[0]*self._r.shape[0], 1))
return t
def concatenate_data(self):
self.reshape_t()
self.reshape_BS_raw_cross_section()
# print(self.reshape_t().shape)
# print(se.lf.reshape_BS_raw_cross_section().shape)
df = pd.DataFrame(np.concatenate((self.reshape_t(), self.reshape_BS_raw_cross_section()), axis=1),
columns=["time"] + self._freq_text)
return df
# def concatenate_data(self):
# self.reshape_t()
# self.reshape_BS_raw_cross_section()
# # print(self.reshape_t().shape)
# # print(se.lf.reshape_BS_raw_cross_section().shape)
# df = pd.DataFrame(np.concatenate((self.reshape_t(), self.reshape_BS_raw_cross_section()), axis=1),
# columns=["time"] + self._freq_text)
# return df
# if __name__ == "__main__":