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

snapshot...

parent 34bafa0a
No related branches found
No related tags found
No related merge requests found
......@@ -707,10 +707,11 @@ def analyze(prof_da, amvs_da, prof_locs_da, dist_threshold=5.0):
one_lyr_amvs = one_lyr_amvs[close]
one_lyr_profs = one_lyr_profs[close]
print('number of one layer profs with at least one AMV within 5km: ', one_lyr_profs.shape[0])
num_one_lyr_profs = one_lyr_profs.shape[0]
print('number of one layer profs with at least one AMV within threshold: ', num_one_lyr_profs)
cnt = 0
for k in range(one_lyr_profs.shape[0]):
for k in range(num_one_lyr_profs):
dst = one_lyr_amvs[k, :, ].sel(num_params='dist_to_prof')
b = np.logical_and(dst > 0.0, dst < dist_threshold)
h_3d = one_lyr_amvs[k, :].sel(num_params='H_3D')
......@@ -721,7 +722,7 @@ def analyze(prof_da, amvs_da, prof_locs_da, dist_threshold=5.0):
in_lyr = np.logical_and(h_3d > one_lyr_profs[k, 0, 0], h_3d < one_lyr_profs[k, 0, 1])
cnt += np.sum(in_lyr)
print(cnt)
print('fraction hits single cloud layer: ', cnt/num_one_lyr_profs)
# Do calculations for single and multi-layer combined
hgt_vld = amvs_da.sel(num_params='H_3D') > 0
......@@ -741,10 +742,13 @@ def analyze(prof_da, amvs_da, prof_locs_da, dist_threshold=5.0):
amvs_da = amvs_da[close]
prof_da = prof_da[close]
prof_locs_da = prof_locs_da[close]
print('number of profs with at least one AMV within 5km: ', prof_da.shape[0])
num_profs = prof_da.shape[0]
print('number of profs with at least one AMV within 5km: ', num_profs)
cnt = 0
for k in range(prof_da.shape[0]):
prof_bot = prof_da.sel(num_params='layer_bot')
prof_top = prof_da.sel(num_params='layer_top')
for k in range(num_profs):
dst = amvs_da[k, :, ].sel(num_params='dist_to_prof')
b = np.logical_and(dst > 0.0, dst < dist_threshold)
h_3d = amvs_da[k, :].sel(num_params='H_3D')
......@@ -757,5 +761,5 @@ def analyze(prof_da, amvs_da, prof_locs_da, dist_threshold=5.0):
in_lyr = np.logical_and(h_3d > prof_da[k, j, 0], h_3d < prof_da[k, j, 1])
cnt += np.sum(in_lyr)
print(cnt)
print('fraction hits multi layer: ', cnt/num_profs)
return one_lyr_profs, one_lyr_amvs
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