diff --git a/modules/icing/pireps.py b/modules/icing/pireps.py index 07c77f71bc80518f16e0b327df08fd1261ad4419..3a17d79f57c7704be72ce6e6f25a161a1bc93f0b 100644 --- a/modules/icing/pireps.py +++ b/modules/icing/pireps.py @@ -1,6 +1,8 @@ import datetime from datetime import timezone import re +from pathlib import Path +import h5py NO_ICE = '\s*NEG\s*|\s*NONE\s*|\s*NEGATIVE\s*|\s*NO\s*' ICE_LVL = '\d+-\d+|FL\d+-FL\d+' @@ -155,3 +157,15 @@ def pirep_icing(filename, lon_range=[-180, 180], lat_range=[-63, 63]): rpts.append(tup) return ice_dict, no_ice_dict, neg_ice_dict + + +def pirep_icing_from_boeing(dirname='/ships19/cloud/scratch/ICING/BOEING/icing/2020/', lon_range=[-180, 180], lat_range=[-63, 63]): + flist = [] + for path in Path(dirname).rglob('*.nc'): + flist.append(path) + + cnt = 0 + for fname in flist: + h5f = h5py.File(fname, 'r') + ice_bool = h5f['ice_bool'][:] + cnt += ice_bool.shape[0] \ No newline at end of file