2.3.12.2. vacumm.misc.phys.units
– Units¶
Functions: |
---|
Unit conversions
-
deg2m
(degrees, lat=None)[source]¶ Convert a distance in degrees to meters
- degrees: Distance in degrees
- lat: optional latitude, defaults to 0.
Return: Distance in meters
See also
-
m2deg
(meters, lat=None)[source]¶ Convert a distance in meters to degrees
- meters: Distance in meters
- lat: optional latitude, defaults to 0.
Return: Distance in degrees
See also
-
dms2deg
(d, m=0, s=0)[source]¶ Convert from degrees/minutes/seconds to degrees
- d: degrees
- m: minutes [default: 0]
- s: seconds [default: 0]
See also
-
tometric
(units, value=1.0, munits=['m', 'm/s'])[source]¶ Try to convert units to metric system using
udunits
Return: a float or None
if conversion failed.
-
kel2degc
(tk)[source]¶ Convert from degrees Kelvin to degrees Celsius
- tk: Temperature in Kelvin.
See also
-
degc2kel
(dc)[source]¶ Convert from degrees Celsius to degrees Kelvin
- dc: Temperature in degrees Celsius.
See also
-
convert_units
(value, oldunits, newunits)¶ Change units using unidata units connverter
-
basic_proj
(lon, lat, inverse=False)[source]¶ Convert a position from degrees to meters like a geographic projection
Params: - lon: Longitude in degrees or meters.
- lat: Latitude in degrees or meters.
- inverse, optional: Invert the projection from meters to degrees.
-
strfsize
(size, fmt=None, si=None)[source]¶ Format a size in bytes using the appropriate unit multiplicator (Ko, Mo, Kio, Mio)
Params: - size: the size in bytes
- fmt: the format to use, will receive the size and the unit as format arguments
- (None will automatically use “%.3f %s” or “%d %s”)
- si: whether to use International System units (10^3, …) or not (2**10, …)
Return: a string
-
strpsize
(size, si=True)[source]¶ Parse a size in Ko, Mo, Kio, Mio, …
Params: - size: the size string
- si: whether to use International System units (10^3, …) or not (2**10, …)
Return: the float number of bytes
-
uuconvert
(value, oldunits, newunits)[source] Change units using unidata units connverter