[bugfix] avoid indexing an empty array when there are no NaNs at start of CF

This commit is contained in:
Darius Arnold authored and Marcel committed 2017-08-29 15:05:34 +02:00
1 parent bac6d6f5ec
commit 1ceb347602
1 file changed
+3 -2
+3 -2
View File
@@ -299,8 +299,9 @@ class HOScf(CharacteristicFunction):
# remove NaN's with first not-NaN-value, # remove NaN's with first not-NaN-value,
# so autopicker doesnt pick discontinuity at start of the trace # so autopicker doesnt pick discontinuity at start of the trace
ind = np.where(~np.isnan(LTA))[0] ind = np.where(~np.isnan(LTA))[0]
first = ind[0] if ind.size:
LTA[:first] = LTA[first] first = ind[0]
LTA[:first] = LTA[first]
self.cf = LTA self.cf = LTA
self.xcf = x self.xcf = x