def get_domain_subset_of_gefs(input_directory, cyyyymmddhh, cmem, clead): from read_gribdata import read_gribdata """ read in the global forecast. Subset to CONUS. """ nib = 886 # precomputed for set of lat-lons that surrounds nie = nib+318 # the NDFD CONUS 2.5-km Lambert conformal domain. njb = 131 nje = njb+153 # ---- read in forecast grid covering the whole globe. cycle = cyyyymmddhh[8:10] #infile = input_directory + cyyyymmddhh + \ # '_ge'+cmem+'.t'+cycle+'z.pgrb2s.0p25.f' + clead infile = input_directory + 'apcp_'+\ cyyyymmddhh+'_'+cmem+'_.f'+clead+'.grib2' print (' reading from ', infile) endStep = int(clead) istat, precip_realtime, lats_full, lons_full = \ read_gribdata(infile, endStep) # ---- subset for CONUS. precip_realtime = precip_realtime[njb:nje,nib:nie] lons_1D_realtime = lons_full[0,nib:nie]-360. lats_1D_realtime = lats_full[njb:nje,0] return precip_realtime, lons_1D_realtime, lats_1D_realtime