diff --git a/modules/aeolus/aeolus_amv.py b/modules/aeolus/aeolus_amv.py index 64a7f497e276dc837e16c4af243736c46a80acc2..9d587308edd84233d3c01e69550bebba41ed7cc2 100644 --- a/modules/aeolus/aeolus_amv.py +++ b/modules/aeolus/aeolus_amv.py @@ -25,6 +25,8 @@ num_lines = 5424 def get_amvs(amv_ds, timestamp, filepath=None): if filepath is None: filepath, ftime, f_idx = amv_ds.get_file(timestamp) + if filepath is None: + return None amv_params = amv_ds.get_parameters() # TODO: Need to generalize this better amv_params = [amv_ds.lat_name, amv_ds.lon_name, amv_ds.elem_name, amv_ds.line_name] + amv_params @@ -73,6 +75,8 @@ def match_amvs_to_raobs(raob_dict, raob_time, amv_ds, filepath=None): if filepath is None: filepath, ftime, f_idx = amv_ds.get_file(raob_time) + if filepath is None: + return None ds = Dataset(filepath) @@ -254,6 +258,8 @@ def run_best_fit_all(amv_dir, source, product_dir, product, raob_path, gfs_path, for k, file in enumerate(raob_files): raob_dct, ts = get_raob_dict_cdf(file) m_d = match_amvs_to_raobs(raob_dct, ts, amv_files) + if m_d is None: + continue gfs_file = gfs_files.get_file(ts)[0] if gfs_file is None: continue @@ -289,6 +295,8 @@ def run_best_fit_all(amv_dir, source, product_dir, product, raob_path, gfs_path, for k, file in enumerate(raob_files): raob_dct, ts = get_raob_dict_cdf(file) amvs = get_amvs(amv_files, ts) + if amvs is None: + continue gfs_file = gfs_files.get_file(ts)[0] if gfs_file is None: continue