diff --git a/pylot/core/analysis/magnitude.py b/pylot/core/analysis/magnitude.py index 867a302d..c1eee9cd 100644 --- a/pylot/core/analysis/magnitude.py +++ b/pylot/core/analysis/magnitude.py @@ -215,6 +215,8 @@ class LocalMagnitude(Magnitude): th = np.arange(0, len(sqH) * dt, dt) # get maximum peak within pick window iwin = getsignalwin(th, t0 - stime, self.calc_win) + ii = min([iwin[len(iwin)-1], len(th)]) + iwin = iwin[0:ii] wapp = np.max(sqH[iwin]) if self.verbose: print("Determined Wood-Anderson peak-to-peak amplitude for station {0}: {1} " diff --git a/pylot/core/pick/picker.py b/pylot/core/pick/picker.py index a6cd7452..ebf737a5 100644 --- a/pylot/core/pick/picker.py +++ b/pylot/core/pick/picker.py @@ -212,6 +212,14 @@ class AICPicker(AutoPicker): self.Data[0].data = self.Data[0].data * 1000000 # get signal window isignal = getsignalwin(self.Tcf, self.Pick, self.TSNR[2]) + ii = min([isignal[len(isignal)-1], len(self.Tcf)]) + isignal = isignal[0:ii] + try: + aic[isignal] + except IndexError as e: + msg = "Time series out of bounds! {}".format(e) + print(msg) + return # calculate SNR from CF self.SNR = max(abs(aic[isignal] - np.mean(aic[isignal]))) / \ max(abs(aic[inoise] - np.mean(aic[inoise])))