Aggregate fields temporally (manually)ΒΆ
[1]:
# for figures in notebook
%matplotlib inline
# import & initialize epygram
import epygram
epygram.init_env()
# path to file
import os
INPUTS_DIR = os.path.join('..', 'inputs')
[2]:
r1 = epygram.formats.resource(os.path.join(INPUTS_DIR, 'grid.arome-forecast.guyane0025+0000:00.grib'), 'r')
r2 = epygram.formats.resource(os.path.join(INPUTS_DIR, 'grid.arome-forecast.guyane0025+0012:00.grib'), 'r')
r3 = epygram.formats.resource(os.path.join(INPUTS_DIR, 'grid.arome-forecast.guyane0025+0024:00.grib'), 'r')
[3]:
f1 = r1.readfield('shortName:2r')
f2 = r2.readfield('shortName:2r')
f3 = r3.readfield('shortName:2r')
[4]:
f1.extend(f2)
f1.extend(f3)
[5]:
print(f1.validity)
print(f1.getdata(d4=True).shape)
<List of FieldValidity which date/time are:
2020-11-02 00:00:00
2020-11-02 12:00:00
2020-11-03 00:00:00
>
(3, 1, 317, 419)
[ ]: