B
    d                 @   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 )u@  
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://vizier.u-strasbg.fr/vizier/doc/catstd-3.2.htx>`_ format and the `complete
set of supported units <https://vizier.u-strasbg.fr/viz-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   sx  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 |jUddg|jYdtVd |jUdg|jZdtVd |jUdg|tVddʍ d S )N       )core)units)sic             S   s   g | ]\}}}|||fqS  r   ).0shortlongfactorr   r   ^/work/yifan.wang/ringdown/master-ringdown-env/lib/python3.7/site-packages/astropy/units/cds.py
<listcomp>+   s    z&_initialize_module.<locals>.<listcomp>AZAmpereayearPa0zBohr radius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pcalgbٽ@ZcaloriecdZcandelactcountDzDebye (dipole)z
Julian daydeg   °degreedynZdyneezelectron chargemeps0zelectric constantergeVzelectron voltFZFaradGzGravitation constantgZgramgaussZGaussZgeoMassZMgeoz
Earth massHZHenryhhour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mole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pixel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ssecsecondsrZ	steradianSunz
solar unitTZTeslatg     @@zmetric tonneuzatomic massdaVZVoltWZWattWbZWeberyr   )prefixes	namespacedocZexclude_prefixesu   µaszmicrosecond of arc)rg   rf   Zmaszmillisecond of arcz----zdimensionless and unscaled%percentZCrabzCrab (X-ray) flux)re   rf   rg   )[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   r8   r"   r#   r%   r   r(   r)   r*   r,   r-   r.   r/   r0   r1   ZM_earthr3   r4   r7   r+   ZM_jupr:   r;   Zk_Br=   r>   r?   r@   rA   Zm_erD   rL   rE   Zm_prG   rH   rI   rJ   rK   rM   rN   ZUnitrO   rP   rR   rS   ZR_earthZR_juprT   rU   rV   rW   rZ   r[   r\   Zkgr^   r`   ra   rb   lenZdef_unit_nsZmicroarcsecondZmilliarcsecondZdimensionless_unscaledrj   )npr   r^   Z_sire   mappingentrynamesunitrg   excludesr   r   r   _initialize_module   s    





ru   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   rw   inspect	getmoduleenable)rw   rx   r   r   r   rz      s    rz   )__doc__globalsrn   ru   utilsrv   Z_generate_unit_summaryrz   r   r   r   r   <module>   s    