From 973d92db02f604a068180073e0546ee99ef56f05 Mon Sep 17 00:00:00 2001 From: tomrink <rink@ssec.wisc.edu> Date: Sun, 1 Nov 2020 14:06:14 -0600 Subject: [PATCH] snapshot... --- modules/amv/intercompare.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/modules/amv/intercompare.py b/modules/amv/intercompare.py index da8c7cf5..608c0f2b 100644 --- a/modules/amv/intercompare.py +++ b/modules/amv/intercompare.py @@ -120,17 +120,17 @@ def get_amv_nd(filename): return np.array(data) -def filter_amvs(amvs, qi=None, cqi=50, qif=None, lat_range=None): +def filter_amvs(amvs, qitype=amv_cqi_idx, qival=50, lat_range=None): if lat_range is not None: keep = np.logical_and(amvs[:, amv_lat_idx] > lat_range[0], amvs[:, amv_lat_idx] < lat_range[1]) if np.sum(keep) == 0: return None amvs = amvs[keep, :] - if cqi is None: + if qitype is None: return amvs - keep = amvs[:, amv_cqi_idx] >= cqi + keep = amvs[:, qitype] >= qival if np.sum(keep) == 0: return None @@ -730,7 +730,7 @@ def direction_difference(dir_a, dir_b): return diff -def get_amv_winds_match(dist_threshold=150, cqi=50, lat_range=[-60, 60]): +def get_amv_winds_match(dist_threshold=150, qitype=amv_cqi_idx, qival=50, lat_range=[-60, 60]): # match all to EUM amvs_eum = get_amv_nd('/Users/rink/data/amv_intercompare/EUM321_csv.csv') amvs_brz = get_amv_nd('/Users/rink/data/amv_intercompare/BRZCPTECfin_121_csv.csv') @@ -739,12 +739,12 @@ def get_amv_winds_match(dist_threshold=150, cqi=50, lat_range=[-60, 60]): amvs_noa = get_amv_nd('/Users/rink/data/amv_intercompare/NOA621_csv.csv') amvs_nwc = get_amv_nd('/Users/rink/data/amv_intercompare/NWC721_csv.csv') - amvs_eum = filter_amvs(amvs_eum, cqi=cqi, lat_range=lat_range) - amvs_brz = filter_amvs(amvs_brz, cqi=cqi, lat_range=lat_range) - amvs_jma = filter_amvs(amvs_jma, cqi=cqi, lat_range=lat_range) - amvs_kma = filter_amvs(amvs_kma, cqi=cqi, lat_range=lat_range) - amvs_nwc = filter_amvs(amvs_nwc, cqi=cqi, lat_range=lat_range) - amvs_noa = filter_amvs(amvs_noa, cqi=cqi, lat_range=lat_range) + amvs_eum = filter_amvs(amvs_eum, qitype=qitype, qival=qival, lat_range=lat_range) + amvs_brz = filter_amvs(amvs_brz, qitype=qitype, qival=qival, lat_range=lat_range) + amvs_jma = filter_amvs(amvs_jma, qitype=qitype, qival=qival, lat_range=lat_range) + amvs_kma = filter_amvs(amvs_kma, qitype=qitype, qival=qival, lat_range=lat_range) + amvs_nwc = filter_amvs(amvs_nwc, qitype=qitype, qival=qival, lat_range=lat_range) + amvs_noa = filter_amvs(amvs_noa, qitype=qitype, qival=qival, lat_range=lat_range) lat_idx = amv_hdr_list.index('lat') lon_idx = amv_hdr_list.index('lon') -- GitLab