aboutsummaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authortlatorre <tlatorre@uchicago.edu>2019-12-02 15:07:54 -0600
committertlatorre <tlatorre@uchicago.edu>2019-12-02 15:07:54 -0600
commitafab50a2a82daeafc96b2adecd4e7bc0a97d0f2b (patch)
tree916920f5635827bdcac11b38a8832d5b76056185 /utils
parent84131168593c4a56c5a6218c824e5fdf0af71f08 (diff)
downloadsddm-afab50a2a82daeafc96b2adecd4e7bc0a97d0f2b.tar.gz
sddm-afab50a2a82daeafc96b2adecd4e7bc0a97d0f2b.tar.bz2
sddm-afab50a2a82daeafc96b2adecd4e7bc0a97d0f2b.zip
small fix to prevent an Exception when there is only one data point
Diffstat (limited to 'utils')
-rwxr-xr-xutils/plot-fit-results2
1 files changed, 2 insertions, 0 deletions
diff --git a/utils/plot-fit-results b/utils/plot-fit-results
index 450de72..f95333f 100755
--- a/utils/plot-fit-results
+++ b/utils/plot-fit-results
@@ -133,6 +133,8 @@ def std_err(x):
n = len(x)
if n == 0:
return np.nan
+ elif n == 1:
+ return 0.0
u4 = np.mean((x-mean)**4)
error = np.sqrt((u4-(n-3)*std**4/(n-1))/n)/(2*std)
return error