diff --git a/pyerrors/correlators.py b/pyerrors/correlators.py index 0b2a61ad..ced8cefe 100644 --- a/pyerrors/correlators.py +++ b/pyerrors/correlators.py @@ -1,7 +1,9 @@ import numpy as np import autograd.numpy as anp +#from scipy.special.orthogonal import _IntegerType from .pyerrors import * from .fits import standard_fit +from .linalg import * from .roots import find_root from matplotlib import pyplot as plt from matplotlib.ticker import NullFormatter # useful for `logit` scale @@ -22,7 +24,7 @@ class Corr: """ - def __init__(self, data_input, padding_front=0, padding_back=0): + def __init__(self, data_input, padding_front=0, padding_back=0,prange=None): #All data_input should be a list of things at different timeslices. This needs to be verified if not (isinstance(data_input, list)): @@ -56,6 +58,12 @@ class Corr: self.T = len(self.content) #for convenience: will be used a lot + #The attribute "range" [start,end] marks a range of two timeslices. + #This is useful for keeping track of plateaus and fitranges. + #The range can be inherited from other Corrs, if the operation should not alter a chosen range eg. multiplication with a constant. + if not range is None: + self.prange=prange + self.gamma_method() @@ -98,6 +106,8 @@ class Corr: newcontent = [None if (item is None) else np.asarray([vector_l.T@item@vector_r]) for item in self.content] return Corr(newcontent) + def sum(self): + return np.sqrt(self.N)*self.projected(np.ones(self.N)) #For purposes of debugging and verification, one might want to see a single smearing level. smearing will return a Corr at the specified i,j. where both are integers 0<=i,j