mirror of
https://forgemia.inra.fr/theophile.terraz/acoused.git
synced 2026-10-30 03:10:40 +01:00
The sediment calibration tab is added to the software AcouSed. It includes selection of frequency, fine and sand sediments, linear interpolation of the profile of fine sediments concentration, computation of parameter ks, sv, X, alphaS and zeta.
This commit is contained in:
1 parent
a25bc7392d
commit
fe52e097e7
4 files changed
+491
-154
No files matched your search
@@ -51,7 +51,7 @@ class AcousticInversionMethodHighConcentration():
|
||||
min_demodul = 1e-6
|
||||
max_demodul = 500e-6
|
||||
|
||||
sample_demodul = demodul_granulo(r_grain, frac_vol_cumul[num_sample, :], min_demodul, max_demodul)
|
||||
sample_demodul = demodul_granulo(r_grain, frac_vol_cumul[num_sample], min_demodul, max_demodul)
|
||||
|
||||
resampled_log_array = np.log(np.logspace(-10, -2, 3000))
|
||||
proba_vol_demodul = mix_gaussian_model(resampled_log_array,
|
||||
@@ -64,9 +64,9 @@ class AcousticInversionMethodHighConcentration():
|
||||
# sample_demodul.plot_interpolation()
|
||||
# sample_demodul.plot_modes(N_modes)
|
||||
|
||||
print(f"mu_list : {sample_demodul.demodul_data_list[3 - 1].mu_list}")
|
||||
print(f"sigma_list : {sample_demodul.demodul_data_list[3 - 1].sigma_list}")
|
||||
print(f"w_list : {sample_demodul.demodul_data_list[3 - 1].w_list}")
|
||||
# print(f"mu_list : {sample_demodul.demodul_data_list[3 - 1].mu_list}")
|
||||
# print(f"sigma_list : {sample_demodul.demodul_data_list[3 - 1].sigma_list}")
|
||||
# print(f"w_list : {sample_demodul.demodul_data_list[3 - 1].w_list}")
|
||||
|
||||
proba_vol_demodul = proba_vol_demodul / np.sum(proba_vol_demodul)
|
||||
ss = np.sum(proba_vol_demodul / np.exp(resampled_log_array) ** 3)
|
||||
@@ -75,7 +75,7 @@ class AcousticInversionMethodHighConcentration():
|
||||
return proba_num
|
||||
|
||||
# ------------- Computing ks ------------- #
|
||||
def form_factor_function_MoateThorne2012(self, a, freq, C=1500):
|
||||
def form_factor_function_MoateThorne2012(self, a, freq, C):
|
||||
"""This function computes the form factor based on the equation of
|
||||
Moate and Thorne (2012)"""
|
||||
# computing the wave number
|
||||
@@ -86,18 +86,19 @@ class AcousticInversionMethodHighConcentration():
|
||||
# print(f"form factor = {f}")
|
||||
return f
|
||||
|
||||
def ks(self, num_sample, freq, pdf):
|
||||
# def ks(self, num_sample_sand, radius_grain_sand, frac_vol_sand_cumul, freq, C):
|
||||
def ks(self, proba_num, freq, C):
|
||||
# --- Calcul de la fonction de form ---
|
||||
# form_factor = self.form_factor_function_MoateThorne2012(a, freq)
|
||||
# print(f"form_factor shape = {form_factor}")
|
||||
# print(f"form_factor = {form_factor}")
|
||||
|
||||
#--- Particle size distribution ---
|
||||
proba_num = (
|
||||
self.compute_particle_size_distribution_in_number_of_particles(
|
||||
num_sample=num_sample, r_grain=stg.radius_grain, frac_vol_cumul=stg.frac_vol_sand_cumul))
|
||||
# proba_num = (
|
||||
# self.compute_particle_size_distribution_in_number_of_particles(
|
||||
# num_sample=num_sample_sand, r_grain=radius_grain_sand, frac_vol_cumul=frac_vol_sand_cumul[num_sample_sand]))
|
||||
|
||||
print(f"proba_num : {proba_num}")
|
||||
# print(f"proba_num : {proba_num}")
|
||||
|
||||
# --- Compute k_s by dividing two integrals ---
|
||||
resampled_log_array = np.log(np.logspace(-10, -2, 3000))
|
||||
@@ -105,11 +106,12 @@ class AcousticInversionMethodHighConcentration():
|
||||
a3pdf = 0
|
||||
for i in range(len(resampled_log_array)):
|
||||
a = np.exp(resampled_log_array)[i]
|
||||
a2f2pdf += a**2 * self.form_factor_function_MoateThorne2012(a, freq)**2 * proba_num[i]
|
||||
a2f2pdf += a**2 * self.form_factor_function_MoateThorne2012(a, freq, C)**2 * proba_num[i]
|
||||
a3pdf += a**3 * proba_num[i]
|
||||
|
||||
print(f"a2f2pdf = {a2f2pdf}")
|
||||
print(f"a3pdf = {a3pdf}")
|
||||
# print("form factor ", self.form_factor_function_MoateThorne2012(a, freq, C))
|
||||
# print(f"a2f2pdf = {a2f2pdf}")
|
||||
# print(f"a3pdf = {a3pdf}")
|
||||
|
||||
ks = np.sqrt(a2f2pdf / a3pdf)
|
||||
|
||||
@@ -176,8 +178,8 @@ class AcousticInversionMethodHighConcentration():
|
||||
# print("BS min : ", np.nanmin(BS))
|
||||
# print("BS max : ", np.nanmax(BS))
|
||||
# print("r2D : ", r2D)
|
||||
print("kt shape : ", kt.shape)
|
||||
print("kt : ", kt)
|
||||
# print("kt shape : ", kt.shape)
|
||||
# print("kt : ", kt)
|
||||
# print("--------------------------------")
|
||||
# for k in range(1):
|
||||
# J_cross_section[k, :, :] = (3 / (16 * np.pi)) * ((BS[k, :, :]**2 * r2D[k, :, :]**2) / kt[k, :, :]**2)
|
||||
@@ -247,12 +249,13 @@ class AcousticInversionMethodHighConcentration():
|
||||
while np.isnan(res[i]):
|
||||
res[i] = M_profile[-1]
|
||||
i += -1
|
||||
|
||||
if stg.r_bottom.size != 0:
|
||||
res[np.where(range_cells > r_bottom)] = np.nan
|
||||
|
||||
# print(f"2. res.shape = {res.shape}")
|
||||
# print(f"res.shape = {res.shape}")
|
||||
# print(f"res = {res}")
|
||||
# print(f"r_bottom.shape = {r_bottom.shape}")
|
||||
# print(f" = {res}")
|
||||
|
||||
if r_bottom.shape != (0,):
|
||||
res[np.where(range_cells > r_bottom)] = np.nan
|
||||
|
||||
loc_point_lin_interp0 = range_cells[np.where((range_cells > sample_depth[0]) & (range_cells < sample_depth[-1]))]
|
||||
# print(f"range_cells : {range_cells}")
|
||||
@@ -276,9 +279,9 @@ class AcousticInversionMethodHighConcentration():
|
||||
def zeta(self, alpha_s, r, M_profile_fine):
|
||||
|
||||
delta_r = r[1] - r[0]
|
||||
zeta = alpha_s / (np.sum(M_profile_fine*delta_r))
|
||||
zeta = alpha_s / (np.sum(np.array(M_profile_fine)*delta_r))
|
||||
|
||||
print(f"np.sum(M_profile_fine*delta_r) : {np.sum(M_profile_fine*delta_r)}")
|
||||
# print(f"np.sum(M_profile_fine*delta_r) : {np.sum(M_profile_fine*delta_r)}")
|
||||
# zeta0 = np.array([0.021, 0.035, 0.057, 0.229])
|
||||
# zeta = zeta0[ind]
|
||||
# zeta0 = np.array([0.04341525, 0.04832906, 0.0847188, np.nan])
|
||||
|
||||
@@ -16,7 +16,7 @@ class GranuloLoader:
|
||||
self._y = self._data.iloc[:, 1].tolist() # distance from left bank (m)
|
||||
self._z = self._data.iloc[:, 2].tolist() # depth (m)
|
||||
|
||||
self._r_grain = 1e-6 * self._data.columns.values[5:] / 2
|
||||
self._r_grain = 1e-6 * np.array(self._data.columns.values)[5:].astype(float) / 2
|
||||
# self._r_grain = 1e-6 * np.array(self._data.columns.values)[5:].astype(float) / 2 # grain radius (m)
|
||||
|
||||
self._Ctot = self._data.iloc[:, 3].tolist() # Total concentration (g/L)
|
||||
|
||||
Reference in new issue
Block a user