Skip to main content

artistools

DOI PyPI - Version License

Supported Python versions Installation and pytest codecov

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.

A model on a different host

These commands accept a model path of the form host:path, where host is a name that ssh knows:

  • plotestimators and its --interactive viewer;
  • plotlightcurve;
  • plotspectra and its --interactive viewer;
  • at.scan_estimators in a Python script.
artistools plotspectra -t 300 vae26:~/scratch/mymodel

The rule of rsync decides whether a path is remote: a colon before the first slash makes a remote path. A local folder with such a colon in its name needs "./" at the start, e.g. ./run:2.

artistools starts uvx artistools@<version> server on that host through ssh, with the versions of the local artistools and polars. Thus the host needs only uv. The command sets POLARS_MAX_THREADS=16, because a login node can have hundreds of cores, and other users share them. The server reads the files and makes the data of each plot, e.g. it puts the packets into bins. Only the data to draw comes back, and the parquet caches stay beside the data on the host. A script sends the filter and the columns of each query to the host, and only the rows of the query come back.

An option that reads its files on the local host stops with an error. To start the server with a different command on the host, e.g. an artistools in a clone, set ARTISTOOLS_REMOTE_COMMAND:

export ARTISTOOLS_REMOTE_COMMAND='POLARS_MAX_THREADS=16 ~/artistools/.venv/bin/artistools server'

The environment of such a command must have the same version of polars as the client. The filter of a query goes to the host as a polars expression, and the format of an expression changes between two versions. If the versions differ, the client stops with an error that gives the uvx option.

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_composition_data Return the elements and the ion stages of compositiondata.txt as a DataFrame.
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

Emission plot NLTE plot Estimator plot

License

Distributed under the MIT license. See LICENSE for more information.

https://github.com/artis-mcrt/artistools

Metadata

Release files for artistools 2026.10.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for artistools 2026.10.2
File Size Uploaded
artistools-2026.10.2.tar.gz 8.8 MB Details

Built distributions (wheels)

Table of built distributions (wheels) for artistools 2026.10.2
File
artistools-2026.10.2-cp315-abi3.abi3t-manylinux_2_28_x86_64.whl CPython 3.15 abi3, abi3t Linux glibc 2.28+ x86-64 Details
artistools-2026.10.2-cp315-abi3.abi3t-manylinux_2_28_aarch64.whl CPython 3.15 abi3, abi3t Linux glibc 2.28+ ARM64 Details
artistools-2026.10.2-cp315-abi3.abi3t-macosx_13_0_arm64.whl CPython 3.15 abi3, abi3t macOS 13.0+ ARM64 Details
artistools-2026.10.2-cp314-cp314t-manylinux_2_28_x86_64.whl CPython 3.14 CPython 3.14 free-threading Linux glibc 2.28+ x86-64 Details
artistools-2026.10.2-cp314-cp314t-manylinux_2_28_aarch64.whl CPython 3.14 CPython 3.14 free-threading Linux glibc 2.28+ ARM64 Details
artistools-2026.10.2-cp314-cp314t-macosx_13_0_arm64.whl CPython 3.14 CPython 3.14 free-threading macOS 13.0+ ARM64 Details
artistools-2026.10.2-cp313-abi3-manylinux_2_28_x86_64.whl CPython 3.13 abi3 Linux glibc 2.28+ x86-64 Details
artistools-2026.10.2-cp313-abi3-manylinux_2_28_aarch64.whl CPython 3.13 abi3 Linux glibc 2.28+ ARM64 Details
artistools-2026.10.2-cp313-abi3-macosx_13_0_arm64.whl CPython 3.13 abi3 macOS 13.0+ ARM64 Details

Total release size: 144.9 MB

Release files / artistools-2026.10.2.tar.gz

Download URL artistools-2026.10.2.tar.gz
Size 8.8 MB
Tags Source
SHA-256 checksum
How to use checksums
4d306829dd114b812c327e1cd504794b160f0c9236442be63ea4a44b2b9e0e54
BLAKE2b-256 checksum
How to use checksums
fb847f93c3cdc3ed893ef9583c76a01967d6e4098fa1b4d3921b0259d0c2b236
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 Oct 2, 2026.

Transparency log

Release files / artistools-2026.10.2-cp315-abi3.abi3t-manylinux_2_28_x86_64.whl

Download URL artistools-2026.10.2-cp315-abi3.abi3t-manylinux_2_28_x86_64.whl
Size 15.8 MB
Tags CPython 3.15 Linux glibc 2.28+ x86-64 abi3 abi3t
SHA-256 checksum
How to use checksums
612c462eb24d92c48e5efc2b2e6853911ef64b09a94b455de06f6ea2ec9473a6
BLAKE2b-256 checksum
How to use checksums
222ea6de62a63a72aaed3a0501279de2dcf3a8f722418434bb59a9955eab8bf5
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 Oct 2, 2026.

Transparency log

Release files / artistools-2026.10.2-cp315-abi3.abi3t-manylinux_2_28_aarch64.whl

Download URL artistools-2026.10.2-cp315-abi3.abi3t-manylinux_2_28_aarch64.whl
Size 15.9 MB
Tags CPython 3.15 Linux glibc 2.28+ ARM64 abi3 abi3t
SHA-256 checksum
How to use checksums
e44b9e7d3cec9e3ed82fb6ed4a1a7d597a657c49cf0f80886df5bf37122aa744
BLAKE2b-256 checksum
How to use checksums
ebac71b42657463ae0b56428f63cfe0d206e0aebb34e691b49dde06c2b1282ee
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 Oct 2, 2026.

Transparency log

Release files / artistools-2026.10.2-cp315-abi3.abi3t-macosx_13_0_arm64.whl

Download URL artistools-2026.10.2-cp315-abi3.abi3t-macosx_13_0_arm64.whl
Size 13.7 MB
Tags CPython 3.15 abi3 abi3t macOS 13.0+ ARM64
SHA-256 checksum
How to use checksums
05dfb293c8baf8a297aac4a8e717b0a145cbb0d7aa954177b085535510a3db6e
BLAKE2b-256 checksum
How to use checksums
783353232d9d5272647074e4c5b1220b8eb5b2818d7029e1301e9e4028bfc8b7
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 Oct 2, 2026.

Transparency log

Release files / artistools-2026.10.2-cp314-cp314t-manylinux_2_28_x86_64.whl

Download URL artistools-2026.10.2-cp314-cp314t-manylinux_2_28_x86_64.whl
Size 15.8 MB
Tags CPython 3.14 CPython 3.14 free-threading Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
e00f6d470ace57813c92ab99fb85268b16189cde1196c2b86c7b276a8caeb00f
BLAKE2b-256 checksum
How to use checksums
9180638059e348e1f231fc37af86378d63d7e17db6c75228f0988ebc60538e50
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 Oct 2, 2026.

Transparency log

Release files / artistools-2026.10.2-cp314-cp314t-manylinux_2_28_aarch64.whl

Download URL artistools-2026.10.2-cp314-cp314t-manylinux_2_28_aarch64.whl
Size 15.9 MB
Tags CPython 3.14 CPython 3.14 free-threading Linux glibc 2.28+ ARM64
SHA-256 checksum
How to use checksums
e2c03808788d894df72a9b3396d62c7e5856794665aeae7b2e7ce7456d9008c2
BLAKE2b-256 checksum
How to use checksums
a1a23da29052c20755e5683f634ed5600a0e474080c3fd8f91a845f35e26eae0
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 Oct 2, 2026.

Transparency log

Release files / artistools-2026.10.2-cp314-cp314t-macosx_13_0_arm64.whl

Download URL artistools-2026.10.2-cp314-cp314t-macosx_13_0_arm64.whl
Size 13.7 MB
Tags CPython 3.14 CPython 3.14 free-threading macOS 13.0+ ARM64
SHA-256 checksum
How to use checksums
eec0b7221b9e54ddc1b2a05d1b5b460bb3c2a151a1829e24793da8df172de402
BLAKE2b-256 checksum
How to use checksums
2ca251dcf32f78fefb144a7de0e2ae27a8f7acb198c6f9f4ada42ec293748efa
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 Oct 2, 2026.

Transparency log

Release files / artistools-2026.10.2-cp313-abi3-manylinux_2_28_x86_64.whl

Download URL artistools-2026.10.2-cp313-abi3-manylinux_2_28_x86_64.whl
Size 15.8 MB
Tags CPython 3.13 Linux glibc 2.28+ x86-64 abi3
SHA-256 checksum
How to use checksums
e11fdd96b865a2d2c2669e394cd8466125b6113cb247152ec399026069785ec1
BLAKE2b-256 checksum
How to use checksums
0e0ba19b20825c7a7e857d91fcfd5ebd0e50f0ca0b0d61ff964d1fa20439e6d3
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 Oct 2, 2026.

Transparency log

Release files / artistools-2026.10.2-cp313-abi3-manylinux_2_28_aarch64.whl

Download URL artistools-2026.10.2-cp313-abi3-manylinux_2_28_aarch64.whl
Size 15.9 MB
Tags CPython 3.13 Linux glibc 2.28+ ARM64 abi3
SHA-256 checksum
How to use checksums
d701d550ef9d0b34ee957dc35ed266baf06a1c68bd467f23e1dd2ef6b04b604c
BLAKE2b-256 checksum
How to use checksums
4afba71082cfa409506488fa6d9e1981100bbe935ebce786bce37941e23ae2d5
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 Oct 2, 2026.

Transparency log

Release files / artistools-2026.10.2-cp313-abi3-macosx_13_0_arm64.whl

Download URL artistools-2026.10.2-cp313-abi3-macosx_13_0_arm64.whl
Size 13.7 MB
Tags CPython 3.13 abi3 macOS 13.0+ ARM64
SHA-256 checksum
How to use checksums
13d77a94a1e325ca2e1bd0a09d7e90620b6504f7542aab0582e65d3d841f6510
BLAKE2b-256 checksum
How to use checksums
e88bb47aa7f6009923c91a599ef54c4e4f1e6cd62ed29a15b74b75c801dc3b52
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 Oct 2, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

2026.10.2 This release

10 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page