diff --git a/modules/aeolus/aeolus_amv.py b/modules/aeolus/aeolus_amv.py index d7e17dab12e62d8c73a8bd15a464401c5ef005f6..9fe1c06a00f62b2b20b334c55285e2240ea1ed74 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