From 10091eba6ae49ac3fd2d5f63426d5771fb8f8c75 Mon Sep 17 00:00:00 2001 From: tomrink <rink@ssec.wisc.edu> Date: Tue, 5 Jan 2021 13:32:49 -0600 Subject: [PATCH] snapshot... --- modules/aeolus/datasource.py | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/modules/aeolus/datasource.py b/modules/aeolus/datasource.py index 5145f5bb..46d8e294 100644 --- a/modules/aeolus/datasource.py +++ b/modules/aeolus/datasource.py @@ -134,6 +134,34 @@ class FrameworkCloudHeight(AMVFiles): return dto +class FrameworkCloudPhase(AMVFiles): + def __init__(self, files_path, file_time_span): + elem_name = 'Element' + line_name = 'Line' + lon_name = 'Longitude' + lat_name = 'Latitude' + + out_params = ['CloudPhase', 'CloudType'] + params = ['CloudPhase', 'CloudType'] + meta_dict = {'CloudPhase': (None, 'i1'), 'CloudType': (None, 'i1')} + + super().__init__(files_path, file_time_span, '*_CLOUD_PHASE_EN'+'*.nc', band=None, elem_name=elem_name, params=params, + line_name=line_name, lat_name=lat_name, lon_name=lon_name, out_params=out_params, meta_dict=meta_dict) + + def get_navigation(self): + return GEOSNavigation(sub_lon=-75.0) + + def get_datetime(self, pathname): + fname = os.path.split(pathname)[1] + toks = fname.split('_') + dstr = toks[4] + tstr = toks[5] + dtstr = dstr + tstr + dto = datetime.datetime.strptime(dtstr, '%Y%j%H%M').replace(tzinfo=timezone.utc) + + return dto + + class OPS(AMVFiles): def __init__(self, files_path, file_time_span, band='14'): elem_name = None @@ -207,5 +235,7 @@ def get_datasource(files_path, file_time_span, source, band='14'): return CarrStereo(files_path, file_time_span, band=band) elif source == 'FMWK_CLD_HGT': return FrameworkCloudHeight(files_path, file_time_span) + elif source == 'FMWK_CLD_PHASE': + return FrameworkCloudPhase(files_path, file_time_span) else: raise GenericException('Unknown data source type') \ No newline at end of file -- GitLab