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.

Download the latest version of kalast here. You can directly run the executable and open an example script from the UI. Or use it in your browser, nothing to install, at kalast.greghy.com: the same UI app, computing on your machine (a browser with WebGPU: a recent Chrome, Edge or Safari). In Chrome or Edge it can work in a folder of yours, where a script's data goes. It is the latest release; offer betas, in its app tab, opens the beta.

Kalast focus is doing sciences with highest performance possible (core written in Rust + GPU/shaders) while being accessible by everyone (wrapper written in Python + UI).

The kalast UI app

Four Mars Express HRSC SRC images of Phobos, drawn by kalast and through the camera's response

Four Mars Express HRSC SRC images of Phobos (top), drawn by kalast with the light of Mars and a bounce (middle), and as the camera would record kalast's (bottom): examples/phobos_shadows_fit.

You can also run it in your terminal:

./kalast                                        # starts the kalast UI app
./kalast examples/crater_self_shadow/main.py    # load a Python example
./kalast examples/crater_self_shadow/main.rs    # load a Rust example
./kalast res/plane_crater_1024-5000_h=0.437.obj # load a mesh

More info on Running kalast for the first time. There are also additional resources to read, here or in the documentation tab of the UI app:

You can also write me an email at gregoireh@pm.me if you have any question or want any feature added.

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.

Running kalast for the first time

Kalast carries its own Python. Rust examples .rs 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/ next to the executable.

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 until it is flagged cleared, use:

xattr -cr /path/to/kalast-v*-*

Then double-click kalast.app in that folder to open the UI app; ./kalast runs it from a terminal.

Write your own scripts in scripts/. examples/ holds kalast's examples, which each update replaces: an example you changed or added there is first moved, whole, to scripts/backup/before-v<version>/.

Kalast is also available as a PyPI package and as a crate.

pip install kalast          # Python -- do this in a venv, you can use astral uv
pip install "kalast[editor]"  # the same, with ty for the UI app's script editor
cargo add kalast            # Rust

Linux requirements

  • glibc >= 2.35

If you want to clone and compile it yourself

  • 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. examples/old/ are earlier/superseded versions kept for reference, not maintained
  • res/: resources folder.
  • out/: default output directory for simulation results.

Create a virtual environment for the dependencies and the build. I recommend Astral's uv. Then, from within your venv, run the following to build kalast DLL for python kalast/_rs.abi3.so (its name on macOS):

maturin develop

Build in debug (the default) while implementing features or fixing bugs. But 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.

The UI app can also be started from the kalast python module:

python -m kalast examples/two_spheres/main.py

Credits

The UI app's icons are VS Code's Codicons (CC BY 4.0) and Catppuccin's icons for VS Code (MIT); their licences are in src/app/gui/assets/.

Metadata

Release files for kalast 0.5.15

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.15
File Size Uploaded Provenance Actions
kalast-0.5.15.tar.gz 3.9 MB With provenance Details for kalast-0.5.15.tar.gz

Built distributions (wheels)

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

Total release size: 93.9 MB

Release files / kalast-0.5.15.tar.gz

Download URL kalast-0.5.15.tar.gz
Size 3.9 MB
Tags Source
SHA-256 checksum
How to use checksums
f5189613c554d99e9e8d8007fdd9d8a8a18d0f0e6c59652d1d2f7052d4117da6
BLAKE2b-256 checksum
How to use checksums
f3796e5823f55d7936eaea7b36436d9875936c5986b56755d33f4977f7c9284d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 23, 2026.

Transparency log

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

Download URL kalast-0.5.15-cp314-abi3-win_amd64.whl
Size 21.9 MB
Tags CPython 3.14 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
8ecc40f9c89261c4f55da88a0f6c6e85e4d69d1f7e89e1a6bfbebdc68f5bf76c
BLAKE2b-256 checksum
How to use checksums
bda04a2eb3b109acc59030d7cd9f643ea6763bcfb6bcd5df919f254dc879918a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 23, 2026.

Transparency log

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

Download URL kalast-0.5.15-cp314-abi3-manylinux_2_35_x86_64.whl
Size 25.2 MB
Tags CPython 3.14 Linux glibc 2.35+ x86-64 abi3
SHA-256 checksum
How to use checksums
c5f0c556120156991405780f7c55c09f9a2b883f28d0418179cb38d61125fdb7
BLAKE2b-256 checksum
How to use checksums
42d32636381022a7c4f7b90a45a311e3813889fa2ee372767eb17e07ec2905f4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 23, 2026.

Transparency log

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

Download URL kalast-0.5.15-cp314-abi3-macosx_11_0_arm64.whl
Size 21.3 MB
Tags CPython 3.14 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
26d8c6d2d677089b7f93ff3c5f7acf86153ac406e05de4845f9c76720b9fe925
BLAKE2b-256 checksum
How to use checksums
33055bad80527cb382ac8d7331b0267bbb98f20579ed093538bfe73a24228060
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 23, 2026.

Transparency log

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

Download URL kalast-0.5.15-cp314-abi3-macosx_10_12_x86_64.whl
Size 21.5 MB
Tags CPython 3.14 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
5b17e6d991869d8f70a3f1aeb76bd906cd0f233d603933da1acfb23dcbebca69
BLAKE2b-256 checksum
How to use checksums
7c420af3acfadfcb0660d69a42efcdf7cc1d41793d99cb40c389797e6ea20280
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 23, 2026.

Transparency log

Security for kalast 0.5.15

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.

Full provenance

All 5 files in this release have been uploaded with provenance metadata.

Select from 5 files

Attestation for kalast-0.5.15.tar.gz

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 Nov 23, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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