;ò
‡Rã?c           @   sÃ  d  Z  d k Z d k Z d k Z d k l Z d f  d „  ƒ  YZ d f  d „  ƒ  YZ d „  Z d „  Z	 d	 „  Z
 d
 „  Z d „  Z d d d d d d d d d g	 Z d e d d d d d d d d d d d g	 ƒ f d e d d d d d d d d d d d g	 ƒ f d e d d d d d d d d d d d g	 ƒ f d e d d d d d d d d d d d g	 ƒ f d e d d d d d d d d d d d g	 ƒ f d e d d d d d d d d d d d g	 ƒ f d e d d d d d d d d d d d g	 ƒ f d e d d d d d d d d d d d g	 ƒ f d e d d d d d d d d d d d g	 ƒ f g	 Z d d f d d f d d f d  d! f d" d# f d$ d% f d& d' f d( d) f d* d+ f d, d- f d. d/ f d0 d1 f d d f d2 d3 f d4 d5 f d6 d7 f d8 d9 f d: d; f d< d= f d> d? f g Z h  Z x  e D] Z e d e e d <qWd@ „  Z dA „  Z e d d d d d d d d d d d g	 ƒ e d <e dB dC ƒ e dD dE ƒ e dF dG ƒ e dH dI ƒ e dJ dK ƒ e dL dM ƒ e dN dO ƒ e dP dQ ƒ e dR dS ƒ e dT dU ƒ e dV dW ƒ e d" dX ƒ e dY dZ ƒ e d[ d\ ƒ e d] d^ ƒ e d_ dC ƒ e d` da ƒ e db da ƒ e d =x e i ƒ  D] Z e e ƒ q|We i e dc <e d0 dd ƒ e de df ƒ e dg dh ƒ e di dj ƒ e dk dl ƒ e dm dn ƒ e do dp ƒ e dq dr ƒ e ds dt ƒ e du dv ƒ e d( dw ƒ e dx dy ƒ e d* dz ƒ e d. d{ ƒ e d| d} ƒ e d~ d ƒ e d€ d� ƒ e d‚ dƒ ƒ e d„ d… ƒ e d† d‡ ƒ e dˆ d‰ ƒ e dŠ d‹ ƒ e dŒ d� ƒ e dŽ d� ƒ e d� d‘ ƒ e d’ d“ ƒ e d” d• ƒ e d– d— ƒ e d˜ d™ ƒ e dš d› ƒ e dœ d� ƒ e dž dŸ ƒ e d  d¡ ƒ e d¢ d£ ƒ e d¤ d¥ ƒ e d¦ d§ ƒ e d¨ d© ƒ e dª d« ƒ e d¬ d­ ƒ e d® d¯ ƒ e d° d± ƒ e d² d³ ƒ e d´ dµ ƒ e d¶ d· ƒ e d¸ d¹ ƒ e dº d» ƒ e dº ƒ e d¼ d½ ƒ e d¾ d¿ ƒ e dÀ dÁ ƒ e dÂ dÃ ƒ e dÄ dÅ ƒ e dÆ dÇ ƒ e dÈ dÉ ƒ e dÊ dË ƒ e dÌ dÍ ƒ e dÎ dÏ ƒ e dÐ dÑ ƒ e dÒ dÓ ƒ e dÔ dÕ ƒ e dÖ d× ƒ e
 d ƒ Z e dØ dÙ ƒ e dÚ e e d e i dÛ ƒ ƒ e dÜ e e dÝ dÞ e i dß ƒ ƒ [ e dà j o¡ dá k Te d- d ƒ Z e d- dâ ƒ Z e e GHe dã d ƒ Z e i d. d* dx d ƒ GHe Z e dä ƒ Z e i  då ƒ e GHe i! ƒ  GHe dæ ƒ Z" e" i dÜ ƒ GHn d S(ç   s  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!
N(   s
   NumberDicts   PhysicalQuantityc           B   s
  t  Z d  Z d „  Z e i d ƒ Z d „  Z d „  Z d „  Z	 d „  Z
 e
 Z d „  Z d „  Z d	 „  Z d
 „  Z e Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z  RS(   s¢  Physical quantity with units

    Constructor:

    - PhysicalQuantity(|value|, |unit|), where |value| is a number of
      arbitrary type and |unit| is a string containing the unit name.

    - PhysicalQuantity(|string|), where |string| contains both the value
      and the unit. This form is provided to make interactive use more
      convenient.

    PhysicalQuantity instances allow addition, subtraction,
    multiplication, and division with each other as well as
    multiplication, division, and exponentiation with numbers.
    Addition and subtraction check that the units of the two operands
    are compatible and return the result in the units of the first
    operand. A limited set of mathematical functions (from module
    Numeric) is applicable as well:

    sqrt -- equivalent to exponentiation with 0.5.

    sin, cos, tan -- applicable only to objects whose unit is compatible
	             with 'rad'.
    c         G   s·   t  | ƒ d j o$ | d |  _ t | d ƒ |  _ n} t i | d ƒ } t	 i
 i | ƒ } | t j o t d ‚ n t i | i d ƒ ƒ |  _ t | t  | i d ƒ ƒ ƒ |  _ d  S(   Ni   i    i   s   No number found(   s   lens   argss   selfs   values	   _findUnits   units   strings   strips   ss   PhysicalQuantitys   _numbers   matchs   Nones	   TypeErrors   atofs   group(   s   selfs   argss   ss   match(    (    sP   /mit/python/lib/python2.3/site-packages/Scientific/Physics/PhysicalQuantities.pys   __init__@   s    s(   [+-]?[0-9]+(\.[0-9]*)?([eE][+-]?[0-9]+)?c         C   s"   t  |  i ƒ d |  i i ƒ  Sd  S(   Ns    (   s   strs   selfs   values   units   name(   s   self(    (    sP   /mit/python/lib/python2.3/site-packages/Scientific/Physics/PhysicalQuantities.pys   __str__N   s    c         C   s0   |  i i d |  i d |  i i ƒ  d Sd  S(   Ns   (s   ,s   )(   s   selfs	   __class__s   __name__s   values   units   name(   s   self(    (    sP   /mit/python/lib/python2.3/site-packages/Scientific/Physics/PhysicalQuantities.pys   __repr__Q   s    c         C   s]   t  | ƒ o t d ‚ n | |  i | | i | i i |  i ƒ } |  i
 | |  i ƒ Sd  S(   Ns   Incompatible types(   s   isPhysicalQuantitys   others	   TypeErrors   sign1s   selfs   values   sign2s   units   conversionFactorTos	   new_values	   __class__(   s   selfs   others   sign1s   sign2s	   new_value(    (    sP   /mit/python/lib/python2.3/site-packages/Scientific/Physics/PhysicalQuantities.pys   _sumU   s    +c         C   s   |  i | d d ƒ Sd  S(   Ni   (   s   selfs   _sums   other(   s   selfs   other(    (    sP   /mit/python/lib/python2.3/site-packages/Scientific/Physics/PhysicalQuantities.pys   __add__\   s    c         C   s   |  i | d d ƒ Sd  S(   Ni   iÿÿÿÿ(   s   selfs   _sums   other(   s   selfs   other(    (    sP   /mit/python/lib/python2.3/site-packages/Scientific/Physics/PhysicalQuantities.pys   __sub__a   s    c         C   s   |  i | d d ƒ Sd  S(   Niÿÿÿÿi   (   s   selfs   _sums   other(   s   selfs   other(    (    sP   /mit/python/lib/python2.3/site-packages/Scientific/Physics/PhysicalQuantities.pys   __rsub__d   s    c         C   s)   |  i | d d ƒ } t | i d ƒ Sd  S(   Ni   iÿÿÿÿi    (   s   selfs   _sums   others   diffs   cmps   value(   s   selfs   others   diff(    (    sP   /mit/python/lib/python2.3/site-packages/Scientific/Physics/PhysicalQuantities.pys   __cmp__g   s    c         C   s|   t  | ƒ o |  i |  i | |  i ƒ Sn |  i | i } |  i | i } | i ƒ  o | | i Sn |  i | | ƒ Sd  S(   N(   s   isPhysicalQuantitys   others   selfs	   __class__s   values   units   isDimensionlesss   factor(   s   selfs   others   units   value(    (    sP   /mit/python/lib/python2.3/site-packages/Scientific/Physics/PhysicalQuantities.pys   __mul__k   s    c         C   s|   t  | ƒ o |  i |  i | |  i ƒ Sn |  i | i } |  i | i } | i ƒ  o | | i Sn |  i | | ƒ Sd  S(   N(   s   isPhysicalQuantitys   others   selfs	   __class__s   values   units   isDimensionlesss   factor(   s   selfs   others   units   value(    (    sP   /mit/python/lib/python2.3/site-packages/Scientific/Physics/PhysicalQuantities.pys   __div__w   s    c         C   s…   t  | ƒ o' |  i | |  i t |  i d ƒ ƒ Sn | i |  i } | i |  i } | i ƒ  o | | i Sn |  i | | ƒ Sd  S(   Niÿÿÿÿ(	   s   isPhysicalQuantitys   others   selfs	   __class__s   values   pows   units   isDimensionlesss   factor(   s   selfs   others   values   unit(    (    sP   /mit/python/lib/python2.3/site-packages/Scientific/Physics/PhysicalQuantities.pys   __rdiv__�   s    'c         C   sF   t  | ƒ o t d ‚ n |  i t |  i | ƒ t |  i | ƒ ƒ Sd  S(   Ns   Exponents must be dimensionless(   s   isPhysicalQuantitys   others	   TypeErrors   selfs	   __class__s   pows   values   unit(   s   selfs   other(    (    sP   /mit/python/lib/python2.3/site-packages/Scientific/Physics/PhysicalQuantities.pys   __pow__‹   s    c         C   s   t  d ‚ d  S(   Ns   Exponents must be dimensionless(   s	   TypeError(   s   selfs   other(    (    sP   /mit/python/lib/python2.3/site-packages/Scientific/Physics/PhysicalQuantities.pys   __rpow__�   s    c         C   s    |  i t |  i ƒ |  i ƒ Sd  S(   N(   s   selfs	   __class__s   abss   values   unit(   s   self(    (    sP   /mit/python/lib/python2.3/site-packages/Scientific/Physics/PhysicalQuantities.pys   __abs__“   s    c         C   s   |  Sd  S(   N(   s   self(   s   self(    (    sP   /mit/python/lib/python2.3/site-packages/Scientific/Physics/PhysicalQuantities.pys   __pos__–   s    c         C   s   |  i |  i |  i ƒ Sd  S(   N(   s   selfs	   __class__s   values   unit(   s   self(    (    sP   /mit/python/lib/python2.3/site-packages/Scientific/Physics/PhysicalQuantities.pys   __neg__™   s    c         C   s   |  i d j Sd  S(   Ni    (   s   selfs   value(   s   self(    (    sP   /mit/python/lib/python2.3/site-packages/Scientific/Physics/PhysicalQuantities.pys   __nonzero__œ   s    c         C   s4   t  | ƒ } t |  i |  i | ƒ |  _ | |  _ d S(   sè   Changes the unit to |unit| and adjusts the value such that
        the combination is equivalent. The new unit is by a string containing
        its name. The new unit must be compatible with the previous unit
        of the object.N(   s	   _findUnits   units   _convertValues   selfs   value(   s   selfs   unit(    (    sP   /mit/python/lib/python2.3/site-packages/Scientific/Physics/PhysicalQuantities.pys   convertToUnitŸ   s     c         G   s  t  t | ƒ } t | ƒ d j o6 | d } t |  i |  i | ƒ } |  i | | ƒ Sn¿ | i	 ƒ  g  } |  i } |  i } x� t t | ƒ d d d ƒ D]q } | | i | | ƒ } | d j o
 | } n t | ƒ } | i |  i | | | ƒ ƒ | | } | | } q— Wt | ƒ Sd S(   sû  Returns one or more PhysicalQuantity objects that express
        the same physical quantity in different units. The units are
        specified by strings containing their names. The units must be
        compatible with the unit of the object. If one unit is
        specified, the return value is a single PhysicalObject. If
        several units are specified, the return value is a tuple of
        PhysicalObject instances with with one element per unit such
        that the sum of all quantities in the tuple equals the the
        original quantity and all the values except for the last one
        are integers. This is used to convert to irregular unit
        systems like hour/minute/second. The original object will not
        be changed.
        i   i    iÿÿÿÿN(   s   maps	   _findUnits   unitss   lens   units   _convertValues   selfs   values	   __class__s   sorts   results   ranges   is   conversionFactorTos   roundeds   _rounds   appends   tuple(   s   selfs   unitss   roundeds   is   values   units   result(    (    sP   /mit/python/lib/python2.3/site-packages/Scientific/Physics/PhysicalQuantities.pys	   inUnitsOf¨   s(     

		 

c         C   s  |  i |  i i } d } d } x· t d ƒ D]© } t	 | } |  i i
 | } | d j  o8 | d | } | d j  o | d t | ƒ } qÕ q, | d j o7 | d | } | d j o | d t | ƒ } qÕ q, q, Wt | ƒ d j o
 d	 } n | d } |  i | | | ƒ Sd  S(
   Ns    i	   i    s   /iÿÿÿÿs   **s   *i   s   1(   s   selfs   values   units   factors	   new_values   nums   denoms   xranges   is   _base_namess   powerss   powers   strs   lens	   __class__(   s   selfs   powers   is   nums   denoms	   new_values   unit(    (    sP   /mit/python/lib/python2.3/site-packages/Scientific/Physics/PhysicalQuantities.pys   inBaseUnitsÌ   s&     
 

c         C   s    t  | ƒ } |  i i | ƒ Sd  S(   N(   s	   _findUnits   units   selfs   isCompatible(   s   selfs   unit(    (    sP   /mit/python/lib/python2.3/site-packages/Scientific/Physics/PhysicalQuantities.pys   isCompatibleá   s    c         C   s   t  |  d ƒ Sd  S(   Nf0.5(   s   pows   self(   s   self(    (    sP   /mit/python/lib/python2.3/site-packages/Scientific/Physics/PhysicalQuantities.pys   sqrtå   s    c         C   sE   |  i i ƒ  o( t i |  i |  i i t d ƒ ƒ Sn
 t d ‚ d  S(   Ns   rads    Argument of sin must be an angle(	   s   selfs   units   isAngles   umaths   sins   values   conversionFactorTos   _unit_tables	   TypeError(   s   self(    (    sP   /mit/python/lib/python2.3/site-packages/Scientific/Physics/PhysicalQuantities.pys   sinè   s    (c         C   sE   |  i i ƒ  o( t i |  i |  i i t d ƒ ƒ Sn
 t d ‚ d  S(   Ns   rads    Argument of cos must be an angle(	   s   selfs   units   isAngles   umaths   coss   values   conversionFactorTos   _unit_tables	   TypeError(   s   self(    (    sP   /mit/python/lib/python2.3/site-packages/Scientific/Physics/PhysicalQuantities.pys   cosï   s    (c         C   sE   |  i i ƒ  o( t i |  i |  i i t d ƒ ƒ Sn
 t d ‚ d  S(   Ns   rads    Argument of tan must be an angle(	   s   selfs   units   isAngles   umaths   tans   values   conversionFactorTos   _unit_tables	   TypeError(   s   self(    (    sP   /mit/python/lib/python2.3/site-packages/Scientific/Physics/PhysicalQuantities.pys   tanö   s    ((!   s   __name__s
   __module__s   __doc__s   __init__s   res   compiles   _numbers   __str__s   __repr__s   _sums   __add__s   __radd__s   __sub__s   __rsub__s   __cmp__s   __mul__s   __rmul__s   __div__s   __rdiv__s   __pow__s   __rpow__s   __abs__s   __pos__s   __neg__s   __nonzero__s   convertToUnits	   inUnitsOfs   inBaseUnitss   isCompatibles   sqrts   sins   coss   tan(    (    (    sP   /mit/python/lib/python2.3/site-packages/Scientific/Physics/PhysicalQuantities.pys   PhysicalQuantity%   s:    									
	
	
									$					s   PhysicalUnitc           B   s•   t  Z d d „ Z d „  Z e Z d „  Z d „  Z e Z d „  Z d „  Z	 d „  Z
 d	 „  Z d
 „  Z d „  Z d „  Z d „  Z d „  Z d „  Z RS(   Ni    c         C   s^   t  | ƒ t  d ƒ j o t ƒ  |  _ d |  i | <n
 | |  _ | |  _ | |  _ | |  _ d  S(   Ns    i   (   s   types   namess
   NumberDicts   selfs   factors   offsets   powers(   s   selfs   namess   factors   powerss   offset(    (    sP   /mit/python/lib/python2.3/site-packages/Scientific/Physics/PhysicalQuantities.pys   __init__   s    			c         C   s   d |  i ƒ  d Sd  S(   Ns   <PhysicalUnit s   >(   s   selfs   name(   s   self(    (    sP   /mit/python/lib/python2.3/site-packages/Scientific/Physics/PhysicalQuantities.pys   __repr__
  s    c         C   s7   |  i | i j o t d ‚ n t |  i | i ƒ Sd  S(   Ns   Incompatible units(   s   selfs   powerss   others	   TypeErrors   cmps   factor(   s   selfs   other(    (    sP   /mit/python/lib/python2.3/site-packages/Scientific/Physics/PhysicalQuantities.pys   __cmp__  s    c         C   sÂ   |  i d j p t | ƒ o | i d j o t d ‚ n t | ƒ o= t |  i | i |  i | i t d „  |  i	 | i	 ƒ ƒ Sn; t |  i h  t
 | ƒ d <|  i | |  i	 |  i | ƒ Sd  S(   Ni    s*   cannot multiply units with non-zero offsetc         C   s   |  | S(   N(   s   as   b(   s   as   b(    (    sP   /mit/python/lib/python2.3/site-packages/Scientific/Physics/PhysicalQuantities.pys   <lambda>  s    i   (   s   selfs   offsets   isPhysicalUnits   others	   TypeErrors   PhysicalUnits   namess   factors   maps   powerss   str(   s   selfs   other(    (    sP   /mit/python/lib/python2.3/site-packages/Scientific/Physics/PhysicalQuantities.pys   __mul__  s    -	
c         C   s¸   |  i d j p t | ƒ o | i d j o t d ‚ n t | ƒ o= t |  i | i |  i | i t d „  |  i	 | i	 ƒ ƒ Sn1 t |  i h  t
 | ƒ d <|  i | |  i	 ƒ Sd  S(   Ni    s(   cannot divide units with non-zero offsetc         C   s   |  | S(   N(   s   as   b(   s   as   b(    (    sP   /mit/python/lib/python2.3/site-packages/Scientific/Physics/PhysicalQuantities.pys   <lambda>*  s    iÿÿÿÿ(   s   selfs   offsets   isPhysicalUnits   others	   TypeErrors   PhysicalUnits   namess   factors   maps   powerss   str(   s   selfs   other(    (    sP   /mit/python/lib/python2.3/site-packages/Scientific/Physics/PhysicalQuantities.pys   __div__$  s    -	c         C   sÄ   |  i d j p t | ƒ o | i d j o t d ‚ n t | ƒ o= t | i |  i | i |  i t d „  | i	 |  i	 ƒ ƒ Sn= t h  t
 | ƒ d <|  i | |  i t d „  |  i	 ƒ ƒ Sd  S(   Ni    s(   cannot divide units with non-zero offsetc         C   s   |  | S(   N(   s   as   b(   s   as   b(    (    sP   /mit/python/lib/python2.3/site-packages/Scientific/Physics/PhysicalQuantities.pys   <lambda>6  s    i   c         C   s   |  S(   N(   s   x(   s   x(    (    sP   /mit/python/lib/python2.3/site-packages/Scientific/Physics/PhysicalQuantities.pys   <lambda>;  s    (   s   selfs   offsets   isPhysicalUnits   others	   TypeErrors   PhysicalUnits   namess   factors   maps   powerss   str(   s   selfs   other(    (    sP   /mit/python/lib/python2.3/site-packages/Scientific/Physics/PhysicalQuantities.pys   __rdiv__0  s    -	
c         C   sØ  |  i d j o t d ‚ n t | ƒ t d ƒ j o9 t | |  i t |  i | ƒ t	 | d „ |  i
 ƒ ƒ Sn t | ƒ t d ƒ j oCd | } t t i | d ƒ ƒ } t | | ƒ d j  ot d „  t	 | d	 „ |  i
 ƒ ƒ oÓ t |  i | ƒ } t	 | d
 „ |  i
 ƒ } t d „  t	 | d	 „ |  i i ƒ  ƒ ƒ o |  i | } nZ t ƒ  } | d j o d | t | ƒ <n x, t t | ƒ ƒ D] } | | | t | <qŠWt | | | ƒ SqÇt d ‚ qËn t d ‚ d  S(   Ni    s.   cannot exponentiate units with non-zero offsetc         C   s   |  | S(   N(   s   xs   p(   s   xs   p(    (    sP   /mit/python/lib/python2.3/site-packages/Scientific/Physics/PhysicalQuantities.pys   <lambda>B  s    f0.0f1.0f0.5f1e-10c         C   s   |  o | S(   N(   s   as   b(   s   as   b(    (    sP   /mit/python/lib/python2.3/site-packages/Scientific/Physics/PhysicalQuantities.pys   <lambda>G  s    c         C   s   |  | d j S(   Ni    (   s   xs   e(   s   xs   e(    (    sP   /mit/python/lib/python2.3/site-packages/Scientific/Physics/PhysicalQuantities.pys   <lambda>H  s    c         C   s   |  | S(   N(   s   xs   p(   s   xs   p(    (    sP   /mit/python/lib/python2.3/site-packages/Scientific/Physics/PhysicalQuantities.pys   <lambda>J  s    i   s   Illegal exponents2   Only integer and inverse integer exponents allowed(   s   selfs   offsets	   TypeErrors   types   others   PhysicalUnits   namess   pows   factors   maps   powerss   inv_exps   ints   umaths   floors   roundeds   abss   reduces   fs   ps   valuess
   NumberDicts   strs   ranges   lens   is   _base_names(   s   selfs   others   roundeds   namess   inv_exps   fs   is   p(    (    sP   /mit/python/lib/python2.3/site-packages/Scientific/Physics/PhysicalQuantities.pys   __pow__=  s4    
			 c         C   s   |  i | i j o t d ‚ n |  i | i j o |  i | i j o' t d d |  i ƒ  | i ƒ  f ‚ n |  i | i Sd  S(   Ns   Incompatible unitss/   Unit conversion (%s to %s) cannot be expressed s!   as a simple multiplicative factor(   s   selfs   powerss   others	   TypeErrors   offsets   factors   name(   s   selfs   other(    (    sP   /mit/python/lib/python2.3/site-packages/Scientific/Physics/PhysicalQuantities.pys   conversionFactorToZ  s
    &'c         C   s\   |  i | i j o t d ‚ n |  i | i } |  i | i | i |  i } | | f Sd  S(   Ns   Incompatible units(   s   selfs   powerss   others	   TypeErrors   factors   offset(   s   selfs   others   factors   offset(    (    sP   /mit/python/lib/python2.3/site-packages/Scientific/Physics/PhysicalQuantities.pys   conversionTupleTod  s
    c         C   s   |  i | i j Sd  S(   N(   s   selfs   powerss   other(   s   selfs   other(    (    sP   /mit/python/lib/python2.3/site-packages/Scientific/Physics/PhysicalQuantities.pys   isCompatible{  s    c         C   s   t  d „  |  i ƒ Sd  S(   Nc         C   s   |  p | S(   N(   s   as   b(   s   as   b(    (    sP   /mit/python/lib/python2.3/site-packages/Scientific/Physics/PhysicalQuantities.pys   <lambda>  s    (   s   reduces   selfs   powers(   s   self(    (    sP   /mit/python/lib/python2.3/site-packages/Scientific/Physics/PhysicalQuantities.pys   isDimensionless~  s    c         C   s1   |  i d d j o t d „  |  i ƒ d j Sd  S(   Ni   i   c         C   s   |  | S(   N(   s   as   b(   s   as   b(    (    sP   /mit/python/lib/python2.3/site-packages/Scientific/Physics/PhysicalQuantities.pys   <lambda>ƒ  s    (   s   selfs   powerss   reduce(   s   self(    (    sP   /mit/python/lib/python2.3/site-packages/Scientific/Physics/PhysicalQuantities.pys   isAngle�  s    c         C   s   t  ƒ  |  _ d |  i | <d  S(   Ni   (   s
   NumberDicts   selfs   namess   name(   s   selfs   name(    (    sP   /mit/python/lib/python2.3/site-packages/Scientific/Physics/PhysicalQuantities.pys   setName…  s    c         C   sï   d } d } x­ |  i i ƒ  D]œ } |  i | } | d j  o8 | d | } | d j  o | d t | ƒ } q¸ q | d j o7 | d | } | d j o | d t | ƒ } q¸ q q Wt | ƒ d j o
 d } n | d } | | Sd  S(	   Ns    i    s   /iÿÿÿÿs   **s   *i   s   1(	   s   nums   denoms   selfs   namess   keyss   units   powers   strs   len(   s   selfs   powers   nums   denoms   unit(    (    sP   /mit/python/lib/python2.3/site-packages/Scientific/Physics/PhysicalQuantities.pys   name‰  s"      

(   s   __name__s
   __module__s   __init__s   __repr__s   __str__s   __cmp__s   __mul__s   __rmul__s   __div__s   __rdiv__s   __pow__s   conversionFactorTos   conversionTupleTos   isCompatibles   isDimensionlesss   isAngles   setNames   name(    (    (    sP   /mit/python/lib/python2.3/site-packages/Scientific/Physics/PhysicalQuantities.pys   PhysicalUnitþ   s    
							
					c         C   s!   t  |  d ƒ o t  |  d ƒ Sd  S(   Ns   factors   powers(   s   hasattrs   x(   s   x(    (    sP   /mit/python/lib/python2.3/site-packages/Scientific/Physics/PhysicalQuantities.pys   isPhysicalUnitŸ  s    c         C   s!   t  |  d ƒ o t  |  d ƒ Sd S(   s4   Returns 1 if |x| is an instance of PhysicalQuantity.s   values   unitN(   s   hasattrs   x(   s   x(    (    sP   /mit/python/lib/python2.3/site-packages/Scientific/Physics/PhysicalQuantities.pys   isPhysicalQuantity¢  s     c         C   s”   t  |  ƒ t  d ƒ j oN t i |  ƒ } t | t ƒ }  x- d d g D] } y t | =WqD qD XqD Wn t |  ƒ o t	 t
 |  ƒ d ‚ n |  Sd  S(   Ns    s   __builtins__s   __args__s    is not a unit(   s   types   units   strings   strips   names   evals   _unit_tables   crufts   isPhysicalUnits	   TypeErrors   str(   s   units   names   cruft(    (    sP   /mit/python/lib/python2.3/site-packages/Scientific/Physics/PhysicalQuantities.pys	   _findUnit©  s       c         C   s5   t  i |  d ƒ o t  i |  ƒ Sn t  i |  ƒ Sd  S(   Nf0.0(   s   umaths   greaters   xs   floors   ceil(   s   x(    (    sP   /mit/python/lib/python2.3/site-packages/Scientific/Physics/PhysicalQuantities.pys   _roundµ  s    c         C   s%   | i | ƒ \ } } |  | | Sd  S(   N(   s   src_units   conversionTupleTos   target_units   factors   offsets   value(   s   values   src_units   target_units   offsets   factor(    (    sP   /mit/python/lib/python2.3/site-packages/Scientific/Physics/PhysicalQuantities.pys   _convertValue¼  s    s   ms   kgs   ss   As   Ks   mols   cds   rads   srf1.0i   i    s   gf0.001s   Yf9.9999999999999998e+23s   Zf1e+21s   Ef1e+18s   Pf1000000000000000.0s   Tf1000000000000.0s   Gf1000000000.0s   Mf	1000000.0s   kf1000.0s   hf100.0s   daf10.0s   df0.10000000000000001s   cf0.01s   muf9.9999999999999995e-07s   nf1.0000000000000001e-09s   pf9.9999999999999998e-13s   ff1.0000000000000001e-15s   af1.0000000000000001e-18s   zf9.9999999999999991e-22s   yf9.9999999999999992e-25c         C   s˜   t  i |  ƒ o t d |  d ‚ n t | ƒ t d ƒ j o? t | t  ƒ } x- d d g D] } y t  | =WqZ qZ XqZ Wn | i |  ƒ | t  |  <d  S(   Ns   Unit s    already defineds    s   __builtins__s   __args__(	   s   _unit_tables   has_keys   names   KeyErrors   types   units   evals   crufts   setName(   s   names   units   cruft(    (    sP   /mit/python/lib/python2.3/site-packages/Scientific/Physics/PhysicalQuantities.pys   _addUnitë  s       c         C   s<   x5 t  D]- } | d |  } t | | d t |  ƒ q Wd  S(   Ni    i   (   s	   _prefixess   prefixs   units   names   _addUnits   _unit_table(   s   units   names   prefix(    (    sP   /mit/python/lib/python2.3/site-packages/Scientific/Physics/PhysicalQuantities.pys   _addPrefixedö  s     s   Hzs   1/ss   Ns	   m*kg/s**2s   Pas   N/m**2s   Js   N*ms   Ws   J/ss   Cs   s*As   Vs   W/As   Fs   C/Vs   ohms   V/As   Ss   A/Vs   Wbs   V*ss   Wb/m**2s   Hs   Wb/As   lms   cd*srs   lxs   lm/m**2s   Bqs   Gys   J/kgs   Svs   pis   299792458.*m/ss   mu0s   4.e-7*pi*N/A**2s   eps0s
   1/mu0/c**2s   Gravs   6.67259e-11*m**3/kg/s**2s   hplancks   6.6260755e-34*J*ss   hbars   hplanck/(2*pi)s   es   1.60217733e-19*Cs   mes   9.1093897e-31*kgs   mps   1.6726231e-27*kgs   Navs   6.0221367e23/mols   1.380658e-23*J/Ks   mins   60*ss   60*mins   24*hs   wks   7*ds   yrs   365.25*ds   inchs   2.54*cms   fts   12*inchs   yds   3*fts   mis   5280.*fts   nmis   1852.*ms   Angs   1.e-10*ms   lyrs   c*yrs   Bohrs   4*pi*eps0*hbar**2/me/e**2s   has
   10000*m**2s   acress	   mi**2/640s   bs   1.e-28*ms   ls   dm**3s   dls   0.1*ls   cls   0.01*ls   mls   0.001*ls   tsps   4.92892159375*mls   tbsps   3*tsps   flozs   2*tbsps   cups   8*flozs   pts   16*flozs   qts   2*pts   galUSs   4*qts   galUKs	   4.54609*ls   amus   1.6605402e-27*kgs   ozs   28.349523125*gs   lbs   16*ozs   tons   2000*lbs   dyns   1.e-5*Ns   ergs   1.e-7*Js   eVs   e*Vs   Hartrees    me*e**4/16/pi**2/eps0**2/hbar**2s   invcms   hplanck*c/cms   Kens   k*Ks   cals   4.184*Js   kcals   1000*cals   calis   4.1868*Js   kcalis	   1000*calis   Btus   1055.05585262*Js   hps   745.7*Ws   bars   1.e5*Pas   atms
   101325.*Pas   torrs   atm/760s   psis   6894.75729317*Pas   degs
   pi*rad/180s   degRs	   (5./9.)*Ks   degCf273.14999999999998s   degFf5.0f9.0f459.67000000000002s   __main__(   s   *s   kmf314159.0s   2.7 Hartree*Navs   kcal/mols   0 degC(#   s   __doc__s   res   strings   umaths   Scientific.NumberDicts
   NumberDicts   PhysicalQuantitys   PhysicalUnits   isPhysicalUnits   isPhysicalQuantitys	   _findUnits   _rounds   _convertValues   _base_namess   _base_unitss	   _prefixess   _unit_tables   units   _addUnits   _addPrefixeds   keyss   pis   kelvins   Nones   powerss   __name__s   ls   big_ls   ts	   inUnitsOfs   ps   es   convertToUnits   inBaseUnitss   freeze(   s   PhysicalQuantitys   freezes	   _prefixess   _unit_tables   units	   _findUnits   big_ls   res   umaths   _convertValues   _base_unitss   isPhysicalUnits   _addUnits   PhysicalUnits   strings   kelvins
   NumberDicts   _base_namess   isPhysicalQuantitys   es   _rounds   ls   ps   ts   _addPrefixed(    (    sP   /mit/python/lib/python2.3/site-packages/Scientific/Physics/PhysicalQuantities.pys   ?   sö   Ù¡					!ÿ ·º 		1 
#	