atomic module

This module contains basic atomic parameters (i.e. atomic numbers, element symbols)

atomic.py contains routines related to basic atomic data, e.g. converting integer nuclear charge to element symbols, etc.

Version -.1 - initial release Adam Foster July 17th 2015

pyatomdb.atomic.Z_to_mass(Z, raw=False)[source]

Converts element symbol to atomic mass, e.g. “C” -> 12.0107

Isotope fractions based on those found in earth’s crust samples, your astrophysical object may vary.

Parameters:
Zint

nuclear charge, e.g 6 for C

rawbool

if true, ignore Z, and return the entire mass list as an array with a 0 at the beginning so ret[12] = mass of carbon.

Returns
——-
float

mass in a.m.u. for the element. (e.g. 12.0107 for C)

References

Atomic masses are taken from: Pure Appl. Chem. 81 NO 11, 2131-2156 (2009) Masses for Technetium, Promethium, Polonium, Astatine, Radon, Francium, Radium & Actinum are estimates. If you need these you probably aren’t doing astronomy…

pyatomdb.atomic.Ztoelname(Z)[source]

Returns element name of element with nuclear charge Z.

Parameters:
Zint

nuclear charge of element (e.g. 6 for carbon)

Returns:
str

element name (e.g. “Carbon” for carbon)

pyatomdb.atomic.Ztoelsymb(Z)[source]

Returns element symbol of element with nuclear charge Z.

Parameters:
Z - nuclear charge of element (e.g. 6 for carbon)
Returns:
element symbol (e.g. “C” for carbon)
Version 0.1 28 July 2009
Adam Foster
pyatomdb.atomic.config_to_occup(cfgstr, nel=-1, shlmax=-1, noccup=[-1])[source]
pyatomdb.atomic.elsymb_to_Z(elsymb)[source]

Converts element symbol to nuclear charge, e.g. “C” -> 6

Parameters:
elsymbstr

Element symbol, e.g. “C”. Case insensitive.

Returns:
int

Z for the ion. (e.g. 6 for C)

pyatomdb.atomic.elsymb_to_z0(elsymb)[source]

Converts element symbol to nuclear charge, e.g. “C” -> 6 (wrapper to elsymb_to_Z, retained for consistency)

Parameters:
elsymbstr

Element symbol, e.g. “C”. Case insensitive.

Returns:
int

Z for the ion. (e.g. 6 for C)

pyatomdb.atomic.get_maxn(cfgstr)[source]
pyatomdb.atomic.get_parity(cfgstr)[source]
pyatomdb.atomic.int2roman(number)[source]
pyatomdb.atomic.int_to_roman(input)[source]

Convert an integer to Roman numerals.

pyatomdb.atomic.occup_to_cfg(occlist)[source]
pyatomdb.atomic.occup_to_config(occup)[source]
pyatomdb.atomic.parse_config(cfgstr)[source]
pyatomdb.atomic.parse_eissner(cfgstr, nel=0, levelmap=None, lmax_set=None)[source]
pyatomdb.atomic.roman_to_int(input)[source]

Convert a roman numeral to an integer.

pyatomdb.atomic.shorten_config(cfgstr, nel=0)[source]

Shorten the configuration as required

Parameters:
cfgstrstring

configuration string. Should be simplified already e.g. ‘1s2 2s2 3p1’

Returns:
cfgshrtstring

shortened configuration, e.g. ‘3p1’

pyatomdb.atomic.spectroscopic_name(Z, z1)[source]

Converts Z,z1 to spectroscopic name, e.g. 6,5 to “C V”

Parameters:
Zint

nuclear charge (e.g. 6 for C)

z1int

ion charge +1 (e.g. 5 for C4+)

Returns:
str

spectroscopic symbol for ion (e.g. “C V” for C+4)

pyatomdb.atomic.spectroscopictoz0(name)[source]

Converts spectroscopic name to Z, z1, e.g. “C V” to 6,5

Parameters:
namestr

Ion name, e.g. “C V”

Returns:
int, int

Z, z1 for the ion. (e.g. 6,5 for C V)

pyatomdb.atomic.z0_to_mass(z0)[source]

Converts element symbol to atomic mass, e.g. “C” -> 12.0107

(wrapper to Z_to_mass, retained for consistency)

Isotope fractions based on those found in earth’s crust samples, your astrophysical object may vary.

Parameters:
z0int

nuclear charge, e.g 6 for C

Returns:
float

mass in a.m.u. for the element. (e.g. 12.0107 for C)

References

Atomic masses are taken from: Pure Appl. Chem. 81 NO 11, 2131-2156 (2009) Masses for Technetium, Promethium, Polonium, Astatine, Radon, Francium, Radium & Actinum are estimates. If you need these you probably aren’t doing astronomy…

pyatomdb.atomic.z0toelname(z0)[source]

Returns element name of element with nuclear charge z0. (wrapper to Ztoelname for compatibility purposes)

Parameters:
z0int

nuclear charge of element (e.g. 6 for carbon)

Returns:
str

element name (e.g. “Carbon” for carbon)

pyatomdb.atomic.z0toelsymb(z0)[source]

Returns element symbol of element with nuclear charge z0. (wrapper to Ztoelsymb for compatibility purposes)

Parameters:
z0int

nuclear charge of element (e.g. 6 for carbon)

Returns:
str

element symbol (e.g. “C” for carbon)