unit_convert

sisl.unit.unit_convert(fr, to, opts=None, tbl=None)[source]

Factor that takes ‘fr’ to the units of ‘to’.

Parameters
frstr

starting unit

tostr

ending unit

optsdict, optional

controls whether the unit conversion is in powers or fractional units

tbldict, optional

dictionary of units (default to the global table)

Examples

>>> unit_convert('kg','g')
1000.0
>>> unit_convert('eV','J')
1.60217733e-19