From 351860df607371359e5d1f74fd93f9e3aca8775b Mon Sep 17 00:00:00 2001 From: rink <rink@ssec.wisc.edu> Date: Thu, 24 Sep 2020 18:09:10 -0500 Subject: [PATCH] take out explicit GOES-16 range check, shouldn't need now. --- modules/aeolus/aeolus_amv.py | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/modules/aeolus/aeolus_amv.py b/modules/aeolus/aeolus_amv.py index 95f3c3b5..a3a4b081 100644 --- a/modules/aeolus/aeolus_amv.py +++ b/modules/aeolus/aeolus_amv.py @@ -16,8 +16,8 @@ first_time = True ftimes = [] flist = None -G16_lon_range = [-130.0, -30.0] -G16_lat_range = [-64.0, 64.0] +# G16_lon_range = [-130.0, -30.0] +# G16_lat_range = [-64.0, 64.0] class MyGenericException(Exception): @@ -212,6 +212,8 @@ def get_aeolus_time_dict_s(filenames, lon360=False, do_sort=True): def get_search_box(nav, lon, lat): cc, ll = nav.earth_to_lc(lon, lat) + if cc is None: + return None, None c_rng = [cc - half_width, cc + half_width] l_rng = [ll - half_width, ll + half_width] @@ -231,6 +233,7 @@ def get_search_box(nav, lon, lat): return c_rng, l_rng +# Framework amv_dir_name = 'Wind_Dir' amv_spd_name = 'Wind_Speed' amv_lon_name = 'Longitude' @@ -238,6 +241,12 @@ amv_lat_name = 'Latitude' amv_elem_name = 'Element' amv_line_name = 'Line' amv_press_name = 'MedianPress' +# ------------------------------- +# Carr stereo +amv_lon_name = 'Lon' +amv_lat_name = 'Lat' +amv_press_name = 'pres' +# ------------------------------- # aeolus_dict: time -> profiles @@ -262,12 +271,16 @@ def match_amvs_to_aelous(aeolus_dict, amv_files_path, amv_source='OPS', band='14 lat = layers[0, 0] lon = layers[0, 1] # check range - if lat > G16_lat_range[1] or lat < G16_lat_range[0]: - continue - if lon > G16_lon_range[1] or lon < G16_lon_range[0]: - continue + # if lat > G16_lat_range[1] or lat < G16_lat_range[0]: + # continue + # if lon > G16_lon_range[1] or lon < G16_lon_range[0]: + # continue # ------------------------------------------------ + c_rng, l_rng = get_search_box(nav, lon, lat) + if c_rng is None: + continue + if f_idx != last_f_idx: last_f_idx = f_idx ds = Dataset(fname) @@ -281,8 +294,6 @@ def match_amvs_to_aelous(aeolus_dict, amv_files_path, amv_source='OPS', band='14 # cc, ll = nav.earth_to_lc_s(amv_lons, amv_lats) ds.close() - c_rng, l_rng = get_search_box(nav, lon, lat) - in_cc = np.logical_and(cc > c_rng[0], cc < c_rng[1]) in_ll = np.logical_and(ll > l_rng[0], ll < l_rng[1]) in_box = np.logical_and(in_cc, in_ll) -- GitLab