UnitPrefix#
- class astropy.units.UnitPrefix(symbols, names, factor)[source]#
Bases:
NamedTuplePrefix for representing multiples or sub-multiples of units.
- Parameters:
- symbols
tupleofstr The symbols of the prefix, to be combined with symbols of units. If multiple are specified then they will be treated as aliases.
- names
tupleofstr The names of the prefix, to be combined with names of units. If multiple are specified then they will be treated as aliases.
- factor
UnitScale The multiplicative factor represented by the prefix.
- symbols
Examples
>>> UnitPrefix(("k",), ("kilo",), 1e3) # Simple prefix UnitPrefix(symbols=('k',), names=('kilo',), factor=1000.0) >>> UnitPrefix(("da",), ("deca", "deka"), 1e1) # Multiple names UnitPrefix(symbols=('da',), names=('deca', 'deka'), factor=10.0) >>> UnitPrefix(("u", "µ"), ("micro",), 1e-6) # Multiple symbols UnitPrefix(symbols=('u', 'µ'), names=('micro',), factor=1e-06)
Create new instance of UnitPrefix(symbols, names, factor)
Attributes Summary
The multiplicative factor represented by the prefix.
The names of the prefix, to be combined with names of units.
The symbols of the prefix, to be combined with symbols of units.
Attributes Documentation
- factor#
The multiplicative factor represented by the prefix.
- names#
The names of the prefix, to be combined with names of units.
- symbols#
The symbols of the prefix, to be combined with symbols of units.