From 4389ff83d9ab4eb68048757389d06e4d1bcc07c1 Mon Sep 17 00:00:00 2001
From: tomrink <rink@ssec.wisc.edu>
Date: Wed, 7 Jul 2021 10:58:25 -0500
Subject: [PATCH] snapshot...

---
 modules/aeolus/aeolus_amv.py | 18 +++++++++++++++---
 1 file changed, 15 insertions(+), 3 deletions(-)

diff --git a/modules/aeolus/aeolus_amv.py b/modules/aeolus/aeolus_amv.py
index d7e17dab..9fe1c06a 100644
--- a/modules/aeolus/aeolus_amv.py
+++ b/modules/aeolus/aeolus_amv.py
@@ -2078,10 +2078,23 @@ def create_file_new(match_dct, filename, amv_params, amv_file_s):
     rg_exmpl.close()
     rootgrp.close()
 
+
+def run_clavrx_to_aeolus_match(aeolus_files_dir, clvrx_files_dir, outfile, band='14', chan='mie'):
+    if os.path.isdir(aeolus_files_dir):
+        a_dct = get_aeolus_time_dict_s(aeolus_files_dir, chan=chan)
+    else:
+        a_dct = get_aeolus_time_dict(aeolus_files_dir)
+
+    a_dct = time_dict_to_nd(a_dct)
+    clvrx_files = CLAVRx(clvrx_files_dir)
+    m_d = match_aeolus_to_clavrx(a_dct, clvrx_files)
+    create_aeolus_clavrx_match_file(m_d, outfile, clvrx_files.get_parameters(), clvrx_files.flist)
+
+
 # aeolus_files_dir: S4 NOAA txt output files
 # amv_files_dir: G16/17 AMV product files
 # outfile: pathname for the Netcdf match file
-def create_amv_to_aeolus_match_file(aeolus_files_dir, amv_files_dir, outfile=None, amv_source='OPS', band='14', chan='mie'):
+def create_amv_to_aeolus_match_file(aeolus_files_dir, amv_files_dir, outfile, amv_source='OPS', band='14', chan='mie'):
 
     if os.path.isdir(aeolus_files_dir):
         a_d = get_aeolus_time_dict_s(aeolus_files_dir, chan=chan)
@@ -2097,8 +2110,7 @@ def create_amv_to_aeolus_match_file(aeolus_files_dir, amv_files_dir, outfile=Non
 
     m_d = match_amvs_to_aeolus_fast(a_d, amv_files_dir, amv_source, band, amv_files)
 
-    if outfile is not None:
-        create_file_new(m_d, outfile, amv_files.get_parameters(), amv_files.flist)
+    create_file_new(m_d, outfile, amv_files.get_parameters(), amv_files.flist)
 
 
 # match_file: pathname for the product file
-- 
GitLab