From ff25bf58e037399fb8ee711193dbf280a31dc516 Mon Sep 17 00:00:00 2001
From: tomrink <rink@ssec.wisc.edu>
Date: Wed, 15 Jun 2022 10:21:19 -0500
Subject: [PATCH] snapshot...

---
 modules/aeolus/datasource.py | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/modules/aeolus/datasource.py b/modules/aeolus/datasource.py
index e3c4f144..9abf6f2b 100644
--- a/modules/aeolus/datasource.py
+++ b/modules/aeolus/datasource.py
@@ -479,6 +479,33 @@ class OPS(AMVFiles):
         return dto
 
 
+class NOAA_txt(AMVFiles):
+    def __init__(self, files_path, file_time_span, band='14'):
+        elem_name = None
+        line_name = None
+        lon_name = 'lon'
+        lat_name = 'lat'
+
+        params = ['pressure', 'wind_speed', 'wind_direction']
+        out_params = ['Lon', 'Lat', 'Element', 'Line'] + params
+        meta_dict = {'Lon': ('degrees east', 'f4'), 'Lat': ('degrees north', 'f4'), 'Element': (None, 'i4'), 'Line': (None, 'i4'),
+                          'pressure': ('hPa', 'f4'), 'wind_speed': ('m s-1', 'f4'), 'wind_direction': ('degrees', 'f4')}
+
+        super().__init__(files_path, file_time_span, 'ASCII_AMV*.CT', band=band, 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('.')
+        dtstr = toks[2] + '.' + toks[3]
+        dto = datetime.datetime.strptime(dtstr, '%Y%j.%H%M').replace(tzinfo=timezone.utc)
+
+        return dto
+
+
 class CarrStereo(AMVFiles):
     def __init__(self, files_path, file_time_span, band='14'):
         elem_name = 'Element'
@@ -517,6 +544,8 @@ class CarrStereo(AMVFiles):
 def get_datasource(files_path, source, file_time_span=10, band='14'):
     if source == 'OPS':
         return OPS(files_path, file_time_span, band=band)
+    elif source == 'NOAA_TXT':
+        return NOAA_txt(files_path, file_time_span, band=band)
     elif source == 'FMWK':
         return Framework(files_path, file_time_span, band=band)
     elif source == 'CARR':
-- 
GitLab