Pyralysis
PYthon Radio Astronomy anaLYSis and Image Synthesis
Regularized image reconstruction for radio interferometry — simulate an array, state χ² + regularizers, reconstruct on CPU or GPU. Not a black-box CLEAN.
Pyralysis is a Python library (Dask, optional CuPy) for simulation, gridding, and image reconstruction. You compose the objective; there is no hidden imager. Guides: Read the Docs.
You can
Simulate an observation
VLA, ALMA, or a custom antenna config; parametric or FITS sky models; thermal noise and gain injectors.
ALMA Band 6 (230 GHz) Cycle 9.8: Rayleigh–Jeans disk (core + four rings) and three compact sources — sky, uv coverage, visibility amplitudes.
Simulation ·
examples/scripts/simulation_components.py
Make a dirty map and PSF
Natural, uniform, or robust weights, then a dirty image and dirty beam.
Visibility weights ·
Gridding ·
examples/scripts/dirtymapper_components.py
Reconstruct a model
State χ² plus L1, TSV, or other regularizers; solve with FISTA, L-BFGS, or SDMM. The figures below are FISTA on χ² + L1 from zeros, natural weights.
Dirty image → FISTA model (Jy/pixel) → residual. Same ALMA disk simulation as above.
Iterates from a zero start.
Regenerate the gallery with python docs/scripts/generate_readme_figures.py.
Optimization ·
FISTA ·
examples/scripts/optimization_components.py
Image with closures, on GPU, or on a cluster
Closure-phase / closure-amplitude terms; the same stack on CuPy or a Dask cluster; read and write Measurement Sets, Zarr, and FITS.
Closures · Array backends · Pipelines · I/O
Notebooks without installing: Binder. How the pieces fit together: composability, flexibility, extensibility, adaptability.
Install
Python 3.11–3.13. The SKA extra index is required for a few dependencies.
pip install --extra-index-url https://artefact.skao.int/repository/pypi-internal/simple pyralysis[all]
GPU: micromamba create -f environment_cuda13.yml (Pascal: environment_cuda12.yml), then pip install -e .. Details: installation.
Minimal example
Simulate a point source, add thermal noise, make a natural-weighted dirty image:
from importlib.resources import files
from astropy import units as u
from pyralysis.io.antenna_config_io import AntennaConfigurationIo
from pyralysis.simulation import Simulator
from pyralysis.models.sky import PointSource
from pyralysis.injectors import ThermalNoiseInjector
from pyralysis.transformers.weighting_schemes import Natural
from pyralysis.transformers import DirtyMapper
cfg = files("pyralysis.simulation") / "antenna_configs" / "vla.c.cfg"
interferometer = AntennaConfigurationIo(input_name=str(cfg)).read()
interferometer.configure_observation(
min_frequency=1e9 * u.Hz, max_frequency=1.1e9 * u.Hz, frequency_step=1e7 * u.Hz,
right_ascension="12h00m00s", declination="45d00m00s",
integration_time=10 * u.s, observation_time="1h",
)
source = PointSource(
reference_intensity=1.0 * u.Jy, sky_position="12h00m00s 45d00m00s",
reference_frequency=1e9 * u.Hz,
)
dataset = Simulator(interferometer=interferometer, sources=source).simulate(create_dataset=True)
dataset = ThermalNoiseInjector(system_temperature=50, integration_time=10, channel_bandwidth=1e6).apply(dataset)
imsize, cellsize = 128, dataset.theo_resolution / 3.5
Natural(imsize=imsize, cellsize=cellsize, input_data=dataset).transform()
dataset.calculate_psf()
dirty, _beam = DirtyMapper(input_data=dataset, imsize=imsize, cellsize=cellsize, stokes=["I"]).transform()
Reconstruction (χ² + L1, FISTA, GPU) is the same composition as the figures — optimization, quickstart.
Links
Docs · API · Examples · Contributing · Changelog · Issues
@software{carcamo2021pyralysis,
author = {Miguel Cárcamo},
title = {Pyralysis: A Python framework for radio interferometric imaging and simulation},
year = {2021},
url = {https://gitlab.com/clirai/pyralysis},
note = {https://pyralysis.readthedocs.io/}
}
GPL-3.0-only — see LICENSE. Contact: miguel.carcamo@usach.cl
Metadata
Release files for pyralysis 3.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pyralysis-3.0.0.tar.gz | 15.8 MB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pyralysis-3.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 17.1 MB
Release files / pyralysis-3.0.0.tar.gz
| Download URL | pyralysis-3.0.0.tar.gz |
|---|---|
| Size | 15.8 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bb711673c8e74983bb3bc04a8e0362a33e81a0987cf81625aabfa04379cbff81
|
|
BLAKE2b-256 checksum How to use checksums |
6c9e942e28322d793ee85a513a608cfc0755834f2bf23bb776949586afa5e27a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.11.17
|
Release files / pyralysis-3.0.0-py3-none-any.whl
| Download URL | pyralysis-3.0.0-py3-none-any.whl |
|---|---|
| Size | 1.3 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
53511f74f8d850dd7aa6235e8d85b32bc0c2fa8e2d932868d4151a5149f0c3ec
|
|
BLAKE2b-256 checksum How to use checksums |
3c4e091426394f98a69dce79874f60f972d2b924856bf9dad3e7b5da91db8b4f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.11.17
|