Skip to content
Snippets Groups Projects
Commit 221c1fdc authored by tomrink's avatar tomrink
Browse files

snapshot...

parent 2cc9d969
Branches
No related tags found
No related merge requests found
......@@ -23,6 +23,7 @@ dt_str_pat = '_s\d{11}'
dir_fmt = '%Y_%m_%d_%j'
gfs_directory = '/apollo/cloud/Ancil_Data/clavrx_ancil_data/dynamic/gfs/'
gfs_name_pattern = r'gfs\.(\d{8})_F\d{3}\.h5'
gfs_date_format = '%y%m%d'
h4_to_h5_path = home_dir + '/h4toh5convert'
......@@ -532,10 +533,9 @@ def get_bounding_gfs_files(timestamp):
filelist = flist_0 + flist_1
ftimes = []
for pname in filelist: # TODO: make better with regular expressions (someday)
fname = os.path.split(pname)[1]
toks = fname.split('.')
tstr = toks[1].split('_')[0]
for pname in filelist:
match = re.search(gfs_name_pattern, pname)
tstr = match[1]
dto = datetime.datetime.strptime(tstr, gfs_date_format+'%H').replace(tzinfo=timezone.utc)
dto = dto + datetime.timedelta(hours=12)
ftimes.append(dto.timestamp())
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment