From 2533dbb23838220469f03d9bfa8f66e589592ba5 Mon Sep 17 00:00:00 2001
From: rink <rink@ssec.wisc.edu>
Date: Mon, 26 Oct 2020 14:16:22 -0500
Subject: [PATCH] snapshot..
---
modules/amv/aeolus.py | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/modules/amv/aeolus.py b/modules/amv/aeolus.py
index 7c68b246..0bab832c 100644
--- a/modules/amv/aeolus.py
+++ b/modules/amv/aeolus.py
@@ -141,7 +141,7 @@ def get_file_containing_time(timestamp, files_path, dto_func, file_time_span):
# imports the S4 NOAA output
# filename: full path as a string, '/home/user/filename'
# returns a dict: time -> list of profiles (a profile is a list of levels)
-def get_aeolus_time_dict(filename, lon360=False):
+def get_aeolus_time_dict(filename, lon360=False, do_sort=True):
time_dict = {}
with open(filename) as file:
@@ -199,6 +199,17 @@ def get_aeolus_time_dict(filename, lon360=False):
file.close()
+ if do_sort:
+ keys = np.array(list(time_dict.keys()))
+ keys.sort()
+ keys = keys.tolist()
+
+ sorted_time_dict = {}
+
+ for key in keys:
+ sorted_time_dict[key] = time_dict.get(key)
+ time_dict = sorted_time_dict
+
return time_dict
--
GitLab