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

snapshot...

parent cb75d975
No related branches found
No related tags found
No related merge requests found
...@@ -1042,6 +1042,7 @@ def best_fit(amv_spd, amv_dir, amv_prs, amv_lat, amv_lon, fcst_spd, fcst_dir, fc ...@@ -1042,6 +1042,7 @@ 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,
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=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]
...@@ -1064,17 +1065,20 @@ def best_fit_altitude(amv_spd, amv_dir, amv_alt, amv_lat, amv_lon, fcst_spd, fcs ...@@ -1064,17 +1065,20 @@ def best_fit_altitude(amv_spd, amv_dir, amv_alt, amv_lat, amv_lon, fcst_spd, fcs
print('AMV location lat,lon,alt ({0},{1},{2}) failed to find fcst alt around AMV'.format(amv_lat,amv_lon,amv_alt)) print('AMV location lat,lon,alt ({0},{1},{2}) failed to find fcst alt around AMV'.format(amv_lat,amv_lon,amv_alt))
return bf_tup 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 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)
else:
fcst_spd = np.sqrt(fcst_uwind**2 + fcst_vwind**2)
# Diagnostic field: Find the model minimum speed and maximum speed within PressDiff of the AMV. # Diagnostic field: Find the model minimum speed and maximum speed within PressDiff of the AMV.
if verbose: if verbose:
sat_wind_min_spd = min(fcst_spd[kk]) sat_wind_min_spd = min(fcst_spd[kk])
sat_wind_max_spd = max(fcst_spd[kk]) sat_wind_max_spd = max(fcst_spd[kk])
# 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)
fcst_uwind = -fcst_spd * np.sin((np.pi/180.0)*fcst_dir)
fcst_vwind = -fcst_spd * np.cos((np.pi/180.0)*fcst_dir)
# Calculate the vector difference between the AMV and model background at all levels. # Calculate the vector difference between the AMV and model background at all levels.
vec_diff = np.sqrt((amv_uwind - fcst_uwind) ** 2 + (amv_vwind - fcst_vwind) ** 2) vec_diff = np.sqrt((amv_uwind - fcst_uwind) ** 2 + (amv_vwind - fcst_vwind) ** 2)
......
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