
˽Xc           @` s  d  Z  d d l m Z m Z m Z d d l Z d d l m Z	 d d l
 Z e j Z d e j d  d Z 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 d Z  d Z! d Z" dp Z# dq Z$ dr Z% ds Z& dt Z' du Z( dv Z) dw Z* e	 d#  Z+ Z, d$ e Z- d e- e+ e+ Z. e	 d%  Z/ Z0 e/ d e Z1 e	 d&  Z2 Z3 e	 d'  Z4 e	 d(  Z5 Z6 e	 d)  Z7 Z8 e	 d*  Z9 Z: e	 d+  Z; Z< e	 d,  Z= Z> e	 d-  Z? Z@ e	 d.  ZA e	 d/  ZB d ZC d ZD d0 ZE d1 eE ZF ZG eG d2 ZH ZI d3 eG ZJ d4 eG ZK d5 eG ZL d6 eE ZM d7 eM ZN d8 ZO e	 d9  ZP ZQ e	 d:  ZR ZS e	 d;  ZT ZU e	 d<  ZV ZW ZX e d= ZY eY d  ZZ Z[ eZ d  Z\ Z] d> Z^ d  e^ Z_ d? e_ Z` d@ e` Za dA e` Zb dB e` Zc dC Zd d7 ed Ze dD ee Zf dE ef Zg ed dF Zh ed dG Zi Zj dx Zk dJ ek Zl dK Zm d Zn dL Zo d Zp dM Zq Zr ec e+ Zs eq e\ Zt e	 dN  Zu Zv dO Zw eu dP Zx Zy eG e4 ed ed Zz dQ Z{ dR ee d Z| d Z} Z~ dS ed dD Z Z e dT Z Z dU e Z Z dV Z e dW Z d e_ Z eg e_ Z dX Z Z em e_ Z dY Z dy Z e6 Z Z d[ Z Z d\ Z d] Z eG e e eC Z eG e e eC Z Z d e Z d^ ee eG e4 Z Z d_ Z Z eG e4 Z Z e4 Z Z d`   Z e j da db  dc    Z e j da dd  de    Z e j da df  dg    Z e j da dh  di    Z e j da dj  dk    Z e j da dl  dm    Z dn   Z do   Z d S(z   s  
Collection of physical constants and conversion factors.

Most constants are in SI units, so you can do
print '10 mile per minute is', 10*mile/minute, 'm/s or', 10*mile/(minute*knot), 'knots'

The list is not meant to be comprehensive, but just a convenient list for everyday use.
i    (   t   divisiont   print_functiont   absolute_importNi   (   t   valuei   i   gyCxDgPKDg NgmCg  4&kCg   mBg    eAg    .Ag     @@g      Y@g      $@g?g{Gz?gMbP?gư>g&.>g-q=gV瞯<gC]r2<gO
;i
   i   i   i(   i2   i<   iF   iP   s   speed of light in vacuumgHך>s   Planck constants!   Newtonian constant of gravitations    standard acceleration of gravitys   elementary charges   molar gas constants   fine-structure constants   Avogadro constants   Boltzmann constants   Stefan-Boltzmann constants)   Wien wavelength displacement law constants   Rydberg constantg̔?iX  i   i   i  i  i  i   g-C6*?s   electron masss   proton masss   neutron masss   atomic mass constanti   g      N@i   i   im  g     v@g
F%u?i   i  i  iH   g     @ia  i  g     @g|=g 1-]jABs   standard atmosphereg     j@i  g     @i(  i   i   i*   gr?i   g     Hu@gfffffq@g?g#~j@g:H@gHz>i&  gh㈵>c         C` sX  | j    d k r( t j |   t } n | j    d k rL t j |   } np | j    d k r t j |   d d d	 t } n< | j    d k r t j |   d d	 } n t d |   | j    d k r | t } ny | j    d k r | } n^ | j    d k r!| t d	 d d } n3 | j    d k rD| d	 d } n t d |   | S(   sA  
    Convert from a temperature scale to another one among Celsius, Kelvin,
    Fahrenheit and Rankine scales.

    Parameters
    ----------
    val : array_like
        Value(s) of the temperature(s) to be converted expressed in the
        original scale.

    old_scale: str
        Specifies as a string the original scale from which the temperature
        value(s) will be converted. Supported scales are Celsius ('Celsius',
        'celsius', 'C' or 'c'), Kelvin ('Kelvin', 'kelvin', 'K', 'k'),
        Fahrenheit ('Fahrenheit', 'fahrenheit', 'F' or 'f') and Rankine
        ('Rankine', 'rankine', 'R', 'r').

    new_scale: str
        Specifies as a string the new scale to which the temperature
        value(s) will be converted. Supported scales are Celsius ('Celsius',
        'celsius', 'C' or 'c'), Kelvin ('Kelvin', 'kelvin', 'K', 'k'),
        Fahrenheit ('Fahrenheit', 'fahrenheit', 'F' or 'f') and Rankine
        ('Rankine', 'rankine', 'R', 'r').

    Returns
    -------
    res : float or array of floats
        Value(s) of the converted temperature(s) expressed in the new scale.

    Notes
    -----
    .. versionadded:: 0.18.0

    Examples
    --------
    >>> from scipy.constants import convert_temperature
    >>> convert_temperature(np.array([-40, 40.0]), 'Celsius', 'Kelvin')
    array([ 233.15,  313.15])

    t   celsiust   ct   kelvint   kt
   fahrenheitt   fg      @@g      @g      "@t   rankinet   rsU   %s scale is unsupported: supported scales are Celsius, Kelvin, Fahrenheit and Rankines_   '%s' scale is unsupported: supported scales are 'Celsius', 'Kelvin', 'Fahrenheit' and 'Rankine'(   R   R   (   R   R   (   R   R	   (   R
   R   (   R   R   (   R   R   (   R   R	   (   R
   R   (   t   lowert   _npt
   asanyarrayt   zero_Celsiust   NotImplementedError(   t   valt	   old_scalet	   new_scalet   tempot   res(    (    s8   /tmp/pip-build-7oUkmx/scipy/scipy/constants/constants.pyt   convert_temperature   s*    *"
	
t   messages   scipy.constants.C2K is deprecated in scipy 0.18.0. Use scipy.constants.convert_temperature instead. Note that the new function has a different signature.c         C` s   t  j |   t S(   sQ  
    Convert Celsius to Kelvin

    Parameters
    ----------
    C : array_like
        Celsius temperature(s) to be converted.

    Returns
    -------
    K : float or array of floats
        Equivalent Kelvin temperature(s).

    See also
    --------
    convert_temperature

    Notes
    -----
    Computes ``K = C + zero_Celsius`` where `zero_Celsius` = 273.15, i.e.,
    (the absolute value of) temperature "absolute zero" as measured in Celsius.

    Examples
    --------
    >>> from scipy.constants import C2K
    >>> C2K(np.array([-40, 40.0]))
    array([ 233.15,  313.15])

    (   R   R   R   (   t   C(    (    s8   /tmp/pip-build-7oUkmx/scipy/scipy/constants/constants.pyt   C2K   s    !s   scipy.constants.K2C is deprecated in scipy 0.18.0. Use scipy.constants.convert_temperature instead. Note that the new function has a different signature.c         C` s   t  j |   t S(   sP  
    Convert Kelvin to Celsius

    Parameters
    ----------
    K : array_like
        Kelvin temperature(s) to be converted.

    Returns
    -------
    C : float or array of floats
        Equivalent Celsius temperature(s).

    See also
    --------
    convert_temperature

    Notes
    -----
    Computes ``C = K - zero_Celsius`` where `zero_Celsius` = 273.15, i.e.,
    (the absolute value of) temperature "absolute zero" as measured in Celsius.

    Examples
    --------
    >>> from scipy.constants import K2C
    >>> K2C(np.array([233.15, 313.15]))
    array([-40.,  40.])

    (   R   R   R   (   t   K(    (    s8   /tmp/pip-build-7oUkmx/scipy/scipy/constants/constants.pyt   K2C  s    !s   scipy.constants.F2C is deprecated in scipy 0.18.0. Use scipy.constants.convert_temperature instead. Note that the new function has a different signature.c         C` s   t  j |   d d S(   s  
    Convert Fahrenheit to Celsius

    Parameters
    ----------
    F : array_like
        Fahrenheit temperature(s) to be converted.

    Returns
    -------
    C : float or array of floats
        Equivalent Celsius temperature(s).

    See also
    --------
    convert_temperature

    Notes
    -----
    Computes ``C = (F - 32) / 1.8``.

    Examples
    --------
    >>> from scipy.constants import F2C
    >>> F2C(np.array([-40, 40.0]))
    array([-40.        ,   4.44444444])

    i    g?(   R   R   (   t   F(    (    s8   /tmp/pip-build-7oUkmx/scipy/scipy/constants/constants.pyt   F2C?  s     s   scipy.constants.C2F is deprecated in scipy 0.18.0. Use scipy.constants.convert_temperature instead. Note that the new function has a different signature.c         C` s   d t  j |   d S(   s  
    Convert Celsius to Fahrenheit

    Parameters
    ----------
    C : array_like
        Celsius temperature(s) to be converted.

    Returns
    -------
    F : float or array of floats
        Equivalent Fahrenheit temperature(s).

    See also
    --------
    convert_temperature

    Notes
    -----
    Computes ``F = 1.8 * C + 32``.

    Examples
    --------
    >>> from scipy.constants import C2F
    >>> C2F(np.array([-40, 40.0]))
    array([ -40.,  104.])

    g?i    (   R   R   (   R   (    (    s8   /tmp/pip-build-7oUkmx/scipy/scipy/constants/constants.pyt   C2Fb  s     s   scipy.constants.F2K is deprecated in scipy 0.18.0. Use scipy.constants.convert_temperature instead. Note that the new function has a different signature.c         C` s   t  t t j |     S(   se  
    Convert Fahrenheit to Kelvin

    Parameters
    ----------
    F : array_like
        Fahrenheit temperature(s) to be converted.

    Returns
    -------
    K : float or array of floats
        Equivalent Kelvin temperature(s).

    See also
    --------
    convert_temperature

    Notes
    -----
    Computes ``K = (F - 32)/1.8 + zero_Celsius`` where `zero_Celsius` =
    273.15, i.e., (the absolute value of) temperature "absolute zero" as
    measured in Celsius.

    Examples
    --------
    >>> from scipy.constants import F2K
    >>> F2K(np.array([-40, 104]))
    array([ 233.15,  313.15])

    (   R   R   R   R   (   R   (    (    s8   /tmp/pip-build-7oUkmx/scipy/scipy/constants/constants.pyt   F2K  s    "s   scipy.constants.K2F is deprecated in scipy 0.18.0. Use scipy.constants.convert_temperature instead. Note that the new function has a different signature.c         C` s   t  t t j |     S(   sj  
    Convert Kelvin to Fahrenheit

    Parameters
    ----------
    K : array_like
        Kelvin temperature(s) to be converted.

    Returns
    -------
    F : float or array of floats
        Equivalent Fahrenheit temperature(s).

    See also
    --------
    convert_temperature

    Notes
    -----
    Computes ``F = 1.8 * (K - zero_Celsius) + 32`` where `zero_Celsius` =
    273.15, i.e., (the absolute value of) temperature "absolute zero" as
    measured in Celsius.

    Examples
    --------
    >>> from scipy.constants import K2F
    >>> K2F(np.array([233.15,  313.15]))
    array([ -40.,  104.])

    (   R   R   R   R   (   R   (    (    s8   /tmp/pip-build-7oUkmx/scipy/scipy/constants/constants.pyt   K2F  s    "c         C` s   t  j t  |  S(   s1  
    Convert wavelength to optical frequency

    Parameters
    ----------
    lambda_ : array_like
        Wavelength(s) to be converted.

    Returns
    -------
    nu : float or array of floats
        Equivalent optical frequency.

    Notes
    -----
    Computes ``nu = c / lambda`` where c = 299792458.0, i.e., the
    (vacuum) speed of light in meters/second.

    Examples
    --------
    >>> from scipy.constants import lambda2nu, speed_of_light
    >>> lambda2nu(np.array((1, speed_of_light)))
    array([  2.99792458e+08,   1.00000000e+00])

    (   R   R   R   (   t   lambda_(    (    s8   /tmp/pip-build-7oUkmx/scipy/scipy/constants/constants.pyt	   lambda2nu  s    c         C` s   t  t j |   S(   s1  
    Convert optical frequency to wavelength.

    Parameters
    ----------
    nu : array_like
        Optical frequency to be converted.

    Returns
    -------
    lambda : float or array of floats
        Equivalent wavelength(s).

    Notes
    -----
    Computes ``lambda = c / nu`` where c = 299792458.0, i.e., the
    (vacuum) speed of light in meters/second.

    Examples
    --------
    >>> from scipy.constants import nu2lambda, speed_of_light
    >>> nu2lambda(np.array((1, speed_of_light)))
    array([  2.99792458e+08,   1.00000000e+00])

    (   R   R   R   (   t   nu(    (    s8   /tmp/pip-build-7oUkmx/scipy/scipy/constants/constants.pyt	   nu2lambda  s    i   i   i   @I       I       I       l            l               g;pjځ?grq?(   t   __doc__t
   __future__R    R   R   t   matht   _matht   codataR   t   _cdt   numpyR   t   pit   sqrtt   goldent   golden_ratiot   yottat   zettat   exat   petat   terat   gigat   megat   kilot   hectot   dekat   decit   centit   millit   microt   nanot   picot   femtot   attot   zeptot   kibit   mebit   gibit   tebit   pebit   exbit   zebit   yobiR   t   speed_of_lightt   mu_0t	   epsilon_0t   ht   Planckt   hbart   Gt   gravitational_constantt   gt   et   elementary_charget   Rt   gas_constantt   alphat   fine_structuret   N_At   AvogadroR   t	   Boltzmannt   sigmat   Stefan_Boltzmannt   Wient   Rydbergt   gramt
   metric_tont   graint   lbt   poundt   ozt   ouncet   stonet   long_tont	   short_tont
   troy_ouncet
   troy_poundt   caratt   m_et   electron_masst   m_pt   proton_masst   m_nt   neutron_masst   m_ut   ut   atomic_masst   degreet   arcmint	   arcminutet   arcsect	   arcsecondt   minutet   hourt   dayt   weekt   yeart   Julian_yeart   incht   foott   yardt   milet   milt   ptt   pointt   survey_foott   survey_milet   nautical_milet   fermit   angstromt   micront   aut   astronomical_unitt
   light_yeart   parsect   atmt
   atmospheret   bart   torrt   mmHgt   psit   hectaret   acret   litret   litert   gallont	   gallon_USt   fluid_ouncet   fluid_ounce_USt   bblt   barrelt
   gallon_impt   fluid_ounce_impt   kmht   mpht   macht   speed_of_soundt   knotR   t   degree_Fahrenheitt   eVt   electron_voltt   caloriet
   calorie_tht
   calorie_ITt   ergt   Btu_tht   Btut   Btu_ITt   ton_TNTt   hpt
   horsepowert   dynt   dynet   lbft   pound_forcet   kgft   kilogram_forceR   t	   deprecateR   R   R   R   R   R    R"   R$   (    (    (    s8   /tmp/pip-build-7oUkmx/scipy/scipy/constants/constants.pyt   <module>   s   	






























	G$$##%(	