WorksPhysics and Astronomy
radio-astro-tools: linking radio astronomical data to the astronomical Python ecosystem
Abstract
We present the radio-astro-tools code suite, which consists of several Python packages that enable analysis of radio data, especially interferometric spectral cubes, in the context of the Astropy software ecosystem. While these tools were designed with radio data in mind, they are built to be general and have applications on data sets at other wavelengths. The core package, spectral-cube, handles reading, writing and analysis of cube data, and it enables straightforward parallelization via dask and joblib backends. Support packages include casa-formats-io and radio-beam, which handle reading of CASA tables & images and reading and manipulation of point spread functions, respectively. The pvextractor package facilitates creation of position-velocity diagrams. The uvcombine package implements the "feather" algorithm for combining single-dish and interferometric data. The development of radio-astro-tools included several contributions to other repositories, including matplotlib, astropy, and regions to support interaction between CASA and other parts of the astronomy software ecosystem. We also present a detailed set of tutorials written in Jupyter notebooks that can be run interactively in a browser, providing more accessible access to data analysis for radio spectral-line data cubes.
Introduction
Multiwavelength astronomy is now commonplace, especially in the current era of astronomical surveys and queue observing, in which specialization in observing in a given wavelength regime is not needed to obtain data. Additionally, there have been significant efforts by observatories to deliver science-ready data products to astronomers, further lowering the barrier to using multiwavelength data for astronomers with a wide range of expertise. The delivery of data from different wavelengths with different instruments but common assumptions about locations on the sky and the energy of photons drove the development of standardized world coordinate systems (WCS) ([1, 2]), providing the framework to combine these observations for analyses. Astronomy now faces the need to handle increasingly large data volumes, and to ideally provide tools that can scale across computing infrastructures to tackle a wide range of analyses.
Data cubes are a clear example in which large data volumes push the limits of existing software and computing resources. These cubes are now in common use among astronomers of all wavelengths, typically on a regular grid including two spatial directions and a spectral dimension (thus every spatial pixel has an associated spectrum). In radio interferometry, the natural product of any observation is a data cube, since both spatial and spectral data are obtained simultaneously in the standard observing mode. Radio wavelength imaging from single-dish telescopes has also naturally leaned toward cube making, often using on-the-fly (OTF) mapping to map out large areas (Mangum et al. [3]). In optical and infrared observing, obtaining spectra of fully sampled areas on the sky has only recently become possible, requiring either a Fourier-domain observation of a large patch of the sky with Fabry-Perot interferometers (e.g., Reynolds et al. [4]) or integral field units (IFUs, e.g., MUSE, SINFONI, GMOS, SAURON, OSIRIS, NIRSPEC and MIRI on JWST, SDSS-V LVM; [5, 6, 7, 8, 9, 10] (Wright et al. 2023; Drory et al. 2024; Konidaris et al. 2024)). Across wavelengths, these data cubes can be large, spanning to >100s GB, and with ALMA’s Wideband Sensitivity Upgrade (Carpenter et al. 2023), SKA pathfinders like MeerKAT, and the forthcoming ngVLA and SKA, these are expected to continue to grow by orders of magnitude in the upcoming decade.
Therefore, the widespread distribution of these imaging products creates a need for fast, memory-efficient tools to read, write, and analyze such data cubes. In particular, we need tools that allow future development to focus on
[email protected] [email protected] methodology, improved algorithms, and techniques rather than basic file handling and low-level processes.
Here we present radio-astro-tools1: a collection of Python packages built on the scientific Python ecosystem that enable memory-efficient analyses of data cubes and their associated products. Section § 2 lists the packages that are part of the radio-astro-tools ecosystem. Section § 3 discusses how developers might use radio-astro-tools. Section § 4 lists the tutorials created to help users learn these tools. And Section § 5 details the key parts within the broader Astropy ecosystem that enable radio-astro-tools.
Relationship to CASA
CASA (CASA Team et al. 2022) is one of the core package for radio astronomy data reduction and analysis, having supplanted AIPS in the early 2000’s for VLA data and always being the main tool for ALMA. CASA contains many tools for cube and image analysis, which are the primary purpose of radio-astro-tools that we highlight here. While the core CASA tasks are particularly computationally efficient, the layered nature of the CASA architecture means that most calculations occur at the lower C++ layer with underlying source code that is opaque to many astronomers. In addition, the CASA’s task-based Python interface means that intermediate products must be written to disk to chain multiple operations together.
With community development of standard astronomical Python packages, including astropy (Astropy Collaboration et al. 2013, 2018, 2022), many astronomers now commonly use and are familiar with the scientific Python stack. Within the monolithic CASA distribution, CASA users face challenges with varying Python package versions and difficulty installing custom packages into CASA’s Python interface. Recent CASA distributions in modular form, and installable via standard Python tools like pip, ease these issues and enable users to directly interface with the rest of the scientific Python ecosystem. In many cases, astropy has a key role in linking astronomy to other scientific packages. radio-astro-tools furthers this link to the common CASA analysis tools that radio astronomers are most familiar with.
Relationship to astropy
radio-astro-tools is intended to be a radio astronomer’s entry into the Astropy ecosystem. Details of how radio-astro-tools and astropy are integrated are given in § 5. A substantial fraction of the radio-astro-tools project effort directly contributed into the core astropy package to provide compatibility tools or performance enhancements needed for radio astronomy work. Some of the radio-astro-tools packages are astropy-affiliated2. Since the inception of radio-astro-tools, some of the functions built into its packages have been incorporated into astropy core (e.g., the NDData system). The long-term vision for radio-astro-tools is that its code will be refactored to use more of the NDData system, but the interfaces provided by its packages will remain unchanged, such that a user of a package today should be able to rely on having access to the same commands and tools indefinitely.
radio-astro-tools packages
radio-astro-tools3 is comprised of several Python packages: the main spectral-cube package and several lightweight packages that support specific operations or visualization for radio data. In this section, we describe the purpose and capabilities of each package. We provide a guide for translating between operations in CASA and radio-astro-tools on our tutorial page4 to aid radio astronomers.
spectral-cube
spectral-cube is the primary radio-astro-tools package that enables fast and flexible I/O operations with most common analysis methods backed by the Astropy ecosystem. The primary goal of spectral-cube is the seamless handling of larger-than-memory spectral data cubes, and the ability to scale processing from a user’s local computer to larger jobs on computing clusters.
Users interact primarily with the SpectralCube class, which handles reading different data formats and types of spectral cubes. For example, spectral-cube handles data cubes with varying spatial resolution (i.e., the beam varies between each spectral channel) as is expected for wide-bandwidth coverage and spectral scan data.
spectral-cube also offers basic support and handling for 4-dimensional full Stokes’ cubes building on the astropy stokes WCS framework. This allows spectral-cube to support the gamut of polarizations used for the vast majority feed configurations offered by radio telescopes. This support also enables simple conversions between different polarization bases while leveraging spectral-cube’s efficient memory handling.
Finally, we highlight that spectral-cube has a thorough testing suite to check all operations in the package. Users can access more information and documentation at spectral-cube.readthedocs.io.
We present an overview of how to integrate spectral-cube into new packages (§3), present tutorials with worked examples (§4), and describe further uses of spectral-cube with the accompanying packages described below (§5).
spectral-cube provides easy handling for common operations and analyses of spectral data cubes. This includes the following:
Basic arithmetic between cubes with matching WCS coordinates.
Handling of cube units, including intensity units that are specific to radio-astronomy, such as Janskys per beam (Jy/beam) or brightness temperature (K). Spectral units conversion (e.g. from Hz to km/s) are also supported.
Signal and noise masking. The masking framework is flexible and includes new mask creation, mask combination, and passing/combining with pre-made masks. Operations such as sigma-masking can also be used.
Spatial and spectral region extraction using pixel indices, WCS coordinates, and DS9/CRTF defined regions.
Moment map calculation (zeroth, first, second, Nth moments) and other common projection methods including the maximum, minimum, and spectral value at max/min brightness (e.g., velocity at peak temperature).
Spectra and projection visualization.
Spatial convolution to a set Gaussian beam size (using
radio-beam; § 2.2), median smoothing and smoothing to an arbitrary kernel type usingastropy.convolution.
Spectral smoothing with
astropy.convolutionkernels and resampling to a new spectral axis.
Spatial and spectral reprojection to a given FITS header using the
reprojectpackage.
Support for full-Stokes spectral cubes.
Integration with visualization packages that include glue5 ((Robitaille et al. 2017)), yt6 ((Turk et al. 2011)) and DS97 ((Smithsonian Astrophysical Observatory 2000)), with future plans to integrate with CARTA8 ((Comrie et al. 2021)).
These operations are implemented to read in and compute the data cube in chunks, thereby avoiding reading the entire data cube when handling large data. For operations where this is not easily done, users are warned of operations that could exceed memory limits and given the option to disable this behavior.
radio-beam
Interferometric data are generally imaged using a variant of the CLEAN algorithm ((Högbom 1974)), which produces final images consisting of a model convolved with a synthesized point spread function, generally called the ‘clean beam’ or ‘synthesized beam’. radio-beam9 is a toolkit for working with standard Gaussian clean beams. It can read and write both single beams and per-channel beams for cubes, and includes operations for convolution, deconvolution and unit conversions (e.g., Jy/beam to K). It also includes a general algorithm for determining the smallest common beam for convolution of a data cube to a common resolution by solving for the minimum enclosing ellipse given a set of ellipses. Appendix A provides further details on the algorithm.
radio-beam also includes helpful visualization routines, including plotting the beam shape on to matplotlib figures (see Figure 1).

Figure 1. Example of plotting a beam with radio-beam.
casa-formats-io
CASA natively writes data into directories that contain tabular data, and along with metadata, this format is used for both data cubes, images, and visibility data (typically referred to as measurement sets in CASA). The CASA format has historically only been readable by casacore10 ((Casacore Team 2019)), which is a library written in C with bindings available in several other languages. casacore does many things besides file reading, though, and can be challenging to install11.
To overcome this limitation and provide an interface that optimally leverages other packages in the Python ecosystem, we provide casa-formats-io12, a table reader for CASA data formats written in Python and C (though all user-facing functions are in Python). casa-formats-io is cross-platform, operating on Unix, Windows, and macOS operating systems, and uses dask (Dask Development Team 2016) to lazily load the data following CASA’s chunking scheme. To our knowledge, casa-formats-io is the first CASA format reader that will work on Windows operating systems.
For data cubes and images, casa-formats-io loads CASA tables as Dask Arrays. For example, with spectral-cube, users load and manipulate data cubes with no difference in syntax, apart from specifying the CASA format for the input data upon reading the data.
For visibility data, casa-formats-io loads CASA tables as Astropy Tables13, providing access to an extensive library for tabular data handling. In this way, CASA measurement sets can now natively read with a wider variety of visualization and analysis tools, including glue.
uvcombine
Interferometric observations do not fully sample the Fourier plane of the sky; they intrinsically leave a gap at the center of the domain, which is referred to as ‘short spacing’ or the ‘DC component.’ To account for missing flux from the short spacing information, observations taken with a single filled-aperture telescope (‘single-dish’) can be combined with interferometric images. CASA provides a tool for the Fourier-space combination of interferometric and single-dish images in the feather task. The uvcombine14 package provides a Python-based implementation of the same algorithm. Our implementation includes additional configurable options, can process a wider variety of input data types, and converts between different units in the input data.
uvcombine also includes tools to estimate the flux scaling factors between the single-dish and interferometric data, as described in Stanimirovic (2002) and Koch et al. (2018), see Appendix § 7. These tools compare the relative flux at scales that both data sets are sensitive to, which is necessary to test whether the flux calibrations applied are consistent or whether a correction factor should be applied (more often to the single dish data).
We test uvcombine against CASA’s feather task and find consistent results. Appendix § 8 shows the agreement between both methods using a synthetic fractal image, where the differences are negligible for any reasonable level of observational noise and flux scaling uncertainty. Applications to feathering real data are consistent with this synthetic example, (e.g., Koch et al. 2025).
pvextractor
Position-velocity diagrams are two-dimensional slices through three-dimensional data cubes, where the third dimension is spectral and can generally be interpreted, for a given observed emission or absorption line, as Doppler-shifted velocity of gas. The pvextractor package15 allows users to produce slices along arbitrary paths. It also allows averaging perpendicular to the selected paths. Slice paths can be specified in pixel or world coordinates and can be produced either programmatically or through the PVSlicer GUI. pvextractor is incorporated into the glue package.
Additional packages and functionality from radio-astro-tools
statcont
statcont was developed to enable estimation of the continuum flux from complex “line-forest” data sets and is described in full in Sánchez-Monge et al. (2018). The original package used only astropy.io.fits and required loading the entire data set into memory. We have added a capability to use statcont with spectral-cube, which enables running statcont on cubes that are larger than the computer’s memory. We note that a key part of this process was significant performance enhancements to the astropy.stats.sigma_clip implementation.
Interactive drawing in astropy regions
Figure 2. Static images of interactive region drawing with matplotlib and regions. Left: Square region on a blank canvas (Interactive Version). Right: Square region projected onto an image (Interactive Version). Examples from D. Homeier and D. Stansby.
The regions package16 is an Astropy coordinated package and is not direct part of radio-astro-tools, however, it contains some functionality that was developed alongside radio-astro-tools and is familiar to CASA users.
regions supports reading and writing the CRTF file format (CASA Region Text Format) which is used internally by CASA to specify regions of interest. This enables reading in regions created in the CASA viewer or CARTA that similarly support CRTF (Comrie et al. 2021), and conversions to the also-popular DS9 region format.
With interactive region drawing supported via matplotlib (Hunter 2007), regions supports interactive drawing and manipulation of regions within a Jupyter notebook or IPython terminal, where the region can be exported with the corresponding WCS information. One major use case for this functionality is the ability to interactively draw and save region files that can be reproducibly used as clean masks, for example with CASA’s iclean and tclean tasks.
Using radio-astro-tools for development of other packages
The radio-astro-tools packages are ideally suited to handle I/O operations in other Python packages. This is a significant strength given the efficient larger-than-memory data handling in spectral-cube and parallelization of operations with the dask integration that users can build upon. We include an example use case in our set of tutorials demonstrating how spectral-cube and dask can parallelize fitting a Gaussian model to every spectrum in an ALMA data cube, loading only small chunks into memory at a time (§ 4). This example overcomes an often-faced issue for some spectral cube modeling tools, which converted standard cube file formats (FITS, CASA image) to non-standard forms (pickle or text file) to boost performance. spectral-cube removes the need for these extra conversion and I/O steps to allow researchers to focus on algorithmic innovations related to the science or analysis goal.
Figure 3 shows a visual example of spectral cubes using the dask backend. dask provides the ability to define differently shaped chunks that, depending on the analysis operation, may be more efficient when loading in chunks of the data. For example, operations on individual spectra (e.g., spectral smoothing, regridding, and fitting) are the most efficient loading in individual or groups of spectra. In contrast, operations on the spatial axes (e.g., spatial convolution) are most efficient loading in individual channels in the data cube. spectral-cube provides the necessary links for users to quickly rechunk their data, including using intermediate temporary files with zarr17, and efficiently perform a wide variety of analyses. Our tutorials on reprojecting data cubes provide an example of this functionality (§ 4).

Figure 3. Examples of rechunking a data cube to optimize for spectral and spatial operations (top, middle), and passing a custom chunk shape (bottom) using the dask integration in spectral-cube.
The spectral-cube documentation18 includes further information and recommended practices for incorporating radio-astro-tools for development in other packages.
We note that radio-astro-tools is already used in a number of calibration, imaging and analysis pipelines. Ex-
Examples include ALMA (e.g., ALMA-IMF19; PHANGS20; ALMA-JELLY; ACES21; COMPASS22; sSCALES; Ginsburg et al. 2021; Leroy et al. 2021; Souchereau et al. 2025; Ginsburg et al. 2026; Jørgensen et al. 2026, Leroy et al. in prep;), GBT (GAS23; DEGAS24 Friesen et al. 2017, , Kepley et al. in prep.), ASKAP (e.g., GASKAP; Pingel et al. 2021) and VLA (e.g., LGLBS25 Koch et al. 2025) large programs, and the calibration pipeline for Apertif (Apercal; Adebahr et al. 2022).
glue
The glue visualization and analysis toolkit uses many components of the radio-astro-tools package both for reading files and for analysis. For example, the position-velocity extraction in glue directly uses pvextractor. Using casa-formats-io, we have demonstrated that CASA tables can be loaded into glue, enabling direct analysis of measurement sets. This functionality is available in the development version, but this remains experimental.
Tutorials
We have written a series of tutorials with fully-worked analyses for common operations of spectral-line data cubes. The tutorials are written as Jupyter notebooks and can be accessed and run interactively in a web browser using Binder26 with data hosted on Zenodo27 and the ALMA data archive. This completely removes the need to both install various packages and local downloading of data. Additionally, two of our tutorials are incorporated into the astropy learn project28. These tutorials are written at a suitable level for senior undergraduate or graduate students, or astronomers seeking to become more familiar with analyzing radio astronomy data. The tutorial set is intended to provide a common source on often-used analysis routines that are either available in other software without a pedagogical example, or are commonly re-invented based on literature sources (e.g., cases where graduate students often re-write the same algorithms for a common purpose).

Figure 4. Example position-velocity diagram (right) and trace (left) produced in our astropy learn tutorial. The white rectangles shown in the left figure are extracted from the data cube and spatially averaged. The average spectrum is shown in intensity as a vertical slice in each column of the right panel.
The tutorial site29 is hosted on GitHub and hosts rendered versions of the tutorials, download links to the notebooks on GitHub, and direct links to open interactive sessions of the tutorials on Binder. The current tutorial set includes:
Fitting spectral line and spatial models using
spectral-cubeandastropy.modeling.
A guide to
spectral-cubefor CASA users.
Signal-masking and calculating moment maps from spectral cubes.
Parallel fitting of spectral line models with
spectral-cube,astropyanddask.
Creating and plotting Position-velocity (PV) diagrams.
Identification of the far 3 kpc arm in the Dame et al. (2001) all-sky CO map, reproducing the results from Dame and Thaddeus (2008).
Position-velocity (PV) diagram of a protoplanetary disk using public data from the MAPS ALMA large program30 (Öberg et al. (2021)).
Reprojecting two data cubes to a common resolution, projection and pixel grid.
Reprojecting two data cubes and applying a signal mask from one cube to another.
We plan on expanding this suite of tutorials and welcome community-contributed tutorials, which we strongly encourage to be submitted and incorporated into the astropy learn project.
The integrated ecosystem for radio astronomy
The radio-astro-tools project aims to integrate the radio astronomy analysis tools with the rest of the astronomical Python ecosystem. To achieve this goal, we supply the tools for reading, manipulating, and writing astronomical images, cubes, spectra, and regions of interest from a wide variety of data sources. In this section, we summarize important links between the astronomical Python ecosystem and their integration with radio-astro-tools packages.
Reprojecting images with reproject
Pixel-by-pixel comparison of data from different observations with varying pixel scales is often needed.31 The cube reprojection tutorial (§ 4) demonstrates how users can smooth and regrid two archival ALMA data cubes onto a common spatial and spectral grid. All aspects of the smoothing and regridding, both spatial and spectral, can be handled within spectral-cube using astropy.units for unit handling, astropy.convolution for convolution, and reproject32 for regridding onto new world coordinate systems. reproject can also handle Dask Arrays, providing a way to parallelize and efficiently manage the reprojection of large data cubes.
Regions-of-interest with regions and interactive matplotlib tools
Selecting portions of the sky, or simply drawing on the sky, is an integral component of data analysis and publication figures. There are several region file formats and editors of varying popularity, particularly the SAOImage DS9 visualization tool ((Smithsonian Astrophysical Observatory 2000)), which defines a .reg format, and the (now deprecated) CASA Viewer and CARTA visualization tools ((Comrie et al. 2021)), which primarily use the CRTF region format33. In the future, we intend to support the proposed general region specification format defined by the International Virtual Observatory Alliance (IVOA), though we are not aware of any current code implemented to use it. The astropy-regions package34 implements a unified interface to CRTF and DS9 regions, and can read and write both formats. spectral-cube uses the regions functionality for several operations, including the ability to mask out and return spatial subsets of the data only within the region of interest. Uses of this region-based masking including averaging spectra over a source of interest and creating position-velocity diagrams across irregular shapes (demonstrated in the PV diagram tutorial; § 4).
Regions can also be used in interactive cleaning to specify where model components should be added or disallowed. On-going development will complete the matplotlib functionality to interactively define sky regions for use with deconvolution, providing useful functionality that can be incorporated into new CASA development of an interactive clean GUI35, which replaces similar functionality in the now deprecated casaviewer. New additions to matplotlib allow the creation and editing of region files interactively with the matplotlib viewer, which is agnostic of backend - i.e., it can be used on any matplotlib-compatible interactive viewer, including notebook viewers. The regions created in the interactive viewer can be saved in world coordinates when Astropy’s wcsaxes is used to display the regions.
All CASA-produced images are spectral cubes
CASA writes all of its outputs (its .image, .residual, etc.) files as 4-dimensional cubes: the first two dimensions represent sky coordinates, the third spectral coordinates, and the fourth the Stokes axis for polarization. For many images, i.e., continuum images or single-polarization Stokes I cubes, there are one or more ‘degenerate’ axes, i.e., axes with length 1. CASA explicitly acknowledges this by including the dropdeg keyword in the exportfits function, which will output a FITS file with no header information for the axes with length 1. However, for any data files not exported in this way, or any native CASA files, the underlying object is still 4-dimensional. That means that these objects can be opened directly with spectral-cube, even if they are just 2-dimensional images.
Relation to other Python packages handling spectral-line data cubes
Multiple Python packages support spectral-line data cubes. spectral-cube and the broader radio-astro-tools package suite provide general handling for cube data, but are specifically aimed at the radio, mm, and sub-mm wavelength regime. However, data formats used in other wavelength regimes (particularly IFU data cubes) are readily handled with spectral-cube.
We note here the relationship between spectral-cube and two commonly-used spectral-line data packages in the Astropy ecosystem: specutils (Astropy-Specutils Development Team 2019) and pyspeckit (Ginsburg et al. 2022). specutils (Astropy-Specutils Development Team 2019) includes functionality first implemented in spectral-cube. Though currently independent, the goals and development remain closely aligned with spectral-cube with specutils generally focused on shorter wavelength regimes and reading and writing lower-dimensional spectral formats (e.g., 1D and multi-object spectra), though it can also load cubes. The main difference in cube handling between specutils and spectral-cube is that spectral-cube focuses on handling large cubes, while specutils does not make any special provisions for file size. As noted in § 1.2, the long-term goal of both packages is to incorporate a shared backend based on NDDdata in astropy.
pyspeckit is primarily focused on spectral modeling of spectral data and can load data from spectral-cube. Though fitting of spectral models can be done with spectral-cube objects (§ 4), fitting is not a component of the radio-astro-tools suite. pyspeckit includes a suite of preconfigured models and a GUI system for running those fits, which is not a component of the radio-astro-tools suite. Thus, pyspeckit should be thought of as leveraging but extending upon spectral-cube’s capabilities.
Summary
The radio-astro-tools project provides a wide range of tools for spectral cube analysis, and integrates with the broader astronomical Python ecosystem (e.g., Astropy) to enable analysis of multiwavelength data in a common framework. This paper describes the range of packages, common use cases, and a set of tutorials to enable broader access to radio interferometric data products. By providing this common framework, we aim to allow astronomers to develop new and improved algorithms for the increasingly-complex data cubes that modern interferometers can provide, rather than being forced to individually tackle common file and memory-handling operations that radio-astro-tools can handle.
The radio-astro-tools project continues to be developed and we particularly welcome community contributions and input on the continued development. Our current development also includes expanding functionality, including handling for full polarization products that is already being used in tools like plumber36 to generate full Stokes primary beam models for radio interferometers. Additionally, our on-going development will allow for interactive editing tools with the regions packages and its incorporation into the glue visualization and analysis package.
Our future development plans include additional integration with the Radio Astronomy Data Processing System (RADPS), which is a program initiated by NRAO to develop a system for processing data from the ALMA Wideband Sensitivity Upgrade (WSU; Carpenter et al. 2023) and ngVLA (Murphy et al. 2018). RADPS will replace the functionality of the current CASA and NRAO Pipelines. The RADPS prototype37 uses xarray38 that is also based on dask and the use of casa-formats-io is being investigated to handle CASA legacy table and image formats.
We gratefully acknowledge all community contributions to radio-astro-tools and the support from two ALMA development studies critical to the development of radio-astro-tools: “Community Science Tool Development” (Cycle 2; PI: A. Leroy) and “Linking CASA to the Astropy ecosystem” (Cycle 5; PI: A. Ginsburg). We also acknowledge discussions with all participants of the “Spatio-spectral Modeling of Interferometric Data: Preparing for the Wideband Era” workshop, which was partially supported by the North American ALMA Science Center (NAASC). The National Radio Astronomy Observatory and Green Bank Observatory are facilities of the U.S. National Science Foundation operated under cooperative agreement by Associated Universities, Inc. A.S.-M. acknowledges support from the RyC2021-032892-I grant funded by MCIN/AEI/10.13039/501100011033 and by the European Union ‘Next GenerationEU’/PRTR, as well as the program Unidad de Excelencia María de Maeztu CEX2020-001058-M, and support from the PID2023-146675NB-I00 (MCI- AEI-FEDER, UE). A.G. acknowledges support from the NSF under grants AAG 2008101 and 2206511 and CAREER 2142300, and from the National Aeronautics and Space Administration (NASA) under the ROSES-2020 OSTFL program and ROSES-24 HPOSS program, grant nos. 80NSSC22K0347 and 80NSSC25M7029, to the astropy project. J.D.H acknowledges funding from the European Research Council (ERC) under the Horizon Europe framework programme. This work is supported by an ERC Advanced Grant (Acronym: eCMZs, Number 101201230). Funded by the European Union. Views and opinions expressed are, however, those of the author(s) only and do not necessarily reflect those of the European Union or the European Research Council Executive Agency. Neither the European Union nor the granting authority can be held responsible for them.
Software: apply (Robitaille and Bressert 2012; Robitaille 2019), astropy (Astropy Collaboration et al. 2013, 2018, 2022), CASA (CASA Team et al. 2022), dask (Dask Development Team 2016), ds9 (Smithsonian Astrophysical Observatory 2000), glue (Beaumont et al. 2013), fsspec (fsspec Developers 2026), joblib (joblib developers 2026), matplotlib (Hunter 2007), numpy (Harris et al. 2020), reproject (Robitaille et al. 2026), regions (Bradley et al. 2026), scikit-image (van der Walt et al. 2014), scipy (Virtanen et al. 2020), tqdm (da Costa-Luis et al. 2026), yt (Turk et al. 2011), zarr (Miles et al. 2021)
Approximations in solving for the common beam in radio-beam
A common operation for radio data is to convolve to a common resolution, either internal to the data (e.g., between spectral channels) or between different data sets. radio-beam includes two algorithms to solve for the minimum-enclosing common beam: (i) an exact solution for sets of two beams following the implementation in casacore, and an approximation for more than two beams based on the Khachiyan algorithm (Khachiyan and Todd 1993). Here we describe our implementation and the approximations made to enable fast computation for large () sets of beams. Further information is given in the documentation39.
Finding the common beam is equivalent to solving for the minimum enclosing ellipse given a set of ellipses. The formal ellipsoid solution to this problem requires convex optimization as the solution lies at the edge of the valid parameter space (“minimally” enclosing; Boyd et al. 2004, Section 8.4). Our problem for the common beam is simplified in that it is only in 2D, all ellipses are centered at the origin, and we require only loose convergence to much less than pixel size since most data sample pixels per full-width-half-max (FWHM). We found that the Khachiyan algorithm (Khachiyan and Todd 1993; Todd and Yıldırım 2007) was well-suited given these simplifications. The Khachiyan algorithm samples points along the edge of each ellipse in the set. From these points, we compute the convex hull of the set to define the boundaries and use those boundary points to solve for the minimum enclosing ellipse.
radio-beam checks that all beams in the set can be deconvolved by the common beam solution. However, the algorithm can converge within the allowed tolerance to marginally smaller than the true enclosing ellipse. To avoid these cases where a beam cannot be marginally deconvolved, we increase the boundaries used by the Khachiyan algorithm by a relative fraction ( by default). is allowed to incrementally increase to a set maximum (default of 0.01) to ensure convergence to a common beam that can deconvolved from each beam in the set. While the addition of increases the common beam area, the default limits ensure that the increase should be far smaller than the typical pixel size and therefore negligible.
The time to compute the common beam with our implementation, including consistency checks, is far shorter than most cube operations. With a set of 1178 beams, the computation takes 0.7 s with the default parameters.
Feathering comparison between UVCOMBINE and CASA
We demonstrate that uvcombine and CASA’s feather task produce equivalent combined maps by generating an image with a known power law and simulating a single-dish and interferometer response. The top left panel in Figure 5 shows the original image with a power law index of . We simulate a single-dish observation by convolving the data to a beam size of (using a Gaussian kernel). For the interferometer response, we assume an idealized case of a filled uv-plane between scales of –, or equivalently a low- and high-pass top-hat filter. We use the same inputs when feathering: a scale factor of 1.0 and no low pass filtering of the single-dish data on small scales. The feathered data, shown in the top right and bottom left in Figure 5, are visually identical. The bottom right panel shows the difference between the feathered data, normalized by the original image. The feather maps are consistent where the simulated emission is brightest, and small deviations persist only for the faintest features. We find that the power law indices of the feathered maps are consistent within uncertainty.
Figure 5. Demonstration of equivalent feathered maps using uvcombine and CASA on a generated power law data. Only small deviations remain between the feathered maps relative to the original image.
The continuous integration testing for uvcombine includes tests comparing to the output from CASA’s feather task on simulated power law, similar to this example.
This paper was built using the Open Journal of Astrophysics LaTeX template. The OJA is a journal which provides fast and easy peer review for new papers in the astro-ph section of the arXiv, making the reviewing process simpler for authors and referees alike. Learn more at http://astro.theoj.org.
References
- [1]E. W. Greisen, M. R. Calabretta, F. G. Valdes, and S. L. Allen, A&A 446, 747 (2006), arXiv:astro-ph/0507293 [astro-ph].DOI
- [2]M. R. Calabretta and E. W. Greisen, A&A 395, 1077 (2002), arXiv:astro-ph/0207413 [astro-ph].
- [3]J. G. Mangum, D. T. Emerson, and E. W. Greisen, A&A 474, 679 (2007), arXiv:0709.0553 [astro-ph].DOI
- [4]R. J. Reynolds, S. L. Tufte, L. M. Haffner, K. Jaehnig, and J. W. Percival, PASA 15, 14 (1998).
- [5]R. Bacon, M. Acciari, L. Adjali, H. Anwand, S. Bauer, I. Biswas, J. Blaizot, D. Boudon, S. Brau-Nogue, J. Breinckmann, P. Caillier, L. Capoani, C. M. Carollo, T. Contini, P. Couderc, E. Daguise, S. Deiries, B. Delabre, D. Dreizler, J. Dubois, M. Dupieux, C. Dupuy, E. Emsellem, T. Fechner, A. Fleischmann, M. François, G. Gallou, T. Gharsa, A. Glindemann, D. Gojak, B. Guidérdoni, G. Hansali, T. Hahn, A. Jarno, A. Kelz, C. Koehler, J. Kosmalski, F. Laurent, M. Le Floch, S. J. Lilly, J. L. Lizon, M. Loupias, A. Mancescu, C. Monstein, H. Nicklas, J. C. Olaya, L. Pares, L. Pasquini, A. Pécontal-Rousset, R. Pelló, C. Petit, E. Popow, R. Reiss, A. Remillieux, E. Renault, M. Roth, G. Rupprecht, D. Serre, J. Schaye, G. Soucail, M. Steinmetz, O. Streicher, R. Stuik, H. Valentin, J. Vernet, P. Weilbacher, L. Wisotzki, and N. Yerle, in Ground-based and Airborne Instrumentation for Astronomy III, Society of Photo-Optical Instrumentation Engineers (SPIE) Conference Series, Vol. 7735, edited by I. S. McLean, S. K. Ramsay, and H. Takami (2010) p. 773508, arXiv:2211.16795 [astro-ph.IM].
- [6]F. Eisenhauer, R. Abuter, K. Bickert, F. Biancat-Marchet, H. Bonnet, J. Brynnel, R. D. Conzelmann, B. Delabre, R. Donnson, J. Farinato, E. Fedrigo, R. Genzel, N. N. Hubin, C. Iserlohe, M. E. Kasper, M. Kissler-Patig, G. J. Monnet, C. Roehrle, J. Schreiber, S. Stroebele, M. Teczа, N. A. Thatte, and H. Weisz, in Instrument Design and Performance for Optical/Infrared Ground-based Telescopes, Society of Photo-Optical Instrumentation Engineers (SPIE) Conference Series, Vol. 4841, edited by M. Iye and A. F. M. Moorwood (2003) pp. 1548–1561, arXiv:astro-ph/0306191 [astro-ph].
- [7]J. Allington-Smith, G. Murray, R. Content, G. Dodsworth, R. Davies, B. W. Miller, I. Jorgensen, I. Hook, D. Crampton, and R. Murowinski, PASP 114, 892 (2002).
- [8]R. Bacon, Y. Copin, G. Monnet, B. W. Miller, J. R. Allington-Smith, M. Bureau, C. M. Carollo, R. L. Davies, E. Emsellem, H. Kuntschner, R. F. Peletier, E. K. Verolme, and P. T. de Zeeuw, MNRAS 326, 23 (2001), arXiv:astro-ph/0103451 [astro-ph].DOI
- [9]J. Larkin, M. Barczys, A. Krabbe, S. Adkins, T. Aliado, P. Amico, G. Brims, R. Campbell, J. Canfield, T. Gasaway, A. Honey, C. Iserlohe, C. Johnson, E. Kress, D. Lafreniere, J. Lyke, K. Magnone, N. Magnone, M. McElwain, J. Moon, A. Quirrenbach, G. Skulason, I. Song, M. Spencer, J. Weiss, and S. Wright, in Ground-based and Airborne Instrumentation for Astronomy, Society of Photo-Optical Instrumentation Engineers (SPIE) Conference Series, Vol. 6269, edited by I. S. McLean and M. Iye (2006) p. 62691A.
- [10]P. Jakobsen, P. Ferruit, C. Alves de Oliveira, S. Arribas, G. Bagnasco, R. Barho, T. L. Beck, S. Birkmann, T. Böker, A. J. Bunker, S. Charlot, P. de Jong, G. de Marchi, R. Ehrenwinkler, M. Falcolini, R. Fels, M. Frank, D. Franz, M. Funke, G. Giardino, X. Gnata, W. Holota, K. Honnen, P. L. Jensen, M. Jentsch, T. Johnson, D. Jollet, H. Karl, G. Kling, J. Köhler, M. G. Kolm, N. Kumari, M. E. Lander, R. Lemke, M. López-Caniego, N. Lützgendоrf, R. Maiolino, E. Manjavacas, A. Marston, M. Maschmann, R. Maurer, B. Messerschmidt, S. H. Moseley, P. Mosner, D. B. Mott, J. Muzzгerolle, N. Pirzkal, J. F. Pittet, A. Plitzke, W. Posselt, B. Rapp, B. J. Rauscher, T. Rawle, H. W. Rix, A. Rödel, P. Rumler, E. Sabbi, J. C. Salvatо, T. Schmid, M. Sirianni, C. Smith, P. Strada, M. te Plate, J. Valenti, T. Wettemann, T. Wiehe, M. Wiesmayer, C. J. Willott, R. Wright, P. Zeidler, and C. Zincke, A&A 661, A80 (2022), arXiv:2202.03305 [astro-ph.IM].DOI

