diff --git a/modules/aeolus/aeolus_amv.py b/modules/aeolus/aeolus_amv.py index f4aaa3cf394321be4ce7bc0b3832371f48d9d3af..c50578fcb90abf91f3055585ab758461516ce757 100644 --- a/modules/aeolus/aeolus_amv.py +++ b/modules/aeolus/aeolus_amv.py @@ -1455,7 +1455,8 @@ def match_aeolus_to_clavrx(aeolus_dict, clvrx_files): cc, ll = nav.earth_to_lc(lon, lat) if cc is None or ll is None: continue - + if cc - 4 < 0 or ll - 4 < 0 or cc + 5 >= num_elems or ll + 5 >= num_lines: + continue # c_rng, l_rng = get_search_box(nav, lon, lat) # if c_rng is None: # continue @@ -1545,15 +1546,18 @@ def create_file_2(match_dct, filename, clvrx_params=['cld_height_acha', 'cld_pre var.units = u nc4_vars.append(var) - # Write data to file... + # Write data to file --------------------- + prf_lon[:] = alons + prf_lat[:] = alats + prf_elem[:] = elems + prf_line[:] = lines + prf_time[:] = atimes + for idx, key in enumerate(keys): tup = match_dct.get(key) prof = tup[4] param_nd = tup[5] - for pidx, param in enumerate(clvrx_params): - nc4_vars[pidx][idx, :, :] = param_nd[pidx, :, :] - nlevs = prof.shape[0] for k in range(nlevs): prf_spd[idx,k] = prof[k,6] @@ -1561,11 +1565,9 @@ def create_file_2(match_dct, filename, clvrx_params=['cld_height_acha', 'cld_pre prf_hht[idx,k] = prof[k,3] prf_hhb[idx,k] = prof[k,4] - prf_lon[:] = alons - prf_lat[:] = alats - prf_elem[:] = elems - prf_line[:] = lines - prf_time[:] = atimes + for pidx, param in enumerate(clvrx_params): + nc4_vars[pidx][idx, :, :] = param_nd[pidx, :, :] + rootgrp.close()