Skip to content

Commit

Permalink
Used searchsorted(,'right') in sampling.
Browse files Browse the repository at this point in the history
  • Loading branch information
c-h-david committed Sep 19, 2021
1 parent 580ada3 commit 85d2541
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/rrr_anl_spl_mod.py
Original file line number Diff line number Diff line change
Expand Up @@ -347,11 +347,10 @@
ZS_spl_tim=ZV_time3[0]+JS_cyc*ZS_cyc_tim+ZS_mea_tim
if (ZS_spl_tim<=ZV_time3[IS_time3-1]+ZS_TauR):
#Here we're copying the value for each of the sampled river IDs
JS_time3=numpy.searchsorted(ZV_time1,ZS_spl_tim,side='left')-1
#JS_time3=numpy.searchsorted(ZV_time1,ZS_spl_tim,side='right')-1
#if JS_time3<0 or JS_time3>IS_time3-1:
# print('ERROR: Unexpected JS_time3 value: '+str(JS_time3))
# raise SystemExit(22)
JS_time3=numpy.searchsorted(ZV_time1,ZS_spl_tim,side='right')-1
if JS_time3<0 or JS_time3>IS_time3-1:
print('ERROR: Unexpected JS_time3 value: '+str(JS_time3))
raise SystemExit(22)
IV_ids=ZH_mea_tim[ZS_mea_tim]
IV_idx1=[IH_hsh1[IS_ids] for IS_ids in IV_ids]
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Expand Down

0 comments on commit 85d2541

Please sign in to comment.