B
    q\                 @   sF   d Z e Zdd Ze  ddlmZ e dk	r:e ee 7 Z dd ZdS )u5  
This package defines units used in the CDS format, both the units
defined in `Centre de Données astronomiques de Strasbourg
<http://cds.u-strasbg.fr/>`_ `Standards for Astronomical Catalogues 2.0
<http://cds.u-strasbg.fr/doc/catstd-3.2.htx>`_ format and the `complete
set of supported units <http://vizier.u-strasbg.fr/cgi-bin/Unit>`_.
This format is used by VOTable up to version 1.2.

These units are not available in the top-level `astropy.units`
namespace.  To use these units, you must import the `astropy.units.cds`
module::

    >>> from astropy.units import cds
    >>> q = 10. * cds.lyr  # doctest: +SKIP

To include them in `~astropy.units.UnitBase.compose` and the results of
`~astropy.units.UnitBase.find_equivalent_units`, do::

    >>> from astropy.units import cds
    >>> cds.enable()  # doctest: +SKIP
c           W   C   sv  dd l } ddlm} ddlm} ddlm} |j|j }dd |D }dg|j	d	fd
g|j
ddgfdg|jdfdg|jdddgfdg|jdfdg|jdfddgddgf|jdfddg|jdfddg|jdfd g|jd!fd"d#g|jd$fd%g|jd%fd&g|jd&fd'g|jd'fd(g|jd(fd)g|jd*fdg|jd+d,gfd-gd.|j d/fd0g|jd1fd2g|jd3fd4g|jd5fdg|jd6dgfd7d8gd9gf|jd9fd:g|jd;fd<g|j d=d>gfd?g|j!d@fdAg|j"dAfdBg|j#dCfdDg|j$dEfdFg|j%dGfdHg|j&dIfdJg|j%dKfdLdMg|j'dNfdOg|j(dPfdQg|j)dRd,gfdSg|j)dRfdTg|j)dUfdVg|j*dWfdXgdY|j+ dXfdZg|jd[fd\g|jd6d]gfd^d_g|j,d`fdag|j-dbfdcg|j.ddfdeg|j/dffdgg|j0dhd
gfdig|j1djfdkdlg|j2dmfdng|j3dofd>g|j+dpfdqg|j4drfdsg|j5dtfdug|j6dvfdwg|jd6fdxgdy|j7 dzfd{g|j8d|fd}g|j9d~fddg|j:dfddgg f|j;dfdg|j<dfdg|j=dfdg|j>dfdg|j7dfdg|j?dfdg|j@dfdg|A| jBdfdg|jCdfdg|Addfdg|jDdfdg|jEdfdg|jFdfdg|jGdfddg|jHdfdg|jIdfdg|jJdfddg|jKdfdg|jLdfdg|jMdfdg|jNdfdgd|jO ddgfdg|jPddd
gfdg|jQdfdg|jRdfdg|jSdfdg|j
dfgU}xN|D ]F}tT|dkr|\}}}	g }
n|\}}}	}
|jU|||tV|	|
d qW |jUdg|jWdtVd |jUdg|jXdtVd |jUdg|jYdtVd |jUdg|jZdtVd |jUdg|tVddɍ d S )N       )core)units)sic             S   s   g | ]\}}}|||fqS  r   ).0ZshortZlongZfactorr   r   0lib/python3.7/site-packages/astropy/units/cds.py
<listcomp>+   s    z&_initialize_module.<locals>.<listcomp>AZAmpereaZyearPa0zBohr radiusZalz
Light yearcdlyralphazFine structure constantAA   ÅZAngstromZ	AngstroemZarcminZarcmzminute of arcZarcsecZarcszsecond of arcatmZ
atmosphereZAUauzastronomical unitbarbarnbitbyteCZCoulombzspeed of lightpZcalgbٽ@ZcaloriecdZcandelactcountDzDebye (dipole)z
Julian dayZdeg   °degreedynZdyneezelectron chargemeps0zelectric constantergeVzelectron voltFZFaradGzGravitation constantgZgramZgaussZGaussZgeoMassZMgeoz
Earth massHZHenryhZhourZhrz\hzPlanck constantHzZHertzZinchg
F%u?JZJouleZJDMZjovMassZMjupzJupiter massJyZJanskyKZKelvinkZ	BoltzmannlZlitrelmZlumenZLsunsolLumzsolar luminositylxZluxZmetermagZ	magnitudemezelectron massminminuteZMJDZmmHgg%iP`@zmillimeter of mercurymolZmoleZmpzproton massZMsunsolMassz
solar massmu0u   µ0zmagnetic constantmuBzBohr magnetonNZNewtonOhmPaZPascalpcZparsecphZphotonpiu   πpixZpixelZppmgư>zparts per millionRzgas constantZradradianZRgeozEarth equatorial radiusZRjupzJupiter equatorial radiusZRsunsolRadzsolar radiusRyZRydbergSZSiemenssZsecsecondsrZ	steradianSunz
solar unitTZTeslatg     @@zmetric tonneuzatomic massZdaVZVoltWZWattWbZWeberZyr   )prefixes	namespacedocZexclude_prefixesu   µaszmicrosecond of arc)rX   rW   Zmaszmillisecond of arcz---zdimensionless and unscaled%percentZCrabzCrab (X-ray) flux)rV   rW   rX   )[Znumpy r   Zastropyr   Zastropy.constantsr   Zsi_prefixesZbinary_prefixesr
   r   r   r   r   r   Z	arcminuteZ	arcsecondr   r   r   r   r   r   r   r   r.   r   r   r   r   r!   r"   r#   r%   r&   r'   r(   r)   r*   ZM_earthr+   r,   r-   r$   ZM_jupr0   r1   Zk_Br3   r4   r5   r6   r7   Zm_er:   rA   r;   Zm_pr<   r=   r>   r?   r@   rB   rC   ZUnitrD   rE   rF   rG   ZR_earthZR_juprH   rI   rJ   rK   rM   rN   rO   ZkgrQ   rR   rS   rT   lenZdef_unit_nsZmicroarcsecondZmilliarcsecondZdimensionless_unscaledrZ   )Znpr   rQ   Z_sirV   mappingentrynamesZunitrX   Zexcludesr   r   r   _initialize_module   s    





ra   r   )generate_unit_summaryNc              C   s"   ddl m}  ddl}| |tS )aq  
    Enable CDS units so they appear in results of
    `~astropy.units.UnitBase.find_equivalent_units` and
    `~astropy.units.UnitBase.compose`.  This will disable
    all of the "default" `astropy.units` units, since there
    are some namespace clashes between the two.

    This may be used with the ``with`` statement to enable CDS
    units only temporarily.
    r   )set_enabled_unitsr   N)r   rc   inspectZ	getmoduleenable)rc   rd   r   r   r   re      s    re   )__doc__globalsr]   ra   Zutilsrb   Z_generate_unit_summaryre   r   r   r   r   <module>   s    