mirror of
https://github.com/fjosw/pyerrors.git
synced 2025-05-15 20:13:41 +02:00
zero_within_error method added, warnings added to Corr methods symmetric and
anti-symmetric
This commit is contained in:
parent
c6c02cdc57
commit
8488df00fd
3 changed files with 10 additions and 1 deletions
|
@ -129,6 +129,9 @@ class Corr:
|
|||
if self.T % 2 != 0:
|
||||
raise Exception("Can not symmetrize odd T")
|
||||
|
||||
if np.argmax(np.abs(self.content)) != 0:
|
||||
print('Warning: correlator does not seem to be symmetric around x0=0.')
|
||||
|
||||
newcontent = [self.content[0]]
|
||||
for t in range(1, self.T):
|
||||
if (self.content[t] is None) or (self.content[self.T - t] is None):
|
||||
|
@ -144,6 +147,9 @@ class Corr:
|
|||
if self.T % 2 != 0:
|
||||
raise Exception("Can not symmetrize odd T")
|
||||
|
||||
if not all([o.zero_within_error() for o in self.content[0]]):
|
||||
print('Warning: correlator does not seem to be anti-symmetric around x0=0.')
|
||||
|
||||
newcontent = [self.content[0]]
|
||||
for t in range(1, self.T):
|
||||
if (self.content[t] is None) or (self.content[self.T - t] is None):
|
||||
|
|
|
@ -340,6 +340,9 @@ class Obs:
|
|||
for e_name in self.e_names:
|
||||
print(e_name, ':', self.e_content[e_name])
|
||||
|
||||
def zero_within_error(self):
|
||||
return np.abs(self.value) <= self.dvalue
|
||||
|
||||
def plot_tauint(self, save=None):
|
||||
"""Plot integrated autocorrelation time for each ensemble."""
|
||||
if not self.e_names:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue