fix: Corr.symmetric can now deal with None entries. (#145)

This commit is contained in:
Fabian Joswig 2023-01-16 16:10:19 +00:00 committed by GitHub
parent 26447d658c
commit 88fd37b241
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 2 deletions

View file

@ -201,8 +201,9 @@ class Corr:
if self.T % 2 != 0:
raise Exception("Can not symmetrize odd T")
if np.argmax(np.abs(self.content)) != 0:
warnings.warn("Correlator does not seem to be symmetric around x0=0.", RuntimeWarning)
if self.content[0] is not None:
if np.argmax(np.abs([o[0].value if o is not None else 0 for o in self.content])) != 0:
warnings.warn("Correlator does not seem to be symmetric around x0=0.", RuntimeWarning)
newcontent = [self.content[0]]
for t in range(1, self.T):