From 9fc9d96d68f1fd41cf893a9f59ea698f2beaee5a Mon Sep 17 00:00:00 2001 From: "Sergey E. Koposov" Date: Mon, 4 Nov 2024 15:33:29 +0000 Subject: [PATCH] fix the mask in the CHISQ_TOT calculation --- py/rvspecfit/spec_fit.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/py/rvspecfit/spec_fit.py b/py/rvspecfit/spec_fit.py index c1a4117..aefe5a9 100644 --- a/py/rvspecfit/spec_fit.py +++ b/py/rvspecfit/spec_fit.py @@ -701,9 +701,9 @@ def get_chisq(specdata, cur_deviation = ((curmodel - curdata.spec) / curdata.espec) if curdata.badmask is not None: - cur_mask = curdata.badmask + cur_mask = ~curdata.badmask else: - cur_mask = np.zeros(len(cur_deviation), dtype=bool) + cur_mask = np.ones(len(cur_deviation), dtype=bool) cur_true_chisq = np.sum(cur_deviation[cur_mask]**2) chisq_array.append(cur_true_chisq) cur_npix = cur_mask.sum()