Physical units

Marc Saric marc.saric at mpi-dortmund.mpg.de
Tue Aug 31 05:25:53 EDT 1999


Will Ware schrieb:
> 
> I thought somebody else might find this useful...
> 
> #########################
> '''mks.py - physical units for calculations
> 
Uhm, isn´t that quite similar to the following???

# Physical quantities with units
#
# Written by Konrad Hinsen <hinsen at cnrs-orleans.fr>
# last revision: 1999-7-23
#

# hacked 1998/09/28 GPW: now removes __args__ from local dict after eval
#        1998/09/29 GPW: now supports conversions with offset
#                        (for temperature units)

# $Id: PhysicalQuantities.py,v 1.3.1.7 1999/01/11 21:49:36 gward Exp $

"""Physical quantities with units.

This module provides a data type that represents a physical
quantity together with its unit. It is possible to add and
subtract these quantities if the units are compatible, and
a quantity can be converted to another compatible unit.
Multiplication, subtraction, and raising to integer powers
is allowed without restriction, and the result will have
the correct unit. A quantity can be raised to a non-integer
power only if the result can be represented by integer powers
of the base units.

The values of physical constants are taken from the 1986
recommended values from CODATA. Other conversion factors
(e.g. for British units) come from various sources. I can't
guarantee for the correctness of all entries in the unit
table, so use this at your own risk!
"""

-- 
Bye,

Marc Saric

Max-Planck-Institut für molekulare Physiologie
Otto-Hahn-Strasse 11
44227 Dortmund

phone: +49 231 133 2168




More information about the Python-list mailing list