Spotless
raw JSON → 0.4.1 verified Sat May 09 auth: no python
Spotless is a Python library for grid-free deconvolution directly from radio interferometry visibilities. It implements the "DoB-CLEAN" algorithm for reconstructing sky images without gridding. The current version is 0.4.1. Release cadence is low, with occasional updates.
pip install spotless Common errors
error ModuleNotFoundError: No module named 'spotless' ↓
cause Package not installed or installed in wrong environment.
fix
Run: pip install spotless
error AttributeError: module 'casa' has no attribute 'table' ↓
cause Missing casacore or python-casacore dependency for reading Measurement Sets.
fix
Install casacore: pip install casacore
error ValueError: u, v, freq, vis, weights must have compatible shapes ↓
cause Input arrays dimensions mismatch (e.g., u and v have different lengths).
fix
Ensure all input arrays are 1D and have the same length (number of baselines * times * frequencies).
Warnings
gotcha Python version: Ensure Python 3.6+ is used. Spotless may not work with Python 2 or older versions. ↓
fix Use Python 3.6 or higher.
gotcha Measurement Set requires casa-formatted data. If loading from other formats, conversion to MS is necessary. ↓
fix Use casacore or other tools to convert to MeasurementSet.
gotcha Numpy version compatibility: Older numpy versions may cause issues. Use numpy >= 1.16. ↓
fix Upgrade numpy via pip install --upgrade numpy
Imports
- SpotlessImager wrong
from spotless.imager import SpotlessImagercorrectfrom spotless import SpotlessImager - load_measurements
from spotless import load_measurements
Quickstart
from spotless import SpotlessImager, load_measurements
import numpy as np
# Load visibilities from a Measurement Set
ms_path = 'path/to/measurement_set.ms'
u, v, freq, vis, weights = load_measurements(ms_path)
# Create imager and run deconvolution
imager = SpotlessImager()
sky = imager.run(u, v, freq, vis, weights, npix=512, cellsize=0.1)
print('Reconstructed sky shape:', sky.shape)