acoused/settings.py

259 lines
12 KiB
Python

""" this file includs global variables shared between tab """
import numpy as np
import pandas as pd
import datetime
# --- load raw data ---
# =========================================================
# --- ACOUSTIC DATA TAB ---
# =========================================================
# Variables names # Description # Type
ABS_name = [] # Acoustic Backscatter System name : ["Aquascat 1000R", "UB-SediFlow"] # List of strings
temperature = 0 # Temperature of measurements (One temperature for all measurements) # Float
water_velocity = 0 # Speed of sound in water (One speed of sound for all measurements) # Float
# --- Acoustic raw data ---
path_BS_raw_data = [] # Paths of the acoustic data files # List of strings
filename_BS_raw_data = [] # Files names of the acoustic data files # List of strings
BS_raw_data = [] # Acoustic raw data measurements : 3D arrays (freq x depth x time) # List of arrays
BS_raw_data_reshape = [] # Acoustic raw data measurements : 2D arrays (freq x (depth x time)) # List of arrays
depth = [] # Distance from transducer : 2D array (freq x depth) # List of arrays
depth_reshape = [] # Distance from transducer : 2D array (freq x (depth x time)) # List of arrays
depth_2D = [] # Distance from transducer : 2D array (freq x depth) # List of arrays
time = [] # Time of measurements : 2D array (freq x time) # List of arrays
time_reshape = [] # Time of measurements : 2D array (freq x (depth x time)) # List of arrays
# --- Measurement information ---
date = [] # Date of measurements # List of dates
hour = [] # Time of measurements # List of time
distance_from_ABS_to_free_surface = [] # Set distance from ABS to free surface # List of floats
freq = [] # Frequency of measurements : 1D array # List of arrays
freq_text = [] # Frequency of measurements : list of string # List of lists
kt_read = [] # Constant of calibration kt of the ABS read from acoustic file # List of list
# for each frequency
kt_corrected = [] # Constant of calibration kt of the ABS corrected # list of float
# Sometimes, the read values of kt are wrong. Then, we define
# default values for all frequency of the ABS.
water_attenuation = [] # Sound attenuation in water for each frequency and for one temperature # List of lists
nb_profiles = [] # Total number of profiles for each frequency = time length # List of lists
nb_profiles_per_sec = [] # Profile rate (Hz) for each frequency # List of lists
nb_cells = [] # Number of cells in profiles for each frequency # List of lists
cell_size = [] # Cell size for each frequency (m) # List of lists
pulse_length = [] # Pulse length (m) # List of lists
nb_pings_per_sec = [] # Number of pings per seconds (Hz) # List of lists
nb_pings_averaged_per_profile = [] # Profiles per average # List of lists
gain_rx = [] # Rx gain # List of lists
gain_tx = [] # Tx gain # List of lists
DataFrame_acoustic = pd.DataFrame()
# --- Modify raw data limits ---
tmin = [] # Minimum boundary of time for each recording : (index, value) # List of tuples
tmax = [] # Maximum boundary of time for each recording : (index, value) # List of tuples
rmin = [] # Minimum boundary of depth for each recording : (index, value) # List of tuples
rmax = [] # Maximum boundary of depth for each recording : (index, value) # List of tuples
BS_cross_section = [] # BS data limited with tmin and tmax values # List of arrays
depth_cross_section = [] # depth limited with rmin and rmax values # List of arrays
time_cross_section = [] # time limited with rmin and rmax values # List of arrays
# --- Detect bottom ---
BS_stream_bed = [] # BS data (raw or cross_section) with detected bottom : # List of arrays
# 3D array : (freq x depth x time)
depth_bottom = [] # Depth value of th bottom : 1D array # List of arrays
val_bottom = [] # Level of the BS signal on the bottom : 1D array # List of arrays
ind_bottom = [] # Index of bottom in depth array : list of int # List of lists
freq_bottom_detection = [] # Frequency use to detect the bottom : (index, string) # List of tuple
dept_bottom_detection_min = [] # Min value to detect bottom on the first vertical # List of float
depth_bottom_detection_max = [] # Max value to detect bottom on the first vertical # List of float
depth_bottom_detection_1st_int_area = [] # interval for searching area # List of float
# ----------------------------------------------------------------------------------------------------------------------
# =========================================================
# --- SIGNAL PREPROCESSING TAB ---
# =========================================================
# Variables names # Description # Type
path_BS_noise_data = []
filename_BS_noise_data = []
BS_noise_raw_data = [] # BS noise raw data : BS signal listen
BS_noise_averaged_data = [] # BS noise raw data averaged (array has the same shape than BS_raw_data shape)
BS_mean = []
date_noise = []
hour_noise = []
noise_method = []
noise_value = []
SNR_filter_value = []
Nb_cells_to_average_BS_signal = []
data_preprocessed = []
time_snr_reshape = np.array([])
SNR_reshape = np.array([]) # snr is reshape to be included in table of values in acoustic data tab
SNR_raw_data = [] # SNR is computed with BS_noise_averaged_data
time_noise = []
depth_noise = []
tmin_snr = np.array([])
tmax_snr = np.array([])
# BS_noise_cross_section = [] # BS_noise_cross_section = BS_noise_data[:, :, tmin:tmax] (former Noise_data)
SNR_cross_section = [] # SNR_data = snr[:, :, tmin:tmax]
SNR_stream_bed = []
time_snr = []
time_average = np.array([])
SNR_data_average = np.array([]) # SNR data computed with BS signal averaged (not with BS raw signal)
# --- Processed data in Signal Processing Tab ---
BS_raw_data_pre_process_SNR = []
BS_raw_data_pre_process_average = []
BS_raw_data_pre_process_SNR_average = []
BS_cross_section_pre_process_SNR = [] # BS data filtered with SNR values (remove point if SNR < value) - bottom is not detected
BS_cross_section_pre_process_average = [] # BS data averaged - bottom is not detected
BS_cross_section_pre_process_SNR_average = [] # BS data averaged and filtered with SNR - bottom is not detected
BS_stream_bed_pre_process_SNR = [] # BS data filtered with SNR values (remove point if SNR < value) - bottom is detected
BS_stream_bed_pre_process_average = [] # BS data averaged - bottom is detected
BS_stream_bed_pre_process_SNR_average = [] # BS data averaged and filtered with SNR - bottom is detected
# ----------------------------------------------------------------------------------------------------------------------
# =========================================================
# --- SAMPLE DATA TAB ---
# =========================================================
# Variables names # Description # Type
# --- Fine sediment Data ---
# --- Sand sediment Data ---
sample_fine = []
path_fine = ""
filename_fine = ""
columns_fine = []
distance_from_bank_fine = [] # distance from left bank (m)
depth_fine = [] # depth (m)
time_fine = []
radius_grain_fine = [] # grain radius (um)
Ctot_fine = [] # Total concentration (g/L)
D50_fine = [] # median diameter (um)
frac_vol_fine = []
# Volume fraction (%)
frac_vol_fine_cumul = [] # Cumulated volume fraction (%)
fine_sample_profile = [] # Fine sample choose for the profile in calibration
sample_sand = []
path_sand = ""
filename_sand = ""
columns_sand = []
distance_from_bank_sand = [] # distance from left bank (m)
depth_sand = [] # depth (m)
time_sand = []
radius_grain_sand = []
Ctot_sand = [] # Total concentration (g/L)
D50_sand = [] # median diameter (um)
frac_vol_sand = [] # Volume fraction (%)
frac_vol_sand_cumul = [] # Cumulated volume fraction (%)
sand_sample_target = [] # Sand sample target for calibration
sand_sample_target_indice = []
Ctot_fine_per_cent = []
Ctot_sand_per_cent = []
fine_sample_position = []
sand_sample_position = []
# ----------------------------------------------------------------------------------------------------------------------
# =========================================================
# --- SEDIMENT CALIBRATION TAB ---
# =========================================================
# Variables names # Description # Type
sediment_attenuation = []
FCB = []
depth_real = []
lin_reg = []
# --- Sediment Calibration
frequencies_for_calibration = []
range_lin_interp = []
M_profile_fine = []
path_calibration_save_file = ""
path_calibration_import_file = ""
filename_calibration_import_file = ""
ks = []
sv = []
X_exponent = []
alpha_s = []
zeta = []
J_cross_section = []
frequency_for_inversion = tuple()
# ----------------------------------------------------------------------------------------------------------------------
# =========================================================
# --- ACOUSTIC INVERSION TAB ---
# =========================================================
# Variables names # Description # Type
frequencies_to_compute_VBI = np.array([])
VBI_cross_section = []
# VBI_stream_bed = np.array([[[]]])
SSC_fine = []
SSC_sand = []
# --- Save study ---
acoustic_data = []
dirname_save_as = ""
filename_save_as = ""
dirname_open = ""
filename_open = ""
read_table_trigger = 0