constants.codata

These constants are taken from CODATA Recommended Values of the Fundamental Physical Constants 2014.

Object

physical_constants : dict
A dictionary containing physical constants. Keys are the names of physical constants, values are tuples (value, units, precision).

Functions

value(key):
Returns the value of the physical constant(key).
unit(key):
Returns the units of the physical constant(key).
precision(key):
Returns the relative precision of the physical constant(key).
find(sub):
Prints or returns list of keys containing the string sub, default is all.

Source

The values of the constants provided at this site are recommended for international use by CODATA and are the latest available. Termed the “2014 CODATA recommended values,” they are generally recognized worldwide for use in all fields of science and technology. The values became available on 25 June 2015 and replaced the 2010 CODATA set. They are based on all of the data available through 31 December 2014. The 2014 adjustment was carried out under the auspices of the CODATA Task Group on Fundamental Constants. Also available is an introduction to the constants for non-experts at http://physics.nist.gov/cuu/Constants/introduction.html

References

Theoretical and experimental publications relevant to the fundamental constants and closely related precision measurements published since the mid 1980s, but also including many older papers of particular interest, some of which date back to the 1800s. To search bibliography visit

http://physics.nist.gov/cuu/Constants/

Module Contents

Classes

ConstantWarning() Accessing a constant no longer in current CODATA data set

Functions

parse_constants(d)
_check_obsolete(key)
value(key) Value in physical_constants indexed by key
unit(key) Unit in physical_constants indexed by key
precision(key) Relative precision in physical_constants indexed by key
find(sub=None,disp=False) Return list of physical_constant keys containing a given string.
parse_constants(d)
class ConstantWarning

Accessing a constant no longer in current CODATA data set

_check_obsolete(key)
value(key)

Value in physical_constants indexed by key

key : Python string or unicode
Key in dictionary physical_constants
value : float
Value in physical_constants corresponding to key
codata : Contains the description of physical_constants, which, as a
dictionary literal object, does not itself possess a docstring.
>>> from scipy import constants
>>> constants.value(u'elementary charge')
    1.6021766208e-19
unit(key)

Unit in physical_constants indexed by key

key : Python string or unicode
Key in dictionary physical_constants
unit : Python string
Unit in physical_constants corresponding to key
codata : Contains the description of physical_constants, which, as a
dictionary literal object, does not itself possess a docstring.
>>> from scipy import constants
>>> constants.unit(u'proton mass')
'kg'
precision(key)

Relative precision in physical_constants indexed by key

key : Python string or unicode
Key in dictionary physical_constants
prec : float
Relative precision in physical_constants corresponding to key
codata : Contains the description of physical_constants, which, as a
dictionary literal object, does not itself possess a docstring.
>>> from scipy import constants
>>> constants.precision(u'proton mass')
1.2555138746605121e-08
find(sub=None, disp=False)

Return list of physical_constant keys containing a given string.

sub : str, unicode
Sub-string to search keys for. By default, return all keys.
disp : bool
If True, print the keys that are found, and return None. Otherwise, return the list of keys without printing anything.
keys : list or None
If disp is False, the list of keys is returned. Otherwise, None is returned.
codata : Contains the description of physical_constants, which, as a
dictionary literal object, does not itself possess a docstring.
>>> from scipy.constants import find, physical_constants

Which keys in the physical_constants dictionary contain ‘boltzmann’?

>>> find('boltzmann')
['Boltzmann constant',
 'Boltzmann constant in Hz/K',
 'Boltzmann constant in eV/K',
 'Boltzmann constant in inverse meters per kelvin',
 'Stefan-Boltzmann constant']

Get the constant called ‘Boltzmann constant in Hz/K’:

>>> physical_constants['Boltzmann constant in Hz/K']
(20836612000.0, 'Hz K^-1', 12000.0)

Find constants with ‘radius’ in the key:

>>> find('radius')
['Bohr radius',
 'classical electron radius',
 'deuteron rms charge radius',
 'proton rms charge radius']
>>> physical_constants['classical electron radius']
(2.8179403227e-15, 'm', 1.9e-24)