Skip to main content

kalast

Kalast is a thermophysical model (TPM) for binary asteroids; it applies to other airless bodies as well. Kalast is also an image simulator for spacecraft cameras, in the visible and in the infrared. Its renderer serves several other uses — viewing and interacting with meshes, generating lightcurves — see the examples/ folder.

TPM

Several solvers of the heat conduction equation are implemented, all on a variable-spacing depth grid:

  • explicit: forward Euler, plus Runge–Kutta–Chebyshev super-time-stepping for problems where the depth system is no longer tridiagonal — lateral conduction, FEM, or a GPU port
  • implicit: backward Euler, Crank–Nicolson, BDF2

Validated against analytical solutions (damped thermal wave, slab relaxation) in examples/analytical/, and pinned by tests: error budgets, amplitude decay and phase lag, and the observed order of accuracy — 1 for backward Euler, 2 for Crank–Nicolson and BDF2.

The surface boundary condition includes:

  • solar radiation
  • self- and mutual heating (thermal re-emission and reflected sunlight)

Depth BC:

  • adiabatic
  • internal flux for larger bodies

Shadows, eclipses and occultations are computed by shadow mapping on the GPU (a CPU ray-tracing path exists, and is slower).

View factors for self- and mutual heating are computed by the hemicube method on the GPU: occlusion comes free from the depth test, one render yields a whole row, and the result is stored sparse (0.3 % dense on the Didymos pair). Radiosity is first order by default, with more bounces on request. Validated to 0.07 % against the closed form for perpendicular squares.

Once surface temperatures are known, the infrared image is rendered from the observer: emitted plus reflected flux, through a camera's resolution, field of view, filters and spectral response function.

Surface roughness is treated twice, once per wavelength range. In the infrared, the Kuehrt spherical-crater model corrects the emitted flux — beaming, which makes a rough surface read hotter and flatter at low phase — with multiple scattering after Lagerros (1996) and Mueller (2007). In the visible, Hapke's macroscopic roughness (θ̄, 1984) enters the photometry and the lightcurves.

Renderer

Kalast's renderer was first written to watch TPM results — surface temperatures evolving as the bodies spin. Matplotlib and MATLAB had served before, and both slowed the CPU simulation down.

The renderer runs on the GPU through wgpu, a pure-Rust implementation of the WebGPU standard, natively on every platform.

Shadow mapping uses PCF and fits its light frustum to the bounding boxes of the bodies in the scene automatically.

Kalast is also a UI app for editing scripts and interacting with the rendered scene, in the spirit of Blender or Unity.

Shape models

Shape models represent a body's surface as triangular facets. Of the many formats, kalast reads Wavefront .obj only.

Getting started

Grab a release from https://github.com/GregoireHENRY/kalast/releases, unpack it, and run it from inside the folder.

./kalast                                       # starts the kalast UI app
./kalast examples/two_spheres/main.py          # loads a Python example
./kalast examples/crater_self_shadow/step.rs   # a Rust one
./kalast some/shape.obj                        # a mesh

There is nothing to install and nothing is written outside the folder. The archive carries its own Python, with kalast and its dependencies already in it, and the .rs examples come pre-compiled. Editing one, or opening a .rs of your own, means compiling it: if the machine has no cargo the kalast UI app fetches a minimal toolchain into toolchain/ beside the executable and reuses it afterwards. On macOS that also wants Apple's command line tools for the linker (xcode-select --install).

The bundles are not code-signed, so Windows warns once at the first launch of kalast.exe: More info, then Run anyway. macOS refuses to run a bundle downloaded with a browser -- the executable and every library in it -- until the download flag is cleared, once, on the unpacked folder (-macos-x86_64 on an Intel Mac):

xattr -cr ~/Downloads/kalast-v0.5.8-macos-arm64

pip install kalast never sees either of these.

Double-clicking kalast works too.

Linux requirements

The Linux bundle runs on 64-bit Intel and AMD processors (x86_64) with glibc 2.35 or newer. ldd --version prints the one a system has.

Works glibc
Ubuntu 22.04, 24.04 and later (Mint 21+, Pop!_OS 22.04+) 2.35+
Debian 12, 13 2.36, 2.41
Fedora 36 and later 2.35+
RHEL, Rocky, Alma 10 2.39
Arch, Manjaro, openSUSE Tumbleweed current
Does not work glibc
RHEL, Rocky, Alma 9 2.34
RHEL, Rocky, Alma 8 2.28
Ubuntu 20.04, Mint 20 2.31
Debian 11 2.31
openSUSE Leap 15, SLES 15 2.31
CentOS 7 2.17

On those, and on ARM Linux, pip install kalast (Python 3.14) builds kalast from source instead, which needs Rust (https://rustup.rs) and a C compiler.

It also needs:

  • a graphical session, X11 or Wayland;
  • a GPU driver with Vulkan: Mesa for Intel and AMD, or NVIDIA's own;
  • for the file dialog, the desktop portal (xdg-desktop-portal), which GNOME and KDE have. Without it, type the path.

Packages

You can also install kalast as a package, in a Python virtual environment or a Rust project:

pip install kalast          # Python
cargo add kalast            # Rust

Repo structure

  • src/: Rust core. Written to be usable standalone by Rust users, independent of Python — the Python wrapper must not compromise its speed.
  • kalast/: Python wrapper. Provides Pythonic usage of Kalast (e.g. object references) for users less familiar with Rust. Built with maturin.
  • shaders/: wgpu shaders (.wgsl) used by the rendering pipeline.
  • examples/: Examples of usage of Kalast. Scripts under examples/old/ are earlier/superseded versions kept for reference, not maintained as user-facing examples.
  • res/: resources folder.
  • out/: default output directory for simulation results.

If you want to clone and compile it yourself

Create a virtual environment for the dependencies and the build — I recommend Astral's uv for Python. Then, from within your venv, run the following.

Build the kalast Rust extension, kalast/_rs.abi3.so (its name on macOS):

maturin develop

Build in debug (the default) while implementing features or fixing bugs. Use --release for benchmarks, and once a feature works.

maturin develop --release

Beyond the default opt-level = 3 there is nothing worth adding: lto = "fat" + codegen-units = 1 were measured on this project and gave no improvement. Recorded in Cargo.toml so it is not retried blindly.

The UI app can also be started from the Python module, here loading an example:

python -m kalast examples/two_spheres/main.py

Then import kalast from Python (or add the crate from Rust) and write your own scripts.

import kalast

Release files for kalast 0.5.9

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

Source distribution (sdist)

Source distribution for kalast 0.5.9
File Size Uploaded
kalast-0.5.9.tar.gz 975.4 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for kalast 0.5.9
File
kalast-0.5.9-cp314-abi3-win_amd64.whl CPython 3.14 abi3 Windows x86-64 Details
kalast-0.5.9-cp314-abi3-manylinux_2_35_x86_64.whl CPython 3.14 abi3 Linux glibc 2.35+ x86-64 Details
kalast-0.5.9-cp314-abi3-macosx_11_0_arm64.whl CPython 3.14 abi3 macOS 11.0+ ARM64 Details
kalast-0.5.9-cp314-abi3-macosx_10_12_x86_64.whl CPython 3.14 abi3 macOS 10.12+ x86-64 Details

Total release size: 40.1 MB

Release files / kalast-0.5.9.tar.gz

Download URL kalast-0.5.9.tar.gz
Size 975.4 kB
Tags Source
SHA-256 checksum
How to use checksums
8f52104c7694644de670fdb8c44f8514fc6046561e35ad9fb125449581b3ce0b
BLAKE2b-256 checksum
How to use checksums
2bf517033d920330d871b13940fd75904748cc2fc9df9887dee459e70f4760ce
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 24, 2026.

Transparency log

Release files / kalast-0.5.9-cp314-abi3-win_amd64.whl

Download URL kalast-0.5.9-cp314-abi3-win_amd64.whl
Size 9.1 MB
Tags CPython 3.14 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
5941e9e99040c04edd3e71af65d663f385258a860387f91e394a6821f7ea8809
BLAKE2b-256 checksum
How to use checksums
d689c2ebc7271b077ebcf4fdcf48cd0969cf9c044c846ba32265a2ebd8e18a58
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 24, 2026.

Transparency log

Release files / kalast-0.5.9-cp314-abi3-manylinux_2_35_x86_64.whl

Download URL kalast-0.5.9-cp314-abi3-manylinux_2_35_x86_64.whl
Size 12.5 MB
Tags CPython 3.14 Linux glibc 2.35+ x86-64 abi3
SHA-256 checksum
How to use checksums
128723a7d38b218edb48c856e8f098eed4fead40a6fc390f20c990faeffa83b4
BLAKE2b-256 checksum
How to use checksums
867b53b383247701673f347994c807eb10e2ce8eb74ec6e0955177d34978c574
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 24, 2026.

Transparency log

Release files / kalast-0.5.9-cp314-abi3-macosx_11_0_arm64.whl

Download URL kalast-0.5.9-cp314-abi3-macosx_11_0_arm64.whl
Size 8.5 MB
Tags CPython 3.14 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
02db90c9a770c29525f539bcafb00028ef48e0705fff413ca0e3d94956c9c045
BLAKE2b-256 checksum
How to use checksums
63949aae8dfd2651cb2e38477ee3702316e132ee08295da22e9c742232ed22a3
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 24, 2026.

Transparency log

Release files / kalast-0.5.9-cp314-abi3-macosx_10_12_x86_64.whl

Download URL kalast-0.5.9-cp314-abi3-macosx_10_12_x86_64.whl
Size 8.9 MB
Tags CPython 3.14 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
dd9ad47814decc187e33d1f0705e85f5f37a82826f86d9be5b8c377f52494071
BLAKE2b-256 checksum
How to use checksums
24e6490c9833bc3afd40b352297d17a1470d15b763bdb1c5bd51b6bfab8fc5d2
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 24, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.5.9 This release

5 release files

0.5.8

5 release files

0.5.7

5 release files

0.5.6

5 release files

0.5.5

5 release files

0.5.4

5 release files

0.5.3

5 release files

0.5.2

5 release files

0.5.1

5 release files

0.5.0

5 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