Commit cddd008e authored by Alexandre Paris's avatar Alexandre Paris
Browse files

maj

parent 46e71575
AUTHORS
Alexandre Paris (LEGI UMR 5519 - Grenoble - France)
alexandre.paris (A) univ-grenoble-alpes.fr
alexandre.antoine.paris (A) gmail.com
Cyrille Bonamy (LEGI UMR 5519 - Grenoble - France)
cyrille.bonamy (A) univ-grenoble-alpes.fr
Eric Barthélemy (LEGI UMR 5519 - Grenoble - France)
eric.barthelemy (A) univ-grenoble-alpes.fr
Julien Chauchat (LEGI UMR 5519 - Grenoble - France)
julien.chauchat (A) univ-grenoble-alpes.fr
This diff is collapsed.
This diff is collapsed.
......@@ -77,8 +77,8 @@ NU = 0.000001 # kinetic viscosity of water
D50 = 0.0003 # d50 diameter of sediments
# Reading .dat files with forcing and shoreline data
Shoreline = np.loadtxt('../examples/Shoreline_1.5.dat')
Forcing = np.loadtxt('../examples/TrucVert_Forcing.dat')
Shoreline = np.loadtxt('../examples/TrucVert_Shoreline_+1.5m_2021_decimee_x2.txt')
Forcing = np.loadtxt('../examples/waves_trucvert.txt')
###############################################################################
# SHORELINE
......@@ -179,7 +179,8 @@ ax1.plot(x1, y1, linestyle='solid', color='black') # plot omega_F(time_F)
ax1.set(xlabel='Years', ylabel='Dean parameter',
yticks=range(int(np.min(y1)), int(np.max(y1)+1)))
ax1.plot(x1, y2, linestyle='dashed', color='r',
label='equilibrium Dean number') # plot omega_eqlbrm(time_F)
label='equilibrium Dean number',
linewidth=4) # plot omega_eqlbrm(time_F)
ax1.legend()
###############################################################################
......@@ -243,18 +244,19 @@ x2 = dates.date2num(time_Sy)
x3 = dates.date2num(time_Fy)
y3 = XS # data
y4 = Sreconst # shoreline_calib #computed shoreline
ax2.scatter(x2, y3, color='red', label='data') # plot XS(time_Sy) in red dots
ax2.scatter(x2, y3, color='black', label='data') # plot XS(time_Sy) in red dots
ax2.set(xlabel='Years', ylabel='Shoreline position (m)',
yticks=range(int(np.min(y3)), int(np.max(y3))+1, 10))
ax2.xaxis.set_major_formatter(formatter)
ax2.xaxis.set_major_locator(locator)
# plot shoreline_calib(time_Fy)
ax2.plot(x3, y4, linestyle='solid', color='black')
ax2.plot(x3, y4, linestyle='solid', color='red')
ax2.legend()
##############################################################################
# CALCULATION ON NEW DATA
t0 = time_S[0]
#t0 = time_F[100000]
tf = time_F[-1]
ii0 = np.min(np.where((time_F <= (t0+dt)) & (time_F >= (t0-dt))))
iif = np.max(np.where((time_F <= (tf+dt)) & (time_F >= (tf-dt))))
......@@ -262,6 +264,7 @@ vec_ind = np.arange(ii0, iif+1)
time_Fy = [_from_ordinal((float(time_F[vec_ind][i]))).strftime('%Y-%m-%d') for i in range(len(time_F[vec_ind]))]
shoreline_future = np.zeros(len(time_Fy)+1)
shoreline_future[0] = XS[0]
#shoreline_future[0] = 85
for i in range(len(time_Fy)):
ki = ii0 + i
IF = ((erosion_ratio*FF_mi[ki-1] + FF_pl[ki-1])
......@@ -271,10 +274,18 @@ for i in range(len(time_Fy)):
shoreline_future = shoreline_future[1::]
ax3.plot(dates.date2num(time_Fy), shoreline_future, color='black')
ax3.scatter(x2, y3, color='red', label='data')
ax3.plot(dates.date2num(time_Fy), shoreline_future, color='blue')
#ax3.scatter(x2, y3, color='red', label='data')
ax3.set(xlabel='Years', ylabel='Shoreline position (m)',
yticks=range(int(np.min(y3)), int(np.max(y3))+1, 10))
yticks=range(int(np.min(shoreline_future)), int(np.max(shoreline_future))+1, 10))
shoreline_time = np.loadtxt('../examples/TrucVert_Shoreline+1.5m_2021.txt', dtype=str, usecols=(0))
time_shoreline = [datetime.datetime.fromordinal(datetime.datetime.strptime(shoreline_time[i], '%Y-%m-%d').toordinal()).strftime('%Y-%m-%d')
for i in range(len(shoreline_time))]
shoreline_bis = np.loadtxt('../examples/TrucVert_Shoreline+1.5m_2021.txt', usecols=(1,2))
ax3.xaxis.set_major_formatter(formatter)
ax3.xaxis.set_major_locator(locator)
ax3.scatter(dates.date2num(time_shoreline), shoreline_bis[:, 0], color='black')
plt.show()
......@@ -153,8 +153,8 @@ omega_F[np.isnan(omega_F)] = 0
colors = iter(cm.rainbow(np.linspace(0, 1, 10)))
# Memory decay in days
phi_all = np.arange(4500, 5500, 100)
for i in range(4500, 5500, 100):
phi_all = np.arange(3000, 5000, 200)
for i in range(3000, 5000, 200):
phi = i
N_D = 8 # 1/dt_forçage (number of values per day)
phi_h = phi*N_D
......
......@@ -85,7 +85,7 @@ D50 = 0.0003 # d50 diameter of sediments
# Reading .dat files with forcing and shoreline data
Shoreline = np.loadtxt('examples/TrucVert_Shoreline_+1.5m_2021_converted.txt')
Shoreline = np.loadtxt('examples/TrucVert_Shoreline_+1.5m_2021_cut.txt')
Forcing = np.loadtxt('examples/waves_trucvert.txt')
###############################################################################
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment