diff --git a/pyerrors/correlators.py b/pyerrors/correlators.py index dc5f181e..a7f16cb8 100644 --- a/pyerrors/correlators.py +++ b/pyerrors/correlators.py @@ -1,5 +1,6 @@ import numpy as np import autograd.numpy as anp +#from scipy.special.orthogonal import _IntegerType from .pyerrors import * from .fits import standard_fit from .roots import find_root @@ -22,7 +23,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,range=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 +57,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.range=range + self.gamma_method() @@ -98,6 +105,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