From 5648fc1870075a20fa33261fed912af637c71572 Mon Sep 17 00:00:00 2001 From: Darius Arnold Date: Thu, 24 Aug 2017 15:42:12 +0200 Subject: [PATCH] [change] replace NaN's in HOScf by first NaN value instead of zero --- pylot/core/pick/charfuns.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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