From 7888e154f6a2162a6cd6f1351e2c52cdabfffccf Mon Sep 17 00:00:00 2001
From: tomrink <rink@ssec.wisc.edu>
Date: Thu, 7 Apr 2022 10:42:15 -0500
Subject: [PATCH] snapshot...

---
 modules/aeolus/aeolus_amv.py | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/modules/aeolus/aeolus_amv.py b/modules/aeolus/aeolus_amv.py
index 6046651d..77aa92fb 100644
--- a/modules/aeolus/aeolus_amv.py
+++ b/modules/aeolus/aeolus_amv.py
@@ -150,7 +150,7 @@ def match_amvs_to_raobs(raob_dict, raob_time, amv_ds, time_window=10, filepath=N
             continue
         match_dict[key] = param_nd[:, in_box]
 
-    return match_dict
+    return match_dict, filepath
 
 
 def create_file2(filename, raob_to_amv_dct, raob_dct, amv_files):
@@ -263,11 +263,11 @@ def run_best_fit_driver(amv_dir, source, raob_path, gfs_path, product_dir, produ
     bfs_gfs_list = []
     prd_list = []
 
-    for k, file in enumerate(raob_files):
-        raob_dct = get_raob_dict_cdf(file)
+    for k, raob_filename in enumerate(raob_files):
+        raob_dct = get_raob_dict_cdf(raob_filename)
         keys = list(raob_dct.keys())
         ts = raob_ds.ftimes[k,0]
-        m_d = match_amvs_to_raobs(raob_dct, ts, amv_ds)
+        m_d, amv_filename = match_amvs_to_raobs(raob_dct, ts, amv_ds)
         if m_d is None:
             continue
 
@@ -309,8 +309,6 @@ def run_best_fit_driver(amv_dir, source, raob_path, gfs_path, product_dir, produ
 
         # TODO: write output file here
         filename = None
-        raob_filename = None
-        amv_filename = None
         create_bestfit_file('test_match.nc', m_d, raob_dct, gfs_at_raob_dct, bf_dct, prd_dct, amv_ds.get_parameters(), raob_filename, amv_filename)
 
         # Skip this and below if writing an output file.
-- 
GitLab