From 5a3fa71b6b6baf9725a0ba1344a2699002c264dc Mon Sep 17 00:00:00 2001 From: tomrink <rink@ssec.wisc.edu> Date: Wed, 14 Sep 2022 12:26:07 -0500 Subject: [PATCH] snaphot... --- modules/amv/caliop_clavrx_amv.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/modules/amv/caliop_clavrx_amv.py b/modules/amv/caliop_clavrx_amv.py index 77891edf..74d63f74 100644 --- a/modules/amv/caliop_clavrx_amv.py +++ b/modules/amv/caliop_clavrx_amv.py @@ -41,7 +41,8 @@ def get_search_box(cc, ll): return c_rng, l_rng -def match_calipso_clavrx_to_amvs(calipso_clavrx_ds, calipso_clavrx_file, amv_files, calipso_clavrx_params, gfs_ds): +#def match_calipso_clavrx_to_amvs(calipso_clavrx_ds, calipso_clavrx_file, amv_files, calipso_clavrx_params, gfs_ds): +def match_calipso_clavrx_to_amvs(nom_time, calipso_clavrx_nc4, amv_files, calipso_clavrx_params, gfs_ds): nav = amv_files.get_navigation() amv_params = amv_files.get_parameters() all_params = [amv_files.lon_name, amv_files.lat_name, amv_files.elem_name, amv_files.line_name] + amv_params @@ -49,10 +50,10 @@ def match_calipso_clavrx_to_amvs(calipso_clavrx_ds, calipso_clavrx_file, amv_fil coords = {'num_params': all_params} dims = ['num_params', 'num_amvs'] - nom_time = calipso_clavrx_ds.get_datetime(calipso_clavrx_file).timestamp() - calipso_clavrx_nc4 = Dataset(calipso_clavrx_file) + #nom_time = calipso_clavrx_ds.get_datetime(calipso_clavrx_file).timestamp() + #calipso_clavrx_nc4 = Dataset(calipso_clavrx_file) - print('start processing: ', calipso_clavrx_file) + #print('start processing: ', calipso_clavrx_file) amv_fname, ftime, f_idx = amv_files.get_file(nom_time) if f_idx is None: @@ -316,7 +317,11 @@ def run_caliop_clavrx_amv_match(output_path, path_to_caliop_clavrx, path_to_amvs gfs_ds = get_datasource(path_to_gfs, 'GFS') for f in caliop_clavrx_ds.flist: - match_dict = match_calipso_clavrx_to_amvs(caliop_clavrx_ds, f, amv_ds, caliop_clavrx_params, gfs_ds) + nom_time = caliop_clavrx_ds.get_datetime(f).timestamp() + calipso_clavrx_nc4 = Dataset(f) + print('Start processing: ', f) + match_dict = match_calipso_clavrx_to_amvs(nom_time, calipso_clavrx_nc4, amv_ds, caliop_clavrx_params, gfs_ds) + calipso_clavrx_nc4.close() if match_dict is None or not match_dict: print('No matches for: ', f) continue -- GitLab