From 97a90d52e024e7d39273330ad37bc6baf413ff64 Mon Sep 17 00:00:00 2001
From: Jeremy Fee <jmfee@usgs.gov>
Date: Thu, 11 Feb 2016 11:38:51 -0700
Subject: [PATCH] Set b0 to 0 and s0 to list of 0s by default

---
 geomagio/algorithm/SqDistAlgorithm.py | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/geomagio/algorithm/SqDistAlgorithm.py b/geomagio/algorithm/SqDistAlgorithm.py
index ead49dab2..dff2ebd81 100644
--- a/geomagio/algorithm/SqDistAlgorithm.py
+++ b/geomagio/algorithm/SqDistAlgorithm.py
@@ -330,8 +330,7 @@ class SqDistAlgorithm(Algorithm):
                 raise AlgorithmException("l0 must be a scalar")
 
         if b0 is None:
-            b = (np.nanmean(yobs[m:2 * m]) - np.nanmean(yobs[0:m])) / m
-            b = 0 if np.isnan(b) else b  # replace NaN with 0
+            b = 0
         else:
             b = b0
             if not np.isscalar(b0):
@@ -345,8 +344,7 @@ class SqDistAlgorithm(Algorithm):
                 raise AlgorithmException("yhat0 must have length %d" % hstep)
 
         if s0 is None:
-            s = [yobs[i] - l for i in range(m)]
-            s = [i if ~np.isnan(i) else 0 for i in s]  # replace NaNs with 0s
+            s = [0 for i in range(m)]
         else:
             s = list(s0)
             if len(s) != m:
-- 
GitLab