CROISSANT: spheriCal haRmOnics vISibility SimulAtor iN pyThon
CROISSANT is a rapid visiblity simulator in python based on spherical harmonics. Given an antenna design and a sky model, CROISSANT simulates the visbilities - that is, the perceived sky temperature.
CROISSANT uses spherical harmonics to decompose the sky and antenna beam to a set of coefficients. Since the spherical harmonics represents a complete, orthormal basis on the sphere, the visibility computation reduces nicely from a convolution to a dot product.
Moreover, the time evolution of the simulation is very natural in this representation. In the antenna reference frame, the sky rotates overhead with time. To account for this rotation, it is enough to rotate the spherical harmonics coefficients. In the right choice of coordinates (that is, one where the z-axis is aligned with the rotation axis of the earth or the moon), this rotation is simply achieved by multiplying the spherical coefficient by a phase.
New in version 5.0.0: CROISSANT is now fully based on JAX and legacy support for numpy/healpy code is dropped. Spherical harmonics transforms (built on s2fft), coordinate system transforms, rotations, and the simulator itself can now all be differentiated using JAX autograd.
Overall, this makes CROISSANT a very fast visibility simulator. CROISSANT can therefore be used to simulate a large combination of antenna models and sky models - allowing for the exploration of a range of propsed designs before choosing an antenna for an experiment.
Installation
To install the package for standard use, you can use your preferred Python package manager:
Using uv (Recommended)
uv pip install croissant-sim
Using pip
pip install croissant-sim
Note that croissant is only tested up to Python 3.12. Python 3.13 and newer versions are experimental.
Development
We recommend using uv to manage the development environment. It is exceptionally fast and handles virtual environments, dependencies, and lockfiles automatically. However, standard pip workflows are also fully supported.
1. Set Up the Environment
Option A: Using uv (Recommended)
uv will automatically read the pyproject.toml, create a virtual environment (.venv), and install all core and development dependencies.
# Clone the repository
git clone git@github.com:christianhbye/croissant.git
cd croissant
# Sync the project and install all dependencies
uv sync
Option B: Using pip
If you prefer standard Python tools, you will need to manually create the environment and install the package in editable mode.
# Clone the repository
git clone git@github.com:christianhbye/croissant.git
cd croissant
# Create and activate a virtual environment
python -m venv .venv
source .venv/bin/activate
# Install the package in editable mode with development dependencies
pip install -e .
pip install -r requirements-dev.txt
2. Install Pre-commit Hooks
We use pre-commit to automatically format and lint code before every commit. This ensures all code follows our style guidelines (enforced by ruff).
With uv:
uv run pre-commit install
With pip:
pre-commit install
3. Running Tests and Linters
We use pytest for testing and ruff for linting and formatting. Prepend these commands with uv run if using uv.
pytest # Run the test suite
ruff format # Auto-format code
ruff check --fix # Run linter and fix auto-fixable errors
Demo
Jupyter Notebook: https://nbviewer.org/github/christianhbye/croissant/blob/main/notebooks/example_sim.ipynb
Contributing
Contributions are welcome - please see the contribution guidelines.
Metadata
Release files for croissant-sim 5.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| croissant_sim-5.2.1.tar.gz | 18.8 MB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| croissant_sim-5.2.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 18.8 MB
Release files / croissant_sim-5.2.1.tar.gz
| Download URL | croissant_sim-5.2.1.tar.gz |
|---|---|
| Size | 18.8 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a36f2a93e64c0d6c1a6036f6d5e32cc6935c7c8f156b657e152912cefcd580ca
|
|
BLAKE2b-256 checksum How to use checksums |
05da07136830000d1812674d8aed468a616fad2dbcf76e0dfcaf55e52ba38172
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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 Apr 6, 2026.
Transparency logRelease files / croissant_sim-5.2.1-py3-none-any.whl
| Download URL | croissant_sim-5.2.1-py3-none-any.whl |
|---|---|
| Size | 24.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3ece4d0de5a9fcaa60814758a55c51cf9239c0b34dbd8c7c8ef5f3f15d0a534f
|
|
BLAKE2b-256 checksum How to use checksums |
b0fcadc45ee730a59b010fa901b5b77545dffcd501eb20dbee6c06313391c92d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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 Apr 6, 2026.
Transparency log