Skip to main content

CROISSANT: Rapid spherical harmonics-based simulator of visibilities

Project description

# CROISSANT: spheriCal haRmOnics vISibility SimulAtor iN pyThon

[![codecov](https://codecov.io/gh/christianhbye/croissant/branch/main/graph/badge.svg?token=pj1hkgcazd)](https://codecov.io/gh/christianhbye/croissant)

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.

In frequency domain, CROISSANT uses Discrete Prolate Spheroidal Sequences as a rapid linear interpolation scheme. Being linear, this interpolation can be done directly on the spherical harmonics coefficients, avoiding redoing the most expensive part of the computation.

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 4.0.0: CROISSANT is now fully compatible with JAX, provided in the interfeace croissant.jax. Spherical harmonics transforms (built on [s2ftt](https://github.com/astro-informatics/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 For the latest release, do pip install croissant-sim (see https://pypi.org/project/croissant-sim). Git clone this repository for the newest changes (this is under activate development, do so at your own risk!).

To access the JAX features, JAX must also be installed. See the [installation guide](https://github.com/google/jax#installation).

Note that croissant is only tested up to Python 3.12. Python 3.13 and newer are not yet supported.

## Demo Jupyter Notebook: https://nbviewer.org/github/christianhbye/croissant/blob/main/notebooks/example_sim.ipynb

## Contributing Contributions are welcome - please see the [contribution guidelines](https://github.com/christianhbye/croissant/blob/add_contributing/CONTRIBUTING.md).

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

croissant_sim-4.1.0.tar.gz (18.3 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

croissant_sim-4.1.0-py3-none-any.whl (45.2 kB view details)

Uploaded Python 3

File details

Details for the file croissant_sim-4.1.0.tar.gz.

File metadata

  • Download URL: croissant_sim-4.1.0.tar.gz
  • Upload date:
  • Size: 18.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for croissant_sim-4.1.0.tar.gz
Algorithm Hash digest
SHA256 336733cec42e87dac2d3f2c8df4a6757869f8eea5aec47e607bb1a0d9c10536f
MD5 e29a710ced2615dd6d388e83570a55fc
BLAKE2b-256 de1cfa35d714fca462b91ac2141409b0385bee2597d47592481608ba27e75732

See more details on using hashes here.

File details

Details for the file croissant_sim-4.1.0-py3-none-any.whl.

File metadata

  • Download URL: croissant_sim-4.1.0-py3-none-any.whl
  • Upload date:
  • Size: 45.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for croissant_sim-4.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f086741675e37c01f8ce8b2f4517087fda219b199799bafa02b566c13a60dbcb
MD5 08cd1a909c0ed38a4d1a37037e4117cd
BLAKE2b-256 3534be7d1fbd9e70b789f9b2bdd1bed742b321aed06fb1f56e246532ec0b8574

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page