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

snapshot...

parent 6912cf68
No related branches found
No related tags found
No related merge requests found
......@@ -4,6 +4,8 @@ import glob
import numpy as np
import re
from netCDF4 import Dataset
import pathlib
from pathlib import Path
from aeolus.geos_nav import GEOSNavigation
from util.util import GenericException
......@@ -47,6 +49,10 @@ def get_parameters_fmwk_amvs(filename='/ships19/cloud/scratch/4TH_AMV_INTERCOMPA
class Files:
def __init__(self, files_path, file_time_span, pattern):
if os.path.isdir(files_path):
self.flist = []
for path in Path(files_path).rglob(pattern):
self.flist.append(path)
self.flist = glob.glob(files_path + pattern)
if len(self.flist) == 0:
raise GenericException('no matching files found in: ' + files_path + pattern)
......@@ -124,6 +130,22 @@ class CLAVRx(Files):
return self.params
class CLAVRx_VIIRS(Files):
def __init__(self, files_path):
super().__init__(files_path, 10, 'clavrx*viirs*level2.h5')
self.params = get_parameters_clavrx()
def get_datetime(self, pathname):
filename = os.path.split(pathname)[1]
so = re.search('_s\\d{11}', filename)
dt_str = so.group()
dto = datetime.datetime.strptime(dt_str, '_s%Y%j%H%M').replace(tzinfo=timezone.utc)
return dto
def get_parameters(self):
return self.params
class RAOBfiles(Files):
def __init__(self, files_path, file_time_span=10):
super().__init__(files_path, file_time_span, 'raob_soundings*.cdf')
......
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