Mainwindow: Minor change.

dev-brahim
Pierre-Antoine 2025-03-17 10:44:49 +01:00
parent 5cf87a5e7b
commit 11ced0a263
1 changed files with 27 additions and 18 deletions

View File

@ -326,23 +326,21 @@ class Ui_MainWindow(object):
self.open_doc_file('Tutorial_AQUAscat_software.pdf')
def export_table_of_acoustic_BS_values_to_excel_or_libreOfficeCalc_file(self):
if len(stg.BS_raw_data_reshape) != 0:
# --- Open file dialog to select the directory ---
name = QtWidgets.QFileDialog.getExistingDirectory(caption="Select Directory - Acoustic BS raw data Table")
name = QtWidgets.QFileDialog.getExistingDirectory(
caption="Select Directory - Acoustic BS raw data Table"
)
print("name table to save ", name)
# --- Save the raw acoustic backscatter data from a Dataframe to csv file ---
# --- Save the raw acoustic backscatter data from a
# --- Dataframe to csv file ---
t0 = time.time()
print("len(stg.BS_raw_data_reshape) ", len(stg.BS_raw_data_reshape))
print("len(stg.BS_raw_data_reshape) ",
len(stg.BS_raw_data_reshape))
if name:
for i in range(len(stg.BS_raw_data_reshape)):
header_list = []
header_list.clear()
table_data = np.array([[]])
@ -352,17 +350,28 @@ class Ui_MainWindow(object):
header_list.append("BS - " + freq_value)
if freq_ind == 0:
table_data = np.vstack((np.vstack((stg.time_reshape[i][:, freq_ind],
stg.depth_reshape[i][:, freq_ind])),
stg.BS_raw_data_reshape[i][:, freq_ind]))
table_data = np.vstack(
(
np.vstack(
(stg.time_reshape[i][:, freq_ind],
stg.depth_reshape[i][:, freq_ind])),
stg.BS_raw_data_reshape[i][:, freq_ind]
)
)
else:
table_data = np.vstack((table_data,
np.vstack((np.vstack(
(stg.time_reshape[i][:, freq_ind],
stg.depth_reshape[i][:, freq_ind])),
stg.BS_raw_data_reshape[i][:, freq_ind]))
))
table_data = np.vstack(
(
table_data,
np.vstack((
np.vstack((
stg.time_reshape[i][:, freq_ind],
stg.depth_reshape[i][:, freq_ind]
)),
stg.BS_raw_data_reshape[i][:, freq_ind]
))
)
)
DataFrame_acoustic = pd.DataFrame(None)
DataFrame_acoustic = pd.DataFrame(