...
Set up the environment
EFAS
Retrieve data
These exercises require EFAS model output parameters and auxiliary data. You can retrieve them using the CDS API, as described in the code block below:
...
Code Block |
---|
language | py |
---|
title | Retrieve EFAS auxiliary data |
---|
collapse | true |
---|
|
|
Plot map discharge
In order to plot a map, we are going to use
Code Block |
---|
language | py |
---|
title | Discharge map |
---|
collapse | true |
---|
|
import matplotlib.pyplot as plt
import cartopy.crs as ccrs
import cartopy.feature as cf
import numpy as np
import pandas as pd
import xarray as xr
ds = xr.open_dataset('../data/clim_19910300.nc')
cmap = plt.cm.get_cmap('jet').copy()
cmap.set_under('white')
crs = ccrs.LambertAzimuthalEqualArea(central_longitude=10,central_latitude=52,false_easting=4321000,false_northing=3210000)
# Plot map discharge > 20 m/s
fig, ax = plt.subplots(1,1,subplot_kw={'projection': crs}, figsize=(20,20) )
ax.gridlines(crs=crs, linestyle="-")
ax.coastlines()
ax.add_feature(cf.BORDERS)
sc = ds["dis06"].plot(ax=ax,cmap=cmap,vmin=20,add_colorbar=False)
cbar = plt.colorbar(sc, shrink=.5,)
cbar.set_label(ds.dis06.GRIB_name) |
...