threeML.io.uncertainty_formatter module

threeML.io.uncertainty_formatter.get_uncertainty_tokens(x)[source]

Split the given uncertainty in number, error and exponent.

Parameters:

x – an uncertainty instance

Returns:

number, error and exponent

threeML.io.uncertainty_formatter.interval_to_errors(value, low_bound, hi_bound)[source]

Convert error intervals to errors

Parameters:
  • value – central value

  • low_bound – interval low bound

  • hi_bound – interval high bound

Returns:

(error minus, error plus)

threeML.io.uncertainty_formatter.uncertainty_formatter(value, low_bound, hi_bound)[source]

Gets a value and its error in input, and returns the value, the uncertainty and the common exponent with the proper number of significant digits in a string like (4.2 -0.023 +5.23) x 10^5

Parameters:
  • value

  • error – a positive value

Returns:

string representation of interval