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

snapshot...

parent ebb2c293
No related branches found
No related tags found
No related merge requests found
...@@ -65,22 +65,33 @@ def acspo_validate(oper_file, cspp_file, rel_tol=0.001, outfile_nc=None): ...@@ -65,22 +65,33 @@ def acspo_validate(oper_file, cspp_file, rel_tol=0.001, outfile_nc=None):
start_idx_cspp, stop_idx_cspp = -1, -1 start_idx_cspp, stop_idx_cspp = -1, -1
# Average latitude spacing: 0.00652 deg # Average latitude spacing: 0.00652 deg
thresh = 0.0002 # deg
for k in range(len(cntr_lat_oper)): for k in range(len(cntr_lat_oper)):
c_a = np.isclose(cntr_lat_oper[k], cntr_lat_cspp) diff = np.abs(cntr_lat_oper[k] - cntr_lat_cspp)
if np.sum(c_a) == 1: idx_a = np.where(diff < thresh)[0]
if start_idx_oper == -1: if len(idx_a) == 0:
start_idx_oper = k continue
start_idx_cspp = np.nonzero(c_a)[0][0] elif len(idx_a) == 1:
break start_idx_oper = k
start_idx_cspp = idx_a[0]
for k in range(len(cntr_lat_oper)-1, 0, -1): break
c_a = np.isclose(cntr_lat_oper[k], cntr_lat_cspp) else:
if np.sum(c_a) == 1: print("weirdness")
if stop_idx_oper == -1: break
stop_idx_oper = k
stop_idx_cspp = np.nonzero(c_a)[0][0] if start_idx_oper < 0:
break print("no overlap found")
num_oper_remain = (oper_track_len - 1) - start_idx_oper
num_cspp_remain = (cspp_track_len - 1) - start_idx_cspp
if num_oper_remain <= num_cspp_remain:
stop_idx_oper = start_idx_oper + num_oper_remain
stop_idx_cspp = start_idx_cspp + num_oper_remain
else:
stop_idx_oper = start_idx_oper + num_cspp_remain
stop_idx_cspp = start_idx_cspp + num_cspp_remain
print('oper start, stop ', start_idx_oper, stop_idx_oper) print('oper start, stop ', start_idx_oper, stop_idx_oper)
print('cspp start, stop ', start_idx_cspp, stop_idx_cspp) print('cspp start, stop ', start_idx_cspp, stop_idx_cspp)
......
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