diff --git a/pylot/core/pick/charfuns.py b/pylot/core/pick/charfuns.py index 9d91c704..7cf16708 100644 --- a/pylot/core/pick/charfuns.py +++ b/pylot/core/pick/charfuns.py @@ -296,9 +296,11 @@ class HOScf(CharacteristicFunction): elif self.getOrder() == 4: LTA[j] = lta / np.power(lta1, 2) - nn = np.isnan(LTA) - if len(nn) > 1: - LTA[nn] = 0 + # remove NaN's with first not-NaN-value, + # so autopicker doesnt pick discontinuity at start of the trace + ind = np.where(~np.isnan(LTA))[0] + first = ind[0] + LTA[:first] = LTA[first] self.cf = LTA self.xcf = x