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

snapshot...

parent b53270b0
Branches
No related tags found
No related merge requests found
...@@ -711,6 +711,8 @@ def analyze(prof_da, amvs_da, prof_locs_da, dist_threshold=5.0): ...@@ -711,6 +711,8 @@ def analyze(prof_da, amvs_da, prof_locs_da, dist_threshold=5.0):
print('number of one layer profs with at least one AMV within threshold: ', num_one_lyr_profs) print('number of one layer profs with at least one AMV within threshold: ', num_one_lyr_profs)
cnt = 0 cnt = 0
prof_bot = one_lyr_profs.sel(num_params='layer_bot')
prof_top = one_lyr_profs.sel(num_params='layer_top')
for k in range(num_one_lyr_profs): for k in range(num_one_lyr_profs):
dst = one_lyr_amvs[k, :, ].sel(num_params='dist_to_prof') dst = one_lyr_amvs[k, :, ].sel(num_params='dist_to_prof')
b = np.logical_and(dst > 0.0, dst < dist_threshold) b = np.logical_and(dst > 0.0, dst < dist_threshold)
...@@ -719,7 +721,7 @@ def analyze(prof_da, amvs_da, prof_locs_da, dist_threshold=5.0): ...@@ -719,7 +721,7 @@ def analyze(prof_da, amvs_da, prof_locs_da, dist_threshold=5.0):
vld = h_3d > 0 vld = h_3d > 0
h_3d = h_3d[vld] h_3d = h_3d[vld]
if len(h_3d) > 0: if len(h_3d) > 0:
in_lyr = np.logical_and(h_3d > one_lyr_profs[k, 0, 0], h_3d < one_lyr_profs[k, 0, 1]) in_lyr = np.logical_and(h_3d > prof_bot[k, 0], h_3d < prof_top[k, 0])
cnt += np.sum(in_lyr) cnt += np.sum(in_lyr)
print('fraction hits single cloud layer: ', cnt/num_one_lyr_profs) print('fraction hits single cloud layer: ', cnt/num_one_lyr_profs)
...@@ -758,7 +760,7 @@ def analyze(prof_da, amvs_da, prof_locs_da, dist_threshold=5.0): ...@@ -758,7 +760,7 @@ def analyze(prof_da, amvs_da, prof_locs_da, dist_threshold=5.0):
if len(h_3d) > 0: if len(h_3d) > 0:
nlevs = prof_locs_da[k].values.astype(int)[3] nlevs = prof_locs_da[k].values.astype(int)[3]
for j in range(nlevs): for j in range(nlevs):
in_lyr = np.logical_and(h_3d > prof_da[k, j, 0], h_3d < prof_da[k, j, 1]) in_lyr = np.logical_and(h_3d > prof_bot[k, j], h_3d < prof_top[k, j])
cnt += np.sum(in_lyr) cnt += np.sum(in_lyr)
print('fraction hits multi layer: ', cnt/num_profs) print('fraction hits multi layer: ', cnt/num_profs)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment