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

snapshot...

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