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

snapshot...

parent 8bf95670
No related branches found
No related tags found
No related merge requests found
...@@ -47,8 +47,8 @@ def match_calipso_clavrx_to_amvs(nom_time, calipso_clavrx_nc4, amv_files, calips ...@@ -47,8 +47,8 @@ def match_calipso_clavrx_to_amvs(nom_time, calipso_clavrx_nc4, amv_files, calips
amv_params = amv_files.get_parameters() amv_params = amv_files.get_parameters()
all_params = [amv_files.lon_name, amv_files.lat_name, amv_files.elem_name, amv_files.line_name] + amv_params all_params = [amv_files.lon_name, amv_files.lat_name, amv_files.elem_name, amv_files.line_name] + amv_params
match_dict = {} match_dict = {}
coords = {'num_params': all_params}
dims = ['num_params', 'num_amvs'] dims = ['num_params', 'num_amvs']
coords = {'num_params': all_params}
amv_fname, ftime, f_idx = amv_files.get_file(nom_time) amv_fname, ftime, f_idx = amv_files.get_file(nom_time)
if f_idx is None: if f_idx is None:
...@@ -124,15 +124,18 @@ def match_calipso_clavrx_to_amvs(nom_time, calipso_clavrx_nc4, amv_files, calips ...@@ -124,15 +124,18 @@ def match_calipso_clavrx_to_amvs(nom_time, calipso_clavrx_nc4, amv_files, calips
data_nd = np.vstack(calipso_clavrx_data) data_nd = np.vstack(calipso_clavrx_data)
data_da = xr.DataArray(data_nd[:, idx], coords=coords_a, dims=dims_a) data_da = xr.DataArray(data_nd[:, idx], coords=coords_a, dims=dims_a)
lons = param_nd[0, :] #lons = param_nd[0, :]
lats = param_nd[1, :] #lats = param_nd[1, :]
lons = amvs_da[amv_files.lon_name, :]
lats = amvs_da[amv_files.lat_name, :]
temp_prof = get_vert_profile_s(gfs_xr, ['temperature'], lons, lats, method='linear') temp_prof = get_vert_profile_s(gfs_xr, ['temperature'], lons, lats, method='linear')
temp_prof = temp_prof.values temp_prof = temp_prof.values
temp_prof_s = temp_prof[0, :, :] temp_prof_s = temp_prof[0, :, :]
alt_s = [] alt_s = []
for k in range(num_amvs): for k in range(num_amvs):
alt = pressure_to_altitude(param_nd[4, k], None, gfs_press, temp_prof_s[k, :]) #alt = pressure_to_altitude(param_nd[4, k], None, gfs_press, temp_prof_s[k, :])
alt = pressure_to_altitude(amvs_da[amv_files.press_name, k], None, gfs_press, temp_prof_s[k, :])
alt_s.append(alt) alt_s.append(alt)
alt_s = np.array(alt_s) alt_s = np.array(alt_s)
...@@ -276,6 +279,9 @@ def create_file(match_dct, output_path, target_filepath, caliop_clavrx_params, a ...@@ -276,6 +279,9 @@ def create_file(match_dct, output_path, target_filepath, caliop_clavrx_params, a
dist = tup[7] dist = tup[7]
alt = tup[8] alt = tup[8]
dst_to_amvs[idx, 0:cnt] = dist
amv_geom_hgt[idx, 0:cnt] = alt
for pidx, param in enumerate(caliop_clavrx_params): for pidx, param in enumerate(caliop_clavrx_params):
nda = data_nd[pidx] nda = data_nd[pidx]
nc4_vars_cc[pidx][idx] = nda nc4_vars_cc[pidx][idx] = nda
...@@ -296,9 +302,6 @@ def create_file(match_dct, output_path, target_filepath, caliop_clavrx_params, a ...@@ -296,9 +302,6 @@ def create_file(match_dct, output_path, target_filepath, caliop_clavrx_params, a
cnt = nda.shape[0] cnt = nda.shape[0]
amv_line[idx, 0:cnt] = nda amv_line[idx, 0:cnt] = nda
dst_to_amvs[idx, 0:cnt] = dist
amv_geom_hgt[idx, 0:cnt] = alt
for pidx, param in enumerate(amv_params): for pidx, param in enumerate(amv_params):
nda = amvs_nd[pidx+4,] nda = amvs_nd[pidx+4,]
cnt = nda.shape[0] cnt = nda.shape[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