Package lib :: Module periodic_table :: Class Periodic_table
[hide private]
[frames] | no frames]

Class Periodic_table

source code


The periodic table object.

Instance Methods [hide private]
new empty dictionary

__init__(self)
Set up the periodic table object.
source code
Element instance
_add(self, atomic_number=None, symbol=None, name=None, atomic_weight=None)
Add an element to the table.
source code
 
_get_isotope(self, symbol=None, A=None)
Return the matching isotope container.
source code
float
atomic_mass(self, id=None)
Return the isotopic atomic mass or standard atomic weight as a float.
source code
float
atomic_weight(self, symbol=None)
Return the standard atomic weight as a float for the given atom.
source code
float
gyromagnetic_ratio(self, isotope=None)
Return the gyromagnetic ratio for the isotope.
source code
bool
has_element(self, symbol=None)
Check if the periodic table contains an atom for the give symbol.
source code
str
lookup_symbol(self, atomic_number=None)
Return the atomic symbol corresponding to the atomic number Z.
source code

Inherited from dict: __cmp__, __contains__, __delitem__, __eq__, __ge__, __getattribute__, __getitem__, __gt__, __iter__, __le__, __len__, __lt__, __ne__, __new__, __repr__, __setitem__, __sizeof__, clear, copy, fromkeys, get, has_key, items, iteritems, iterkeys, itervalues, keys, pop, popitem, setdefault, update, values, viewitems, viewkeys, viewvalues

Inherited from object: __delattr__, __format__, __reduce__, __reduce_ex__, __setattr__, __str__, __subclasshook__

Class Variables [hide private]

Inherited from dict: __hash__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self)
(Constructor)

source code 

Set up the periodic table object.

Returns:
new empty dictionary

Overrides: object.__init__

_add(self, atomic_number=None, symbol=None, name=None, atomic_weight=None)

source code 

Add an element to the table.

Parameters:
  • atomic_number (int) - The atomic number Z.
  • symbol (str) - The atomic symbol.
  • name (str) - The chemical element name.
  • atomic_weight (str) - The atomic weight number for the atom. This is a string as it uses the IUPAC notation of, for example, "[1.00784, 1.00811]" and "4.002602(2)" to represent ranges and uncertainty.
Returns: Element instance
The element container object.

_get_isotope(self, symbol=None, A=None)

source code 

Return the matching isotope container.

Parameters:
  • symbol (str) - The atomic symbol.
  • A (int) - The mass number of the isotope.

atomic_mass(self, id=None)

source code 

Return the isotopic atomic mass or standard atomic weight as a float.

Parameters:
  • id (str) - The atom or isotope identifier. To select isotopes, merge the mass number A with the symbol to form the ID. To select atoms, just set the ID to the atomic symbol. For example, '15N' selects the 15N nitrogen isotope, whereas 'N' selects the nitrogen atom.
Returns: float
The isotopic atomic mass or the standard atomic weight.

atomic_weight(self, symbol=None)

source code 

Return the standard atomic weight as a float for the given atom.

Parameters:
  • symbol (str) - The atomic symbol.
Returns: float
The standard atomic weight.

gyromagnetic_ratio(self, isotope=None)

source code 

Return the gyromagnetic ratio for the isotope.

Parameters:
  • isotope (str) - The isotope name, e.g. '15N'.
Returns: float
The desired gyromagnetic ratio.
Raises:

has_element(self, symbol=None)

source code 

Check if the periodic table contains an atom for the give symbol.

Parameters:
  • symbol (str) - The atomic symbol.
Returns: bool
True if the symbol is in the periodic table, False otherwise.

lookup_symbol(self, atomic_number=None)

source code 

Return the atomic symbol corresponding to the atomic number Z.

Parameters:
  • atomic_number (int) - The atomic number Z.
Returns: str
The atomic symbol.