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

snapshot...

parent ffcd06fe
No related branches found
No related tags found
No related merge requests found
......@@ -83,11 +83,8 @@ class Files:
self.ftimes = []
self.dto_s = []
if os.path.isdir(files_path):
for path in glob.glob(files_path + pattern, recursive=True):
self.flist.append(path)
elif fnmatch.fnmatch(os.path.basename(files_path), pattern): # check if this single file matches pattern
self.flist.append(files_path)
for path in glob.glob(files_path + pattern, recursive=True):
self.flist.append(path)
if len(self.flist) == 0:
raise GenericException('no matching files found in: ' + files_path + ' matching: ' + pattern)
......@@ -291,6 +288,17 @@ class GFSfiles(Files):
return dto
class CrIS_Retrieval(Files):
def __init__(self, files_path, file_time_span=8, pattern='CrIS_*atm_prof_rtv.h5'):
super().__init__(files_path, file_time_span, pattern)
def get_datetime(self, pathname):
filename = os.path.split(pathname)[1]
dt_str = re.search('_d.{14}', filename).group(0)
dto = datetime.datetime.strptime(dt_str, '_d%Y%m%d_t%H%M').replace(tzinfo=timezone.utc)
return dto
class AMVFiles:
def __init__(self, files_path, file_time_span, pattern, band='14', elem_name=None, line_name=None, lat_name=None,
......
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