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

snapshot...

parent 32377597
Branches
No related tags found
No related merge requests found
......@@ -1042,10 +1042,11 @@ 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,
amv_uwind=None, amv_vwind=None,
fcst_uwind=None, fcst_vwind=None,
alt_top=25000.0, alt_bot=0.0, bf_half_width=500.0, constraint_half_width=400.0):
alt_top=25000.0, alt_bot=0.0, bf_half_width=1000.0, constraint_half_width=1000.0):
verbose = False
fcst_num_levels = fcst_spd.shape[0]
fcst_num_levels = fcst_alt.shape[0]
flag = 3
bf_tup = (np.nan, np.nan, np.nan, flag)
......@@ -1066,8 +1067,9 @@ def best_fit_altitude(amv_spd, amv_dir, amv_alt, amv_lat, amv_lon, fcst_spd, fcs
return bf_tup
# Compute U anv V for both AMVs and forecast
amv_uwind = -amv_spd * np.sin((np.pi/180.0)*amv_dir)
amv_vwind = -amv_spd * np.cos((np.pi/180.0)*amv_dir)
if amv_uwind is None:
amv_uwind = -amv_spd * np.sin((np.pi/180.0)*amv_dir)
amv_vwind = -amv_spd * np.cos((np.pi/180.0)*amv_dir)
if fcst_uwind is None:
fcst_uwind = -fcst_spd * np.sin((np.pi/180.0)*fcst_dir)
fcst_vwind = -fcst_spd * np.cos((np.pi/180.0)*fcst_dir)
......@@ -1141,7 +1143,7 @@ def best_fit_altitude(amv_spd, amv_dir, amv_alt, amv_lat, amv_lon, fcst_spd, fcs
mm = np.where(fcst_alt > (sat_wind_best_fit_alt + constraint_half_width))[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] < (vdiff + 2.0)) + np.sum(vec_diff[nn] < (vdiff + 2.0))) > 0:
good_constraint = 0
flag = 1
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment