Commit 8fd50811 authored by WIENER Valentin's avatar WIENER Valentin
Browse files

Delete grilleval.py

parent a1a32740
import cartopy.crs as ccrs
import matplotlib.pyplot as plt
import cartopy
import netCDF4 as nc
from mpl_toolkits.axes_grid1 import make_axes_locatable
import numpy as np
import matplotlib.ticker as mticker
import matplotlib.path as mpath
# https://scitools.org.uk/cartopy/docs/v0.15/examples/always_circular_stereo.html
# now the plot (Axes) projection
myproj = ccrs.SouthPolarStereo(central_longitude=0.)
f=plt.figure(figsize=(13,11), dpi=100)
ax = plt.axes(projection=myproj)
ax.coastlines(resolution='10m',zorder=4, color='black')
ax.set_extent([-180,180,-90,-60], ccrs.PlateCarree())
# plot DDU (in Geodetic units)
ax.plot(140.00, -66.67, marker='x', markersize=7, color='red', transform=ccrs.Geodetic())
ax.plot(139.72, -66.72, marker='x', markersize=7, color='red', transform=ccrs.Geodetic())
ax.plot(138.72, -67.38, marker='x', markersize=7, color='red', transform=ccrs.Geodetic())
ax.plot(134.25, -70.7, marker='x', markersize=7, color='red', transform=ccrs.Geodetic())
ax.plot(123.33, -75.1, marker='x', markersize=7, color='red', transform=ccrs.Geodetic())
data = nc.Dataset('./INIT/grilles_gcm.nc')
lat = data['latu'][:]
lon = data['lonv'][:]
aire = data['aire'][:]
resol=np.sqrt(aire)/1000.
f.canvas.draw()
fill=ax.pcolor(lon,lat,resol,vmin=20,vmax=200,alpha=0.6,edgecolor='k',linewidth=1, shading='auto', cmap='jet', transform=ccrs.PlateCarree(central_longitude=0))
ax.set_title('Nudged-Zoomed LMDZ Simulation Grid Valentin',fontsize=16)
#ax.set_boundary(circle, transform=ax.transAxes)
gl = ax.gridlines(draw_labels=True, linewidth=1, linestyle='-', alpha=0.8)
gl.ylabel_style = {'size':14}
gl.xlabel_style = {'size':14}
divider = make_axes_locatable(ax)
#ax_cb = divider.new_vertical(size="5%", pad=0.5, axes_class=plt.Axes)
#f.add_axes(ax_cb,'bottom')
#cb = plt.colorbar(fill, cax=ax_cb,orientation="horizontal")
cax = divider.append_axes("bottom", size="5%", pad="8%", axes_class=plt.Axes)
cb = f.colorbar(fill, cax=cax, orientation="horizontal",extend="both")
cb.set_label(r"$\sqrt{Aire}$ (km)",fontsize=14)
plt.savefig("verif_grid_southpole.png")
"""
f2 = plt.figure(figsize=(14,11))
myproj2 = ccrs.PlateCarree()
ax = plt.axes(projection=myproj2)
ax.coastlines()
gl = ax.gridlines(crs=myproj2, draw_labels=True, linewidth=1, color = "black")
gl.xlocator = mticker.FixedLocator(lon)
gl.ylocator = mticker.FixedLocator(lat)
fill = ax.pcolor(lon, lat, resol, shading='auto')
plt.savefig("verif_grid_platecarree.png")
"""
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