Пример #1
0
 def __sub__(self, other):
     if isinstance(other,Measurement):
         if (not self.variance is None) and hasattr(other,'variance') and not other.variance is None:
             return Measurement(*err1d.sub(self.x,self.variance,other.x,other.variance))
         else:
             return Measurement(self.x-other.x,None)
     else:
         if (not self.variance is None) and hasattr(other,'variance') and not other.variance is None:
             return Measurement(self.x-other.x, self.variance+0) # Force copy
         else:
             return Measurement(self.x-other, None)
Пример #2
0
 def __sub__(self, other):
     if isinstance(other, Uncertainty):
         return Uncertainty(
             *err1d.sub(self.x, self.variance, other.x, other.variance))
     else:
         return Uncertainty(self.x - other, self.variance + 0)  # Force copy
Пример #3
0
 def __sub__(self, other):
     if isinstance(other,Measurement):
         return Measurement(*err1d.sub(self.x,self.variance,other.x,other.variance))
     else:
         return Measurement(self.x-other, self.variance+0) # Force copy
Пример #4
0
 def __sub__(self, other):
     if isinstance(other,Uncertainty):
         return Uncertainty(*err1d.sub(self.x,self.variance,other.x,other.variance))
     else:
         return Uncertainty(self.x-other, self.variance+0) # Force copy
Пример #5
0
 def __sub__(self, other):
     if isinstance(other, Measurement):
         return Measurement(
             *err1d.sub(self.x, self.variance, other.x, other.variance))
     else:
         return Measurement(self.x - other, self.variance + 0)  # Force copy