Plot a section¶
[1]:
%matplotlib inline
# for figures in notebook
# import & initialize epygram
import epygram
epygram.init_env()
# path to file
import os
INPUTS_DIR = os.path.join('..', 'inputs')
[2]:
r = epygram.resources.meta_resource(os.path.join(INPUTS_DIR, 'ICMSHAROM+0022'),
'r', 'CL')
[3]:
# CL implies GRIB2 nomenclature of fields
f = r.readfield({'discipline':0, 'parameterCategory':0, 'parameterNumber':0, # temperature
'typeOfFirstFixedSurface':119}) # on model levels
f.sp2gp()
[4]:
s = f.extractsection((8,45), (8,46), interpolation='linear')
[5]:
fig, ax = s.plotfield(title='Temperature on meridian 8°E', x_is='lat')
[ ]: