Commit 091b9120 authored by Benoit Urruty's avatar Benoit Urruty

covid 2

parent aa317631
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
{
"cells": [],
"metadata": {},
"nbformat": 4,
"nbformat_minor": 4
}
# URRUTY, Benoit, IGE, Université de Grenoble
# Janvier,2020
import xarray as xr
import numpy as np
import matplotlib.pyplot as plt
from scipy import signal
from scipy.interpolate import griddata
from matplotlib.colors import SymLogNorm
from matplotlib import cm
import geopandas as gpd
import seaborn as sns
from matplotlib.colors import LogNorm
from scipy import ndimage
from mpl_toolkits.axes_grid1 import make_axes_locatable
import glob
import pyvista as pv
import pandas as pd
import matplotlib.pylab as pl
size=15
params = {'legend.fontsize': 'large',
'figure.figsize': (20,8),
'axes.labelsize': size,
'axes.titlesize': size,
'xtick.labelsize': size*0.75,
'ytick.labelsize': size*0.75,
'axes.titlepad': 25}
plt.rcParams.update(params)
flowlines=np.sort(glob.glob('/home/urrutyb/Documents/PhD_TiPACCS/topo_antarctica/flow_line*.csv'))
#url='/home/urrutyb/Documents/simu/bedmap_bedmachine/'
url='./'
figure='./figure/'
files = glob.glob(url + 'run1_*.pvtu')
figure=url + 'figure/'
files = sorted(files)
blocks = pv.MultiBlock([pv.read(f) for f in files])
x=blocks[0].points[:,0]
y=blocks[0].points[:,1]
meth='cubic'
for n in range(0,len(flowlines)):
x_fl,y_fl=np.loadtxt(flowlines[n],skiprows=1,delimiter=',',usecols=(22,23),unpack=True)
groundedmask=np.zeros([len(blocks),len(x_fl)])
bedrock=np.zeros([len(blocks),len(x_fl)])
zs=np.zeros([len(blocks),len(x_fl)])
zb=np.zeros([len(blocks),len(x_fl)])
alpha=np.zeros([len(blocks),len(x_fl)])
mu=np.zeros([len(blocks),len(x_fl)])
pdc_melt=np.zeros([len(blocks),len(x_fl)])
h=np.zeros([len(blocks),len(x_fl)])
h_residual=np.zeros([len(blocks),len(x_fl)])
dhdt=np.zeros([len(blocks),len(x_fl)])
smb=np.zeros([len(blocks),len(x_fl)])
pdc_area=np.zeros([len(blocks),len(x_fl)])
ssavelocity_mag=np.zeros([len(blocks),len(x_fl)])
dist=np.zeros(len(x_fl))
for i in range(0,len(x_fl)-1):
dist[i+1]=dist[i]+np.sqrt((x_fl[i]-x_fl[i+1])**2+(y_fl[i]-y_fl[i+1])**2)/1000
for i in range(0,len(blocks)):
groundedmask[i,]=griddata((x,y),blocks[i].point_arrays['groundedmask'],(x_fl,y_fl), method=meth)
bedrock[i,]=griddata((x,y),blocks[i].point_arrays['bedrock'],(x_fl,y_fl), method=meth)
zs[i,]=griddata((x,y),blocks[i].point_arrays['zs'],(x_fl,y_fl), method=meth)
zb[i,]=griddata((x,y),blocks[i].point_arrays['zb'],(x_fl,y_fl), method=meth)
alpha[i,]=griddata((x,y),blocks[i].point_arrays['alpha'],(x_fl,y_fl), method=meth)
mu[i,]=griddata((x,y),blocks[i].point_arrays['mu'],(x_fl,y_fl), method=meth)
pdc_melt[i,]=griddata((x,y),blocks[i].point_arrays['pdc_melt'],(x_fl,y_fl), method=meth)
h[i,]=griddata((x,y),blocks[i].point_arrays['h'],(x_fl,y_fl), method=meth)
h_residual[i,]=griddata((x,y),blocks[i].point_arrays['h residual'],(x_fl,y_fl), method=meth)
dhdt[i,]=griddata((x,y),blocks[i].point_arrays['dhdt'],(x_fl,y_fl), method=meth)
smb[i,]=griddata((x,y),blocks[i].point_arrays['smb'],(x_fl,y_fl), method=meth)
pdc_area[i,]=griddata((x,y),blocks[i].point_arrays['pdc_area'],(x_fl,y_fl), method=meth)
ssavelocity=blocks[i].point_arrays['ssavelocity']
ssavelocity_mag[i,:]=griddata((x,y),np.sqrt(ssavelocity[:,0]**2+ssavelocity[:,1]**2),(x_fl,y_fl), method=meth)
d={'groundedmask': groundedmask,'bedrock':bedrock,'zs':zs,'zb':zb,'alpha':alpha,'mu':mu,'pdc_melt':pdc_melt,'h':h,'h_residual':h_residual,'dhdt':dhdt,'smb':smb,'pdc_area':pdc_area,'ssavelocity_mag':ssavelocity_mag,'dist':dist}
xx=flowlines[n][52:-4]
globals()[xx]=d
print(xx)
colors = plt.cm.bwr(np.linspace(0,1,len(blocks)))
import matplotlib as mpl
for n in range(0,len(flowlines)):
xx=flowlines[n][52:-4]
fig=plt.figure(figsize=[20,20])
ax1=plt.subplot(3,1,1)
ax2=plt.subplot(3,1,2)
ax3=plt.subplot(3,1,3)
ax4 = ax3.twinx()
for n in range(0,len(blocks)):
ax1.semilogy(globals()[xx]['dist'],globals()[xx]['ssavelocity_mag'][n,],color=colors[n])
ax1.set_ylabel('SSA velocity (m/an)')
ax2.semilogy(globals()[xx]['dist'],abs(globals()[xx]['dhdt'][n,]),color=colors[n])
ax2.set_ylabel('dh/dt (m)')
ax4.plot(globals()[xx]['dist'],abs(globals()[xx]['groundedmask'][n,])<0.1,color=colors[n])
im=ax3.plot(globals()[xx]['dist'],globals()[xx]['zs'][n,],color=colors[n])
ax3.plot(globals()[xx]['dist'],globals()[xx]['bedrock'][n,],color=colors[n])
ax3.plot(globals()[xx]['dist'],globals()[xx]['zb'][n,],color=colors[n],label=str(n))
ax3.set_xlabel('Distance (km)')
ax3.set_ylabel('Altitude (m)')
# ax3.legend()
ax5=fig.add_subplot(position=[0.4, 0.05, 0.2, 0.02])
cmap = mpl.cm.bwr
norm = mpl.colors.Normalize(vmin=0, vmax=len(blocks)-1)
cb1 = mpl.colorbar.ColorbarBase(ax5, cmap=cmap,
norm=norm,
orientation='horizontal')
cb1.set_label('Years')
fig.suptitle(str(xx))
plt.savefig(figure + str(xx)+'.png')
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -2494,3 +2494,68 @@ groups
Entered on [2020-03-06 ven. 09:11]
[[file:~/Documents/PhD_TiPACCS/TiPACCS_git/journal/journal.org::*mise%20en%20veille][mise en veille]]
*** 2020-03-11 mercredi
**** réunion PhD
***** Roughness (donnée ajoutées)
diffusion entre les lignes radar pour combler les trous
séparer le flottant/grounded
zb > bed
zone en dehors de l'incertitude
regarder region ou la conservation de la masse a été appliqué
différence plus marqué?
voir les lieux de difference sur les simu
rugo/pente/altitude
***** Comparaison bed
gain extension shelf FAIT
maillage des simus correspoond extension bedmap. Données de bedmachine
en retrait
***** comparaison simulation
epaisseur et altitude de surface
définir les zones de hautes différences
selectionné edge pour voir les GL modélisé
et déplacement
état initiale
***** first figure
reprendre papier -1 ne pas prendre en compte
par rapport a l'initiale / rajouter GL
faire une representation en mask avec paraview
par rapport a itinial
***** extension des shelfs
***** Abstract IGS
on s'en fou te Tipaccs et tipping point
importance etat initial
objectif que ce que je veux presenter sensibilité au bed rock /
derivation / reaction au pertubation
changer le titre (sensitivity of inital.... to bedrock topo)
***** Karthaus
***** Gricad
***** Stockage simulation
***** delivrable
rapport sur l'état initale
capaciter des différents modèles par rapport au papier de helene
pour tout les données d'entrees des modeles liens vers les references/
données d'entrées
taggé quel modele utilise quel jeux de données (données modifier
bedmachine/bedmap)
Entered on [2020-03-11 mer. 10:23]
[[file:~/Documents/PhD_TiPACCS/TiPACCS_git/journal/journal.org]]
Markdown is supported
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