Skip to content
Snippets Groups Projects
Commit e0f9ddb8 authored by tomrink's avatar tomrink
Browse files

snapshot...

parent 5c307bd9
No related branches found
No related tags found
No related merge requests found
...@@ -1042,13 +1042,10 @@ def best_fit(amv_spd, amv_dir, amv_prs, amv_lat, amv_lon, fcst_spd, fcst_dir, fc ...@@ -1042,13 +1042,10 @@ def best_fit(amv_spd, amv_dir, amv_prs, amv_lat, amv_lon, fcst_spd, fcst_dir, fc
def best_fit_altitude(amv_spd, amv_dir, amv_alt, amv_lat, amv_lon, fcst_spd, fcst_dir, fcst_alt, def best_fit_altitude(amv_spd, amv_dir, amv_alt, amv_lat, amv_lon, fcst_spd, fcst_dir, fcst_alt,
alt_top=25000.0, alt_bot=0.0): alt_top=25000.0, alt_bot=0.0, bf_half_width=500.0, constraint_half_width=400.0):
verbose = False verbose = False
fcst_num_levels = fcst_spd.shape[0] fcst_num_levels = fcst_spd.shape[0]
alt_diff = 1000.0
alt_diff_test = 500.0
flag = 3 flag = 3
bf_tup = (np.nan, np.nan, np.nan, flag) bf_tup = (np.nan, np.nan, np.nan, flag)
if amv_alt > alt_top: if amv_alt > alt_top:
...@@ -1057,8 +1054,8 @@ def best_fit_altitude(amv_spd, amv_dir, amv_alt, amv_lat, amv_lon, fcst_spd, fcs ...@@ -1057,8 +1054,8 @@ def best_fit_altitude(amv_spd, amv_dir, amv_alt, amv_lat, amv_lon, fcst_spd, fcs
return bf_tup return bf_tup
# Calculate the height +/- alt_diff from the AMV height # Calculate the height +/- alt_diff from the AMV height
alt_max = min((amv_alt + alt_diff), alt_top) alt_max = min((amv_alt + bf_half_width), alt_top)
alt_min = max((amv_lat - alt_diff), alt_bot) alt_min = max((amv_lat - bf_half_width), alt_bot)
# 1d array of indices to consider for best fit height # 1d array of indices to consider for best fit height
kk = np.where((fcst_alt > alt_min) & (fcst_alt < alt_max)) kk = np.where((fcst_alt > alt_min) & (fcst_alt < alt_max))
...@@ -1135,8 +1132,8 @@ def best_fit_altitude(amv_spd, amv_dir, amv_alt, amv_lat, amv_lon, fcst_spd, fcs ...@@ -1135,8 +1132,8 @@ def best_fit_altitude(amv_spd, amv_dir, amv_alt, amv_lat, amv_lon, fcst_spd, fcs
good_constraint = 0 good_constraint = 0
flag = 2 flag = 2
mm = np.where(fcst_alt > (sat_wind_best_fit_alt + alt_diff_test))[0] mm = np.where(fcst_alt > (sat_wind_best_fit_alt + constraint_half_width))[0]
nn = np.where(fcst_alt < (sat_wind_best_fit_alt - alt_diff_test))[0] nn = np.where(fcst_alt < (sat_wind_best_fit_alt - constraint_half_width))[0]
if (np.sum(vec_diff[mm] < (vec_diff + 2.0)) + np.sum(vec_diff[nn] < (vec_diff + 2.0))) > 0: if (np.sum(vec_diff[mm] < (vec_diff + 2.0)) + np.sum(vec_diff[nn] < (vec_diff + 2.0))) > 0:
good_constraint = 0 good_constraint = 0
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment