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

snapshot...

parent ffd8d327
No related branches found
No related tags found
No related merge requests found
......@@ -4,9 +4,10 @@ import glob
import os
import numpy as np
import xarray as xr
from util.util import value_to_index, homedir
# from util.util import value_to_index, homedir
# gfs_directory = '/apollo/cloud/Ancil_Data/clavrx_ancil_data/dynamic/gfs/'
homedir = os.path.expanduser('~') + '/'
gfs_directory = homedir+'data/gfs/'
gfs_date_format = '%y%m%d'
......@@ -29,6 +30,13 @@ class MyGenericException(Exception):
self.message = message
# Return index of nda closest to value. nda must be 1d
def value_to_index(nda, value):
diff = np.abs(nda - value)
idx = np.argmin(diff)
return idx
def get_timestamp(filename):
toks = filename.split('.')
tstr = toks[1].split('_')[0]
......
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