Package reflectometry :: Package reduction :: Module uncertainty

Module uncertainty

source code

Uncertainty propagation class, and log() and exp() functions.

Based on scalars or numpy vectors, this class allows you to store and manipulate values+uncertainties, with propagation of gaussian error for addition, subtraction, multiplication, division, power, exp() and log().

Storage properties are determined by the numbers used to set the value and uncertainty. Be sure to use floating point uncertainty vectors for inplace operations since numpy does not do automatic type conversion. Normal operations can use mixed integer and floating point. In place operations (a *= b, etc.) create at most one extra copy for each operation. c = a*b by contrast uses four intermediate vectors, so shouldn't be used for huge arrays.

Classes
  Uncertainty