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

snapshot...

parent 6912cf68
Branches
No related tags found
No related merge requests found
...@@ -4,6 +4,8 @@ import glob ...@@ -4,6 +4,8 @@ import glob
import numpy as np import numpy as np
import re import re
from netCDF4 import Dataset from netCDF4 import Dataset
import pathlib
from pathlib import Path
from aeolus.geos_nav import GEOSNavigation from aeolus.geos_nav import GEOSNavigation
from util.util import GenericException from util.util import GenericException
...@@ -47,6 +49,10 @@ def get_parameters_fmwk_amvs(filename='/ships19/cloud/scratch/4TH_AMV_INTERCOMPA ...@@ -47,6 +49,10 @@ def get_parameters_fmwk_amvs(filename='/ships19/cloud/scratch/4TH_AMV_INTERCOMPA
class Files: class Files:
def __init__(self, files_path, file_time_span, pattern): 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) self.flist = glob.glob(files_path + pattern)
if len(self.flist) == 0: if len(self.flist) == 0:
raise GenericException('no matching files found in: ' + files_path + pattern) raise GenericException('no matching files found in: ' + files_path + pattern)
...@@ -124,6 +130,22 @@ class CLAVRx(Files): ...@@ -124,6 +130,22 @@ class CLAVRx(Files):
return self.params 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): class RAOBfiles(Files):
def __init__(self, files_path, file_time_span=10): def __init__(self, files_path, file_time_span=10):
super().__init__(files_path, file_time_span, 'raob_soundings*.cdf') 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.
Please register or to comment