Skip to main content

divtel: Divergent pointing mode for Imaging Atmospheric Cherenkov Telescopes arrays

Build status Python Version Semantic Versions License Documentation DOI

divtel makes toy simulations for the divergent pointing mode of Imaging Atmospheric Cherenkov Telescopes arrays.

Point an array's telescopes slightly away from one another and it sees a wider patch of sky, but fewer telescopes see any given part of it, and a shower needs at least two of them to be reconstructed stereoscopically. divtel lets you set up that trade-off and measure both sides of it.

Try it in your browser, sliders, no install.

👨‍💻 Install

pip install divtel

🚀 Quickstart

import astropy.units as u
import matplotlib.pyplot as plt
from divtel.telescope import Telescope, Array
from divtel.visualization import display_hyper_fov

# Four telescopes on a 100 m square, each with a ~5.7 degree camera.
array = Array([
    Telescope(x * u.m, y * u.m, 0 * u.m, focal=20 * u.m, camera_radius=1 * u.m)
    for x, y in [(100, 0), (0, 100), (-100, 0), (0, -100)]
])

# Point them divergently around a mean direction of alt=70, az=180.
array.divergent_pointing(0.02, 70 * u.deg, 180 * u.deg)

# How much sky does the array see, and how much of it stereoscopically?
covered, patches = array.hyper_fov()        # 45.96 deg2
stereo, _ = array.hyper_fov(m_cut=2)        # 30.27 deg2, seen by 2+ telescopes

fig, (ground, sky) = plt.subplots(1, 2, figsize=(11, 5))
array.display_2d(projection="xy", ax=ground)
display_hyper_fov(array, ax=sky)
plt.show()

Pointed in parallel (div=0) the same array sees 25.7 deg2, all of it at multiplicity 4. A div of 0.02 buys 79% more sky, of which 18% more is still stereoscopic. But a shower now lands on two telescopes where it used to land on four. That is the whole trade-off, and the user guide walks through it properly: the coordinate frame, what div really means, and how the hyper field of view is computed.

🛠 Development

Install from source

With uv (recommended):

git clone https://github.com/cta-observatory/divtel.git
cd divtel
uv sync

uv sync creates a virtual environment in .venv, installs divtel in editable mode, and pulls in the development dependencies (pytest, sphinx, ruff) declared as PEP 735 dependency groups. Add --extra examples if you also want to run the notebooks in examples/.

With pip (requires pip >= 25.1 for --group):

git clone https://github.com/cta-observatory/divtel.git
cd divtel
pip install -e . --group dev

Then run the tests:

pytest

Note: install divtel before importing it, even from a source checkout. The version is derived from git by setuptools_scm at install time and written to divtel/_version.py; importing an uninstalled source tree reports __version__ == "0.0.0".

Building the documentation

The docs are published to https://cta-observatory.github.io/divtel/. To build them locally:

uv sync --group docs --extra examples
sphinx-build -b html docs docs/_build/html

GitHub Pages serves static files only, so it cannot preview the result: file:// will not work, and the interactive demo needs a real HTTP origin. Serve the build instead:

python -m http.server 8000 -d docs/_build/html

Working on the interactive demo

examples/marimo/interactive_display.py is a marimo notebook. Sphinx exports it to WebAssembly during the build, so the published page ships its own Python interpreter and runs entirely in the reader's browser — sliders included, with no server and nothing to install.

That export shells out to uv, which is why uv is itself a documentation dependency.

The Jupyter version in examples/notebooks/interactive_display.ipynb is kept for running locally, but is deliberately not built into the site: its ipywidgets sliders need a Python kernel, so on a static page they would render as controls that cannot move.

To work on the demo:

marimo edit examples/marimo/interactive_display.py

🛡 License

License

This project is licensed under the terms of the MIT license. See LICENSE for more details.

📃 Citation

@software{thomas_vuillaume_2022_6415138,
  author       = {Thomas Vuillaume and
                  Alice Donini and
                  Thomas Gasparetto},
  title        = {cta-observatory/divtel: v0.1},
  month        = apr,
  year         = 2022,
  publisher    = {Zenodo},
  version      = {v0.1},
  doi          = {10.5281/zenodo.6415138},
  url          = {https://doi.org/10.5281/zenodo.6415138}
}

Metadata

Release files for divtel 1.0.0

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

Source distribution (sdist)

Source distribution for divtel 1.0.0
File Size Uploaded
divtel-1.0.0.tar.gz 95.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for divtel 1.0.0
File Interpreter ABI Platform
divtel-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 139.4 kB

Release files / divtel-1.0.0.tar.gz

Download URL divtel-1.0.0.tar.gz
Size 95.9 kB
Tags Source
SHA-256 checksum
How to use checksums
3459b4db2b7e0d21912f71ebc548b4ecb9e62cc8f0bb3472dca814a9f0616b46
BLAKE2b-256 checksum
How to use checksums
6b509faac9cb5e318fdb864372622453086ebb7f0b9c5bd871c38d19076b80fd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / divtel-1.0.0-py3-none-any.whl

Download URL divtel-1.0.0-py3-none-any.whl
Size 43.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1b2c18dbbfed6db744516bf03a6aa4f6e1b350423d5b60f5caadaa49dcbc9ea0
BLAKE2b-256 checksum
How to use checksums
4bb88c2e74f77da9a25219c92f07c6bccc4dd5d990f559889f2579d455687c4d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release history Release notifications | RSS feed

1.1.0

2 release files

This release

1.0.0 This release

2 release files

0.1

1 release file

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