artistools
Artistools is collection of plotting, analysis, and file format conversion tools for the ARTIS radiative transfer code.
Installation
Requires Python >= 3.13
The artistools command can be invoked with uvx artistools (after installing uv), installed globally with uv tool install artistools, or installed into your environment with pip install artistools.
Development (editable installation)
For development, you will need a rust compiler and a clone of the repository:
git clone https://github.com/artis-mcrt/artistools.git
cd artistools
To make the artistools command available using an isolated uv virtual environment, run:
uv tool install --editable .[extras]
prek install
Alternatively, to avoid uv and install into the system environment with pip:
pip install --group dev --editable .[extras]
prek install
To enable tab completion, run artistools completions. The command detects your shell and gives the
steps for it.
Citing artistools
If you artistools for a paper or presentation, please cite it. For details, see https://zenodo.org/badge/latestdoi/53433932.
Usage
Run "artistools" (or the short alias "at") at the command-line to get a full list of subcommands, and "artistools --version" to check the installed version. Some common commands are:
- artistools plotspectra (alias: at spec)
- artistools plotlightcurve (alias: at lc)
- artistools plotestimators (alias: at estimators)
- artistools plotnltepops
- artistools inputmodel describe
Use the -h option to get a list of command-line arguments for each subcommand. Set ARTISTOOLS_TRACEBACK=1 to get the full traceback of an error. Most of these commands should be run either within an ARTIS simulation folder or by passing the folder path as the last argument.
Use from Python
artistools is mainly a set of commands, but a script or a notebook can call the same functions. import artistools as at gives a small set of names at the top level. Each package holds the other names, e.g. at.spectra and at.inputmodel.
from pathlib import Path
import artistools as at
import polars as pl
modelpath = Path("mymodel")
dfmodel, modelmeta = at.get_modeldata(modelpath)
times_days = at.get_timestep_times(modelpath, loc="mid")
dftemperature = at.scan_estimators(modelpath).filter(pl.col("timestep") == 40).select("modelgridindex", "Te").collect()
dfspectrum = at.spectra.get_spectra(modelpath, timestepmin=40, timestepmax=45)[-1].collect()
A function with the prefix scan_ returns a polars LazyFrame, or one LazyFrame for each direction bin, and reads nothing until .collect(). A function with the prefix read_ reads at once. A function with the prefix get_ can do either, and the tables below say which one returns a LazyFrame. The direction bin -1 is the average over all directions.
Names at the top level
| Name | Purpose |
|---|---|
at.get_modeldata |
Read model.txt. Return the cells as a LazyFrame, and the model parameters as a dictionary. |
at.add_derived_cols_to_modeldata |
Add columns that follow from the model file, e.g. the volume and the mass of each cell. |
at.get_inputparams |
Return the parameters of input.txt. |
at.get_model_name |
Return the name of the model that holds a path. |
at.get_nprocs |
Return the number of MPI processes of the run. |
at.get_timestep_times |
Return the time in days of each timestep (loc is "start", "mid", "end", or "delta"). |
at.get_timestep_of_timedays |
Return the timestep that holds a time in days. |
at.scan_estimators |
Read the estimators of a full run as a LazyFrame, with a row for each timestep and cell. |
at.get_deposition |
Return deposition.out as a LazyFrame. |
at.get_ionstring |
Return a text such as Fe II for an atomic number and an ion stage. |
at.get_ion_tuple |
Return (26, 2) for a text such as FeII, Fe II, or 26_2. |
at.get_elsymbol |
Return the element symbol of an atomic number. |
at.get_atomic_number |
Return the atomic number of an element symbol. |
at.get_z_a_nucname |
Return the atomic number and the mass number of a text such as Pb208. |
at.decode_roman_numeral |
Return the integer of a Roman numeral. |
at.get_path |
Return a known path by name, e.g. the package folder. |
at.firstexisting |
Return the first file of a list that exists, with a compressed copy as an alternative. |
at.zopen |
Open a file, or its .zst, .gz, or .xz copy. |
Main readers in the packages
| Name | Purpose |
|---|---|
at.estimators.read_estimators |
Read the estimators of a few cells into a dictionary. This is slow for many cells, thus prefer at.scan_estimators. |
at.spectra.get_spectra |
Return the spectrum of each direction bin, as an average over a range of timesteps. |
at.spectra.get_from_packets |
Return a spectrum from the packets files, for a range of arrival times. |
at.lightcurve.scan_lightcurve |
Read a light curve file. Return one LazyFrame for each direction bin. |
at.lightcurve.get_from_packets |
Return the luminosity against time from the packets files. |
at.packets.get_packets |
Return the number of ranks and a LazyFrame of the packets of a run. |
at.nltepops.read_nltepops |
Read the NLTE populations of a timestep and of one or more cells. |
at.atomic.get_levels |
Return the energy levels of each ion, with the transitions as an option. |
at.inputmodel.save_modeldata |
Write model.txt from a dataframe of the cells. |
at.plottools.set_mpl_style |
Apply the matplotlib style of artistools. |
The command of a package
A package that has a plot command gives it as plot, e.g. at.spectra.plot, at.lightcurve.plot, at.estimators.plot, at.nltepops.plot, at.packets.plot, at.nonthermal.plot, and at.gsinetwork.plot. This function is the command itself. Each keyword is one command-line argument:
at.spectra.plot(argsraw=[], specpath=[modelpath], timedays="300", outputfile="spectrum.pdf")
Example output
License
Distributed under the MIT license. See LICENSE for more information.
Metadata
Release files for artistools 2026.9.22
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| artistools-2026.9.22.tar.gz | 8.5 MB | Details |
Built distributions (wheels)
Total release size: 140.3 MB
Release files / artistools-2026.9.22.tar.gz
| Download URL | artistools-2026.9.22.tar.gz |
|---|---|
| Size | 8.5 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
824b4546eb48447de0472a54741534f775257c2b1cda3e1a257abe24a1cd8b43
|
|
BLAKE2b-256 checksum How to use checksums |
55f92c7cdcead1a7a2656e11c6f153e30953b4302065f87978eb10220fae8255
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 22, 2026.
Transparency logRelease files / artistools-2026.9.22-cp315-abi3.abi3t-manylinux_2_28_x86_64.whl
| Download URL | artistools-2026.9.22-cp315-abi3.abi3t-manylinux_2_28_x86_64.whl |
|---|---|
| Size | 15.3 MB |
| Tags | CPython 3.15 Linux glibc 2.28+ x86-64 abi3 abi3t |
|
SHA-256 checksum How to use checksums |
432b30479da1710c0e66b7eda0641ccbbe832c13440caf503a4790b389d7b6b5
|
|
BLAKE2b-256 checksum How to use checksums |
a0d08a52cd29616a162bd4fd7eb2a0ca3ad7244f2ad5e2e45a0b8a8fda122452
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 22, 2026.
Transparency logRelease files / artistools-2026.9.22-cp315-abi3.abi3t-manylinux_2_28_aarch64.whl
| Download URL | artistools-2026.9.22-cp315-abi3.abi3t-manylinux_2_28_aarch64.whl |
|---|---|
| Size | 15.4 MB |
| Tags | CPython 3.15 Linux glibc 2.28+ ARM64 abi3 abi3t |
|
SHA-256 checksum How to use checksums |
e2aac3b04eceb590bd121d6db92b6e7e7fcfc277e0cf0d450a47e376467c2748
|
|
BLAKE2b-256 checksum How to use checksums |
b3765d1515d549297a44d24b7fe8beb0e1d32e613f4f1b36f4d0511304f85bd8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 22, 2026.
Transparency logRelease files / artistools-2026.9.22-cp315-abi3.abi3t-macosx_13_0_arm64.whl
| Download URL | artistools-2026.9.22-cp315-abi3.abi3t-macosx_13_0_arm64.whl |
|---|---|
| Size | 13.2 MB |
| Tags | CPython 3.15 abi3 abi3t macOS 13.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
6db8a20cac0fd85c406b29e00c18d3e83bdaa66faa1b06ebd34aa89ffb540ad2
|
|
BLAKE2b-256 checksum How to use checksums |
b1a58b5143a92b83876ebf53c977c1e4d5f3bb25358a9f27779b1702f0bd67f2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 22, 2026.
Transparency logRelease files / artistools-2026.9.22-cp314-cp314t-manylinux_2_28_x86_64.whl
| Download URL | artistools-2026.9.22-cp314-cp314t-manylinux_2_28_x86_64.whl |
|---|---|
| Size | 15.3 MB |
| Tags | CPython 3.14 CPython 3.14 free-threading Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
0ad44b13dc0410d57aecf94d8872cc4310a9f5f9494fa52388811643fd5ce88c
|
|
BLAKE2b-256 checksum How to use checksums |
67e1ea176a40e2d673eb0234c08726177ea86ca8eead5ebba4506093efa644be
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 22, 2026.
Transparency logRelease files / artistools-2026.9.22-cp314-cp314t-manylinux_2_28_aarch64.whl
| Download URL | artistools-2026.9.22-cp314-cp314t-manylinux_2_28_aarch64.whl |
|---|---|
| Size | 15.4 MB |
| Tags | CPython 3.14 CPython 3.14 free-threading Linux glibc 2.28+ ARM64 |
|
SHA-256 checksum How to use checksums |
e7fac1defb0fffddab531875a26dd9e41ab99919d52a537e594ed0d5cc00ba4a
|
|
BLAKE2b-256 checksum How to use checksums |
10b131a0fe34f7f5d22abeff824e6522d856dbeec00e5704f41345f084303571
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 22, 2026.
Transparency logRelease files / artistools-2026.9.22-cp314-cp314t-macosx_13_0_arm64.whl
| Download URL | artistools-2026.9.22-cp314-cp314t-macosx_13_0_arm64.whl |
|---|---|
| Size | 13.2 MB |
| Tags | CPython 3.14 CPython 3.14 free-threading macOS 13.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
15d6bd98ce4844ab4c83d06e57a999255a8d2c2c8daa43f6739c65e114e5a141
|
|
BLAKE2b-256 checksum How to use checksums |
7978cc07ae60d6713ff7157f80a95e2761c53ecf5cca6d0abbed77e1ce2a5216
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 22, 2026.
Transparency logRelease files / artistools-2026.9.22-cp313-abi3-manylinux_2_28_x86_64.whl
| Download URL | artistools-2026.9.22-cp313-abi3-manylinux_2_28_x86_64.whl |
|---|---|
| Size | 15.3 MB |
| Tags | CPython 3.13 Linux glibc 2.28+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
45960584f1e4e6213e643808b2c75c3e73bdddb2a484b479e0e56beee7c523ea
|
|
BLAKE2b-256 checksum How to use checksums |
38c0eaaeac2f7deef5a157a733224d7de1476abfa3ce204f24e9bb3e5a14c620
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 22, 2026.
Transparency logRelease files / artistools-2026.9.22-cp313-abi3-manylinux_2_28_aarch64.whl
| Download URL | artistools-2026.9.22-cp313-abi3-manylinux_2_28_aarch64.whl |
|---|---|
| Size | 15.4 MB |
| Tags | CPython 3.13 Linux glibc 2.28+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
c2b5d25dbb20fd70c1dd39237eaf6ed5accacd960ac7eeec0ea4120dd30969b4
|
|
BLAKE2b-256 checksum How to use checksums |
0a00cfa68c08d4d2937d5d7eacf7ddd84c47a1b59cfad1d40033f0102f1484c3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 22, 2026.
Transparency logRelease files / artistools-2026.9.22-cp313-abi3-macosx_13_0_arm64.whl
| Download URL | artistools-2026.9.22-cp313-abi3-macosx_13_0_arm64.whl |
|---|---|
| Size | 13.2 MB |
| Tags | CPython 3.13 abi3 macOS 13.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
0e281b293d91a9d04e8a9e80cf78b0911a937aaaffa6cfc1471cc4e5ee505b0c
|
|
BLAKE2b-256 checksum How to use checksums |
4330f625898365cbbac950ca3a644d0b4563c1ac9206d6af4e4c9748b5f60c70
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 22, 2026.
Transparency log