You can interact with this notebook online: Launch notebook
Creating an atomic-data summary table
This notebook shows how to create a compact summary of the atomic levels and lines available for each element. The summary is returned as a pandas DataFrame and written as both plain text and LaTeX files.
[1]:
from pathlib import Path
from tempfile import TemporaryDirectory
from tardis.io.atom_data import export_atom_data_summary
from tardis.io.atom_data.util import resolve_atom_data_fname
An ion is included in the summary when it has more than one level and at least one line. You can supply an atomic data HDF file or a TARDIS AtomData object. The example here uses a temporary directory to save the output.
[2]:
atomic_data_path = resolve_atom_data_fname("kurucz_cd23_chianti_H_He_latest")
with TemporaryDirectory() as directory:
summary = export_atom_data_summary(
atomic_data_path,
Path(directory) / "atomic_data_summary",
journal="aas",
)
summary
[2]:
| Element | Ion stages | No. of Levels | No. of Lines | |
|---|---|---|---|---|
| 0 | $\mathrm{H}_{1}$ | I | 25 | 74 |
| 1 | $\mathrm{He}_{2}$ | I--II | 74 | 247 |
| 2 | $\mathrm{Li}_{3}$ | I--II | 124 | 538 |
| 3 | $\mathrm{Be}_{4}$ | I--III | 84 | 251 |
| 4 | $\mathrm{B}_{5}$ | I--IV | 96 | 237 |
| 5 | $\mathrm{C}_{6}$ | I--IV | 1036 | 4203 |
| 6 | $\mathrm{N}_{7}$ | I--VI | 662 | 5762 |
| 7 | $\mathrm{O}_{8}$ | I--VI | 746 | 4132 |
| 8 | $\mathrm{F}_{9}$ | I--VI | 780 | 4824 |
| 9 | $\mathrm{Ne}_{10}$ | I--VI | 826 | 6712 |
| 10 | $\mathrm{Na}_{11}$ | I--VI | 381 | 1530 |
| 11 | $\mathrm{Mg}_{12}$ | I--VI | 907 | 3275 |
| 12 | $\mathrm{Al}_{13}$ | I--VI | 655 | 3738 |
| 13 | $\mathrm{Si}_{14}$ | I--VI | 951 | 6152 |
| 14 | $\mathrm{P}_{15}$ | I--VI | 485 | 2344 |
| 15 | $\mathrm{S}_{16}$ | I--VI | 374 | 1638 |
| 16 | $\mathrm{Cl}_{17}$ | I--V | 495 | 4110 |
| 17 | $\mathrm{Ar}_{18}$ | I--V | 686 | 7772 |
| 18 | $\mathrm{K}_{19}$ | I--V | 213 | 965 |
| 19 | $\mathrm{Ca}_{20}$ | I--IX | 715 | 6255 |
| 20 | $\mathrm{Sc}_{21}$ | I--IX | 757 | 7877 |
| 21 | $\mathrm{Ti}_{22}$ | I--IX | 1092 | 14413 |
| 22 | $\mathrm{V}_{23}$ | I--IX | 1429 | 18688 |
| 23 | $\mathrm{Cr}_{24}$ | I--IX | 1716 | 26229 |
| 24 | $\mathrm{Mn}_{25}$ | I--IX | 1683 | 19681 |
| 25 | $\mathrm{Fe}_{26}$ | I--IX | 2988 | 61247 |
| 26 | $\mathrm{Co}_{27}$ | I--IX | 1702 | 20510 |
| 27 | $\mathrm{Ni}_{28}$ | I--V, VII--IX | 1912 | 33115 |
| 28 | $\mathrm{Cu}_{29}$ | I--II | 311 | 3071 |
| 29 | $\mathrm{Zn}_{30}$ | I--III | 311 | 2151 |
| 30 | Total | 24216 | 271741 |
The journal argument selects the LaTeX layout. Built-in layouts are available for aa, aas, mnras, and nature; a JSON configuration can also be supplied. The output basename above produces atomic_data_summary.txt and atomic_data_summary.tex in the temporary directory.