abtem.core.units#
Module for handling units and unit conversion.
Module Contents#
Functions#
Format units as a string. |
|
Get the conversion factor between two units. |
|
Validate units and convert to a standard format. |
Data#
API#
- abtem.core.units.get_conversion_factor(...) float[source]#
Get the conversion factor between two units.
- abtem.core.units.units_type#
None
- abtem.core.units.validate_units(...) Optional[str][source]#
Validate units and convert to a standard format.
If old_units is provided, the function will check if the conversion is possible and raise an error if not.
- Parameters:
- Returns:
The validated units
- Return type:
- Raises:
ValueError – If the units are invalid or if conversion from old_units is not possible.