From 9940f1222eaf4f2c260f61a0cded33f88a69d103 Mon Sep 17 00:00:00 2001 From: Amy Stamile <astamile@usgs.gov> Date: Wed, 31 Jan 2024 15:06:47 -0700 Subject: [PATCH] Added error check --- knoten/bundle.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/knoten/bundle.py b/knoten/bundle.py index a5cfe5a..d59250a 100644 --- a/knoten/bundle.py +++ b/knoten/bundle.py @@ -475,8 +475,10 @@ def compute_sigma0(V, dX, W_parameters, W_observations): if (dof > 0): sigma0 = VTPV/dof - else: + elif (dof == 0): sigma0 = VTPV + else: + raise ValueError(f"Computed degrees of freedom [{dof}] is invalid.") return np.sqrt(sigma0) -- GitLab