ubermagutil.units.si_max_multiplier#

ubermagutil.units.si_max_multiplier(values)#

Compute maximum SI multiplier for a list of values.

SI multiplier is computed for all elements of values using ubermagutil.units.si_multiplier and the largest one is returned.

Parameters:

values (list of numbers.Real) – Values for which the maximum multiplier is computed.

Returns:

Multiplier as \(10^{n}\). If multiplier cannot be found, None is returned.

Return type:

float

Examples

  1. Find a maximum multiplier.

>>> import ubermagutil.units as uu
...
>>> uu.si_max_multiplier([5e-9, 50e-9, 500e-9, 5000e-9])
1e-06
>>> uu.si_max_multiplier([500e-6, 1])
1
>>> uu.si_max_multiplier([500e-12, 1e-11])
1e-12

See also

si_multiplier