| nist_levels | R Documentation |
nist_levels() retrieves the energy levels of an atom or ion from the
NIST Atomic Spectra Database, and partition_function() computes the
internal partition function of a species from its levels, as needed by
cf_libs().
nist_levels(species, timeout = 120)
partition_function(levels, temperature, max_energy = Inf)
species |
A character vector of species in spectroscopic notation,
such as |
timeout |
The download timeout, in seconds. Default is 120. |
levels |
A data frame of levels with columns |
temperature |
The temperature(s), in K. |
max_energy |
The highest level energy included, in eV: one value, or
a vector named by species. Default is |
All the levels listed by the ASD are returned, including the autoionizing levels above the first ionization limit, as in the partition functions computed by the ASD; levels without a statistical weight are dropped. The partition function
U(T) = \sum_i g_i \exp\left(-\frac{E_i}{k_B T}\right)
is summed over the levels given, up to max_energy. In a plasma, the
ionization energy is lowered by the surrounding charges, and the levels
above the lowered limit do not exist: truncating the sum there matters
for atoms with many high Rydberg levels close to the limit, such as the
alkali metals (see cf_libs(), which does it). Without truncation, the
result equals the partition function computed by the ASD.
The results of a query are cached for the R session, and between sessions
with the persistent cache (see download_cache()). Cite the database
when you use these data (see nist_lines()).
nist_levels(): a tibble with one row per level and columns
species, configuration, term, J, g (statistical weight) and
energy (eV).
partition_function(): a tibble with the species, the
temperature and the partition function, for each species and
temperature.
Christian L. Goueguel
cf_libs(), nist_lines(), nist_ionization_energy()
# needs an internet connection; gives up after 20 s if NIST does not answer
ca <- try(nist_levels("Ca I", timeout = 20))
if (!inherits(ca, "try-error")) partition_function(ca, temperature = c(8000, 10000))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.