from ECMWF_N import ECMWF from datetime import datetime, timedelta import flammkuchen as fl maindir = '/data/legras/flexpart_in/STC/ERA5/SAFNWC/TPP/HR' date = datetime(2017, 8, 1, 0) while date < datetime(2017, 9, 1, 0): print('processing ', date) outfile = date.strftime('TPP%y%m%d%H.hdf5') fullname = os.path.join(maindir, date.strftime('%Y/%m'), outfile) fdd = ECMWF('STC', date) fdd._get_T() fdd._mkp() fdd._CPT() fdd._WMO() fdd.close() tpp = {} tpp['Twmo'] = fdd.d2d['Twmo'] tpp['pwmo'] = fdd.d2d['pwmo'] tpp['Tcold'] = fdd.d2d['Tcold'] tpp['pcold'] = fdd.d2d['pcold'] tpp['nlon'] = fdd.nlon tpp['nlat'] = fdd.nlat tpp['lats'] = fdd.attr['lats'] tpp['lons'] = fdd.attr['lons'] tpp['date'] = fdd.date fl.save(fullname, tpp, compression='zlib') date += timedelta(hours=1)
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Fri Oct 26 22:45:57 2018 @author: Bernard Legras """ from ECMWF_N import ECMWF from datetime import datetime date = datetime(2017, 8, 11, 12) dat = ECMWF('FULL-EA', date) dat._get_T() dat._mkp() dat._mkz() #dat._CPT() #dat.show('zcold') dat._WMO() dat.show('zwmo')