Extract a V1D+T profile from a 4D fieldΒΆ

[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]:
paths = [os.path.join(INPUTS_DIR, 'grid.arome-forecast.guyane0025+00{:02}:00.grib'.format(i))
         for i in (0, 12, 24)]
r = epygram.resources.meta_resource(paths, 'r', 'CL+MV')
[3]:
f = r.readfield({'shortName':'t', 'typeOfFirstFixedSurface':100})  # temperature on pressure levels
[4]:
print(f.getdata(d4=True).shape)
(3, 19, 317, 419)
[5]:
p = f.extractprofile(-55,5)
[6]:
print(type(p))
print(p.getdata(d4=True).shape)
<class 'epygram.fields.V1DField.V1DField'>
(3, 19, 1, 1)
[ ]: