added attribute sigma to zero within error, npr module improved

This commit is contained in:
Fabian Joswig 2021-10-20 13:12:58 +01:00
parent f95123bd18
commit e45f330e9d
2 changed files with 14 additions and 10 deletions

View file

@ -337,8 +337,12 @@ class Obs:
for e_name in self.e_names:
print(e_name, ':', self.e_content[e_name])
def is_zero_within_error(self):
return np.abs(self.value) <= self.dvalue
def is_zero_within_error(self, sigma=1):
""" Checks whether the observable is zero within 'sigma' standard errors.
Works only properly when the gamma method was run.
"""
return np.abs(self.value) <= sigma * self.dvalue
def is_zero(self):
return np.isclose(0.0, self.value) and all(np.allclose(0.0, delta) for delta in self.deltas.values())