From ca56cfecc89c176002902dad5e351adbea2bfb31 Mon Sep 17 00:00:00 2001 From: tomrink <rink@ssec.wisc.edu> Date: Sun, 1 Nov 2020 11:45:34 -0600 Subject: [PATCH] snapshot... --- modules/amv/intercompare.py | 33 ++++++++------------------------- 1 file changed, 8 insertions(+), 25 deletions(-) diff --git a/modules/amv/intercompare.py b/modules/amv/intercompare.py index ff730864..eefd67be 100644 --- a/modules/amv/intercompare.py +++ b/modules/amv/intercompare.py @@ -356,14 +356,6 @@ def amv_raob_diff(amv_lat, amv_lon, amv_spd, amv_dir, amv_press, raob_dct): rdir = raob[lev_idx, raob_dir_idx] rspd = raob[lev_idx, raob_spd_idx] - # ddiff = np.abs(adir - rdir) - # if ddiff > 180: - # ddiff = 360 - ddiff - # if rdir < adir: - # ddiff = -1 * ddiff - # else: - # if rdir > adir: - # ddiff = -1 * ddiff ddiff = direction_difference(adir, rdir) dir_diffs.append(ddiff) @@ -581,15 +573,6 @@ def raob_gfs_diff(raob_dct, gfs_filename): gdir = g_wdir[j, g_lev_idx] print(rspd, gspd, ':', rdir, gdir) - - # ddiff = np.abs(adir - rdir) - # if ddiff > 180: - # ddiff = 360 - ddiff - # if rdir < adir: - # ddiff = -1 * ddiff - # else: - # if rdir > adir: - # ddiff = -1 * ddiff ddiff = direction_difference(gdir, rdir) dir_diffs.append(ddiff) @@ -673,14 +656,6 @@ def amv_gfs_diff(amvs, gfs_filename): rspd = wspd[j, lev_idx] rdir = wdir[j, lev_idx] - # ddiff = np.abs(adir - rdir) - # if ddiff > 180: - # ddiff = 360 - ddiff - # if rdir < adir: - # ddiff = -1 * ddiff - # else: - # if rdir > adir: - # ddiff = -1 * ddiff ddiff = direction_difference(adir, rdir) dir_diffs.append(ddiff) @@ -735,6 +710,14 @@ def amv_gfs_diff(amvs, gfs_filename): return None +# ddiff = np.abs(adir - rdir) +# if ddiff > 180: +# ddiff = 360 - ddiff +# if rdir < adir: +# ddiff = -1 * ddiff +# else: +# if rdir > adir: +# ddiff = -1 * ddiff def direction_difference(dir_a, dir_b): diff = np.abs(dir_a - dir_b) -- GitLab