acoused/settings.py

175 lines
5.7 KiB
Python

""" this file includs global variables shared between tab """
import numpy as np
import pandas as pd
import datetime
# --- load raw data ---
ABS_name = []
path_BS_raw_data = []
filename_BS_raw_data = []
BS_raw_data = [] # BS raw data : all measurement (go and back)
depth = []
depth_2D = []
freq = []
freq_text = []
time = []
path_BS_noise_data = ""
filename_BS_noise_data = ""
BS_noise_raw_data = np.array([]) # BS noise raw data : BS signal listen
BS_noise_averaged_data = np.array([]) # BS noise raw data averaged (array has the same shape than BS_raw_data shape)
date = []
date_noise = []
hour = []
hour_noise = []
nb_profiles = []
nb_profiles_per_sec = []
nb_cells = []
cell_size = []
pulse_length = []
nb_pings_per_sec = []
nb_pings_averaged_per_profile = []
kt_read = []
kt_corrected = []
gain_rx = []
gain_tx = []
SNR_data = np.array([]) # SNR is computed with BS_noise_averaged_data
time_snr = np.array([])
# --- reshape raw data for table of values in Acoustic Data tab ---
time_reshape = []
time_snr_reshape = np.array([])
depth_reshape = []
BS_raw_data_reshape = []
SNR_reshape = np.array([]) # snr is reshape to be included in table of values in acoustic data tab
DataFrame_acoustic = pd.DataFrame()
# --- Processed data in Acoustic Data Tab and used in Acoustic processing tab ---
tmin = [] # minimum boundary of time (spin box tmin)
tmin_snr = np.array([])
tmax = [] # maximum boundary of time (spin box tmin)
tmax_snr = np.array([])
rmin = []
rmax = []
BS_cross_section = [] # BS data limited with tmin and tmax values of spin box
# BS_data = stg.BS_raw_data[f, :, int(stg.tmin[f]):int(stg.tmax[f])]
BS_stream_bed = [] # BS_data_section = BS data in the section. Values NaN outside the bottom of the section are deleted
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([])
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
# BS_cross_section_averaged = np.array([[[]]]) # BS data averaged - bottom is not detected
# BS_cross_section_averaged_SNR = np.array([[[]]]) # BS data averaged and filtered with SNR - bottom is not detected
# BS_stream_bed_SNR_filter = np.array([]) # BS data filtered with SNR values (remove point if SNR < value) - bottom is detected
# BS_stream_bed_averaged = np.array([]) # BS data averaged - bottom is detected
# BS_stream_bed_averaged_SNR = np.array([]) # BS data averaged and filtered with SNR - bottom is detected
BS_cross_section_pre_process_SNR = np.array([[[]]]) # BS data filtered with SNR values (remove point if SNR < value) - bottom is not detected
BS_cross_section_pre_process_average = np.array([[[]]]) # BS data averaged - bottom is not detected
BS_cross_section_pre_process_SNR_average = np.array([[[]]]) # BS data averaged and filtered with SNR - bottom is not detected
BS_stream_bed_pre_process_SNR = np.array([]) # BS data filtered with SNR values (remove point if SNR < value) - bottom is detected
BS_stream_bed_pre_process_average = np.array([]) # BS data averaged - bottom is detected
BS_stream_bed_pre_process_SNR_average = np.array([]) # BS data averaged and filtered with SNR - bottom is detected
time_average = np.array([])
SNR_data_average = np.array([]) # SNR data computed with BS signal averaged (not with BS raw signal)
water_attenuation = 0
sediment_attenuation = 0
FCB = np.array([])
lin_reg = tuple()
# --- Sample Data ---
samples = []
fine_sediment_path = ""
fine_sediment_filename = ""
fine_sediment_columns = []
sample_distance_from_bank = np.array([]) # distance from left bank (m)
sample_depth = np.array([]) # depth (m)
sample_time = np.array([])
radius_grain = np.array([]) # grain radius (um)
Ctot_fine = np.array([]) # Total concentration (g/L)
D50_fine = np.array([]) # median diameter (um)
frac_vol_fine = np.array([]) # Volume fraction (%)
frac_vol_fine_cumul = np.array([]) # Cumulated volume fraction (%)
sand_sediment_path = ""
sand_sediment_filename = ""
sand_sediment_columns = []
Ctot_sand = np.array([]) # Total concentration (g/L)
D50_sand = np.array([]) # median diameter (um)
frac_vol_sand = np.array([]) # Volume fraction (%)
frac_vol_sand_cumul = np.array([]) # Cumulated volume fraction (%)
Ctot_fine_per_cent = np.array([])
Ctot_sand_per_cent = np.array([])
# --- Acoustic inversion method ---
temperature = []
water_attenuation = np.array([])
water_velocity = 0
X_exponent = np.array([])
zeta = np.array([])
# kt_corrected = np.array([])
# kt_corrected_2D = np.array([])
# kt_corrected_3D = np.array([])
J_cross_section = np.array([])
J_stream_bed = np.array([[[]]])
frequencies_to_compute_VBI = np.array([])
VBI_cross_section = np.array([])
VBI_stream_bed = np.array([[[]]])
frequency_to_compute_SSC = 0
ks = 0
sv = 0
alpha_s = 0
SSC_fine = np.array(())
SSC_sand = np.array([])
# --- Save study ---
acoustic_data = []
dirname_save_as = ""
filename_save_as = ""
dirname_open = ""
filename_open = ""
read_table_trigger = 0