From 7dcd20198fee9c439414cc4d9c1a1e0f9d21a2c8 Mon Sep 17 00:00:00 2001 From: Ivan Usov Date: Mon, 8 Nov 2021 13:48:37 +0100 Subject: [PATCH] Do not set area_v to nan if the fit is not good For #42 --- pyzebra/ccl_process.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/pyzebra/ccl_process.py b/pyzebra/ccl_process.py index 6ab0591..9ef8cd4 100644 --- a/pyzebra/ccl_process.py +++ b/pyzebra/ccl_process.py @@ -223,12 +223,8 @@ def get_area(scan, area_method, lorentz): area_s = 0 for name, param in scan["fit"].params.items(): if "amplitude" in name: - if param.stderr is None: - area_v = np.nan - area_s = np.nan - else: - area_v += param.value - area_s += param.stderr + area_v += np.nan if param.value is None else param.value + area_s += np.nan if param.stderr is None else param.stderr else: # area_method == "int_area" y_val = scan["counts"]