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):
start_idx_cspp, stop_idx_cspp = -1, -1
# Average latitude spacing: 0.00652 deg
thresh = 0.0002 # deg
for k in range(len(cntr_lat_oper)):
c_a = np.isclose(cntr_lat_oper[k], cntr_lat_cspp)
if np.sum(c_a) == 1:
if start_idx_oper == -1:
start_idx_oper = k
start_idx_cspp = np.nonzero(c_a)[0][0]
break
for k in range(len(cntr_lat_oper)-1, 0, -1):
c_a = np.isclose(cntr_lat_oper[k], cntr_lat_cspp)
if np.sum(c_a) == 1:
if stop_idx_oper == -1:
stop_idx_oper = k
stop_idx_cspp = np.nonzero(c_a)[0][0]
break
diff = np.abs(cntr_lat_oper[k] - cntr_lat_cspp)
idx_a = np.where(diff < thresh)[0]
if len(idx_a) == 0:
continue
elif len(idx_a) == 1:
start_idx_oper = k
start_idx_cspp = idx_a[0]
break
else:
print("weirdness")
break
if start_idx_oper < 0:
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('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