diff --git a/modules/amv/intercompare.py b/modules/amv/intercompare.py index c53014f3e6083719aceaf914f642fd26aebdacbc..2399a4744099a89be7dace068561e6d9c188363e 100644 --- a/modules/amv/intercompare.py +++ b/modules/amv/intercompare.py @@ -969,15 +969,16 @@ def best_fit(amv_spd, amv_dir, amv_prs, amv_lat, amv_lon, fcst_spd, fcst_dir, fc 10/2012 - Steve Wanzong - Created in Fortran 10/2013 - Sharon Nebuda - rewritten for python """ + undef = -9999.0 + flag = 3 + bf_data = (undef, undef, undef, flag) - fcst_num_levels = fcst_spd.shape[0] + fcst_num_levels = fcst_prs.shape[0] - PressDiff = 150. # pressure above and below AMV to look for fit - TopPress = 50. # highest level to allow search + PressDiff = 150.0 # pressure above and below AMV to look for fit + TopPress = 50.0 # highest level to allow search - flag = 3 - bf_data = (undef, undef, undef, flag) if amv_prs < TopPress: if verbose: print('AMV location lat,lon,prs ({0},{1},{2}) is higher than pressure {3}'.format(amv_lat,amv_lon,amv_prs,TopPress)) @@ -985,7 +986,7 @@ def best_fit(amv_spd, amv_dir, amv_prs, amv_lat, amv_lon, fcst_spd, fcst_dir, fc # Calculate the pressure +/- 150 hPa from the AMV pressure. PressMax = amv_prs + PressDiff - PressMin = max((amv_prs-PressDiff), TopPress) + PressMin = max((amv_prs - PressDiff), TopPress) # 1d array of indicies to consider for best fit location kk = np.where((fcst_prs < PressMax) & (fcst_prs > PressMin))