B
    bE              {   @   s	  d Z dZdddddddd	d
dddddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcdddedfdgdhdidjdkdldmdndodpdqdrdsdtdudvddwdwdwdwdxzZdydzd{d|d}d~dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddgwZddddddddddddddddd ddddddddd	d
dddddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdOdPdQdRdSdTdUdVdUdWdXdYdZd[d\d]d^d_d_d`dadadbdcwZdddedfdgdhdidjdkdldmdndodpdqdrdsdtdudvdwdxdydzd{d|d}d~dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddÐdĐdŐdƐdǐdȐdɐdʐdːd̐d͐dΐdϐdАdѐdҐdӐdԐdՐd֐dאdؐdِdڐdڐdڐdڐdۜzZdddedfdgdhdidjdkdldmdܐdodpdqdrdsdtdudݐdwdxdydzd{d|dސd~ddߐdddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddÐdĐdŐdƐdǐdȐdɐdʐdːd̐d͐dΐdϐdАdѐdҐdӐdԐdՐd֐dאdؐdِdڐdڐdڐdڐdۜzZdddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddzZee	 dd dZ
dd Zdd Zeedbdbdbd dS (  a}  
Contains all of the elements in the periodic table and dictionaries that
store all of the data found in the periodic table for that element, indexed
by the element's symbol. For consistency with AMBER, a fictitious element
'EP' is added to all of the arrays that is just an Extra Point, with no mass
or any other meaningful attribute. It's just a container to put an extra
charge
v                           	   
                                                                      !   "   #   $   %   &   '   (   )   *   +   ,   -   .   /   0   1   2   3   4   5   6   7   8   9   :   ;   <   =   >   ?   @   A   B   C   D   E   F   G   H   I   J   K   L   M   N   O   P   Q   R   S   T   U   V   W   X   Y   Z   [   \   ]   ^   _   `   a   b   c   d   e   f   g   h   i   j   k   l   m   n   o   p   q   r   s   t   u       )zHHeLiBeBCNOFNeNaMgAlSiPSClArKCaScTiVCrMnFeCoNiCuZnGaGeAsSeBrKrRbSrYZrNbMoTcRuRhPdAgCdInSnSbTeIXeCsBaLaCePrNdPmSmEuGdTbDyHoErTmYbLuHfTaWReOsIrPtAuHgTlPbBiPoAtRnFrRaAcThPaUNpPuAmCmBkCfEsFmMdNoLrRfDbSgBhHsMtDsRgCnNhFlMcLvTsOgEPLPLpEpr   rx   ry   rz   r{   r|   r}   r~   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   g6[ ?g@g$@g?"@gZd;%@gh"lxz(@g3ı.n,@g>W[/@gSt$2@gY .4@gec6@gGzN8@g%C:@gS<@gEJ>@gQ@@gDlA@gMbXC@g1*C@gDl	D@gcZzF@g"G@gnxI@gm4I@gMbxK@g\(K@gowM@gTXM@gSO@gV-ZP@gʡEnQ@g)\(R@g~R@g=
ףpS@g`"S@gPnT@ggDio]U@gHzU@g\C9V@guVV@gF%u:W@g\(W@g     X@gGzDY@gˡEY@g{GZ@gȘZ@gM\@g1Z\@g=
ףp]@gq=
ףp^@gfffff_@gS_@gL7A`i`@g"`@gX9v*a@g"\a@gʡEa@ga@g9vb@g      b@gQb@g+b@g     c@guc@g     Pd@g oŝd@g?5^Id@gee@gzGe@gme@gHzOf@g|a2Uf@g{Gf@gvFg@g(\g@gmh@g bh@g	ch@g{Gi@gё\Ci@gfffffi@go_j@g      j@g     @j@g     k@g     k@g     @l@g     `l@gH}8m@g&l@gW[m@g     m@g     n@g     `n@g     n@g     `o@g     o@g     p@g      p@g     0p@g     `p@g     Pp@g     p@g     p@g     Pq@g     p@g     q@g      q@g     q@g     q@g     r@g     Pr@g     `r@g        )wrx   ry   rz   r{   r|   r}   r~   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   ZHydrogenZHeliumZLithiumZ	BerylliumZBoronZCarbonZNitrogenZOxygenZFluorineZNeonZSodiumZ	MagnesiumZAluminumZSiliconZ
PhosphorusZSulfurZChlorineZArgonZ	PotassiumZCalciumZScandiumZTitaniumZVanadiumZChromiumZ	ManganeseZIronZCobaltZNickelZCopperZZincZGalliumZ	GermaniumZArsenicZSeleniumZBromineZKryptonZRubidiumZ	StrontiumZYttriumZ	ZirconiumZNiobiumZ
MolybdenumZ
TechnetiumZ	RutheniumZRhodiumZ	PalladiumZSilverZCadmiumZIndiumZTinZAntimonyZ	TelluriumZIodineZXenonZCesiumZBariumZ	LanthanumZCeriumZPraseodymiumZ	NeodymiumZ
PromethiumZSamariumZEuropiumZ
GadoliniumZTerbiumZ
DysprosiumZHolmiumZErbiumZThuliumZ	YtterbiumZLutetiumZHafniumZTantalumZTungstenZRheniumZOsmiumZIridiumZPlatinumZGoldZMercuryZThalliumZLeadZBismuthZPoloniumZAstatineZRadonZFranciumZRadiumZActiniumZThoriumZProactiniumZUraniumZ	NeptuniumZ	PlutoniumZ	AmericiumZCuriumZ	BerkeliumZCaliforniumZEinsteiniumZFermiumZMendeleviumZNobeliumZ
LawrenciumZRutherfordiumZDubniumZ
SeaborgiumZBohriumZHassiumZ
MeitneriumZDarmstadtiumZRoentgeniumZCoperniciumZNihoniumZ	FleroviumZ	MoscoviumZLivermoriumZ
TennessineZ	OganessonzExtra Point)zrx   ry   rz   r{   r|   r}   r~   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   ZNatriumZKaliumZFerrumZCuprumZArgentumZStannumZStibiumZWolframZAurumZHydrargyrumZPlumbumZGasZSolidZLiquidZUnknownzN/A)zrx   ry   rz   r{   r|   r}   r~   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   c             C   s   | d S )Nr    )xr   r   4lib/python3.7/site-packages/parmed/periodic_table.py<lambda>       r   )keyc             C   sB   | d }d}x0t D ](\}}t||  }||k r8|}|}qP qW |S )a  
    Determine the element that has a mass closest to the input mass

    Parameters
    ----------
    mass : float
        The atomic mass to compare to

    Returns
    -------
    element: str
        The returned string is the name of the element whose atomic mass is
        closest to the input mass

    Notes
    -----
    This actually fails (i.e., produces poor predictions) for some cases when
    masses have changed -- particularly in the case of Hydrogen mass
    repartitioning.
    r   r   )_sorted_massesabs)ZmassZdiffZ
best_guesselementZelement_massdr   r   r   element_by_mass   s    r   c             C   s   |   } t| dkrtd S yt| d   }W nf tk
r   | dd }y(d|d  |d  f }t| }W n ttfk
r   d}Y nX Y nX t| S )aQ  
    Determine the element based on the name of an atom. This is very naive. It
    first tries to match the first letter of the element. If that doesn't work,
    it tries to match the first *two* letters. If that still doesn't work, it
    defaults to an extra point

    Parameters
    ----------
    name : str
        Name of the atom to determine an element for

    Returns
    -------
    element : str
        The name of the best-matching element

    Notes
    -----
    This should be a last-case scenario for guessing element information. For
    instance, Ca will never be matched, since calcium atoms will be tagged as
    carbon before the second letter is tried. This is usually OK for
    biomolecules, but you are better off using the mass or, even better, an
    appropriate representation of the atomic number to begin with
    rw   Nr   z%s%sr   )striplenElement	AtomicNumupperKeyErrorlower
IndexError)nameZatomic_numberZsymr   r   r   element_by_name  s    r  )r   r   r   N)__doc__ZKNOWN_ELEMENTSr   r   ZMassNameZ
OriginNameZPhasesorteditemsr   r   r  updatedictr   r   r   r   <module>   s  

"+