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

snapshot...

parent 14ca60b9
No related branches found
No related tags found
No related merge requests found
...@@ -470,12 +470,16 @@ def run_best_fit_all(): ...@@ -470,12 +470,16 @@ def run_best_fit_all():
raob_dct, ts = get_raob_dict_cdf(raob_dir+file) raob_dct, ts = get_raob_dict_cdf(raob_dir+file)
m_d = match_amvs_to_raobs(raob_dct, ts, amv_files=amv_files) m_d = match_amvs_to_raobs(raob_dct, ts, amv_files=amv_files)
#bf_dct = run_best_fit(m_d, raob_dct, gfs_dir+gfs_files[k]) #bf_dct = run_best_fit(m_d, raob_dct, gfs_dir+gfs_files[k])
prd_dct = get_product_at_locs(m_d, ts, prd_files) #prd_dct = get_product_at_locs(m_d, ts, prd_files)
#out_list.append((bf_dct, prd_dct)) #out_list.append((bf_dct, prd_dct))
amvs = get_amvs(amv_files, ts) amvs = get_amvs(amv_files, ts)
bfs = run_best_fit_gfs(amvs, gfs_dir+gfs_files[k], amv_lat_idx=0, amv_lon_idx=1, amv_prs_idx=4, amv_spd_idx=5, amv_dir_idx=6) bfs = run_best_fit_gfs(amvs, gfs_dir+gfs_files[k], amv_lat_idx=0, amv_lon_idx=1, amv_prs_idx=4, amv_spd_idx=5, amv_dir_idx=6)
out_list.append((amvs, np.array(bfs), prd_dct)) alons = amvs[0, :]
alats = amvs[1, :]
prds = get_product_at_lat_lons(prd_files, ts, alons, alats, filepath=None)
out_list.append((amvs, np.array(bfs), prds))
return out_list return out_list
...@@ -555,6 +559,32 @@ def get_product_at_locs1x1(raob_to_amv_dct, ts, files, filepath=None): ...@@ -555,6 +559,32 @@ def get_product_at_locs1x1(raob_to_amv_dct, ts, files, filepath=None):
return m_dct return m_dct
def get_product_at_lat_lons(files, ts, lons, lats, filepath=None):
nav = files.get_navigation()
the_params = files.get_parameters()
num_params = len(the_params)
if filepath is None:
filepath, ftime, f_idx = files.get_file(ts)
ds = Dataset(filepath)
var_s = []
for pstr in the_params:
var = ds[pstr]
var_s.append(var)
num = lons.shape[0]
cc, ll = nav.earth_to_lc_s(lons, lats)
aaa = np.zeros((num_params, num), dtype=np.float)
for vidx, var in enumerate(var_s):
for k in range(num):
aaa[vidx, k] = var[ll[k], cc[k]].data
return np.transpose(aaa, axes=[1, 0])
def run_best_fit2(raob_to_amv_dct, raob_dct, gfs_filename=None): def run_best_fit2(raob_to_amv_dct, raob_dct, gfs_filename=None):
bfs_dct ={} bfs_dct ={}
keys = list(raob_to_amv_dct.keys()) keys = list(raob_to_amv_dct.keys())
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment