def __truediv__(self, other): if isinstance(other, SansData): return SansData( Measurement(*err1d.div(self.data.x, self.data.variance, other.data.x, other.data.variance)).x, deepcopy(self.metadata), q=copy(self.q), qx=copy(self.qx), qy=copy(self.qy), theta=copy(self.theta)) else: return SansData(data=Measurement(self.data.x / other, self.data.variance / other**2).x, metadata=deepcopy(self.metadata), q=copy(self.q), qx=copy(self.qx), qy=copy(self.qy), theta=copy(self.theta))
def __mul__(self, other): if isinstance(other, SansData): return SansData( Measurement(*err1d.mul(self.data.x, self.data.variance, other.data.x, other.data.variance)).x, deepcopy(self.metadata), q=copy(self.q), qx=copy(self.qx), qy=copy(self.qy), theta=copy(self.theta)) else: return SansData(data=self.data.__mul__(other).x, metadata=deepcopy(self.metadata), q=copy(self.q), qx=copy(self.qx), qy=copy(self.qy), theta=copy(self.theta))
def __init__(self, data=None, metadata=None, q=None, qx=None, qy=None, theta=None, Tsam=None, Temp=None): self.data = Measurement(data, data) self.metadata = metadata self.q = q #There are many places where q was not set, i think i fixed most, but there might be more; be wary self.qx = qx self.qy = qy self.theta = theta self.Tsam = None #Tsam and Temp are used to store the transmissions for later use self.Temp = None