CLEANing Up Radio Astronomy on the GPU

Katherine Rosenfeld and Nathan Sanders

We have tested our CUDA code on a variety of simulated datasets. Some examples from these simulations are shown below.

System requirements:

Download the code:

How it works

We have tested our CUDA code on a variety of simulated datasets. Some examples from these simulations are available here.

Gridding:

Synthesis aperture arrays sample the Fourier transform of the sky brightness towards the source. In order to make a science image you must first invert these complex valued measurements, V(u,v), by taking a Fourier transform. The common technique is to grid the sampled data points and evaluate the discrete Fourier transform via an FFT. We grid using a convolution with a standard spheroidal function and use the CUDA SciKit wrapper for cuFFT to calculate the sky image and point source response function. We also include a rudimentary weighting scheme that can be used to accentuate different aspects of the data. We use the following kernels:

Hogbom CLEAN algorithm:

Radio antenna arrays typically have non-uniform spacing, which gives them access to low and high frequencies simultaneously, but with sparse sampling in the UV plane. A Fourier tranform of this sparsely sampled data yields significant artifacts in the resulting image. For example, an image of a point source will have many sidelobes throughout the 2D image, which can reach intensities within an order of magnitude of the primary lobe.

This point source response pattern is called the dirty beam. The mage produced by convolving an astronomical source with the dirty beam is called the dirty image or dirty map. A clean beam is typically constructed by fitting a 2D Gaussian to the primary lobe of the dirty beam. If the locations of all astrophysical sources in the dirty image are known, a clean image can be approximated by convolving this model with the clean beam.

Hogbom (1974, Astronomy and Astrophysics, 15, 417) presented a classic image deconvolution algorithm used in radio astronomy to remove these instrumental artifacts. We implement the Hogbom algorithm on the GPU using pyCUDA (“cuda_hogbom” function). The algorithm uses 3 CUDA kernels:

gICLEAN.py is executed as a python script from the command line:

python gICLEAN.py [example] [image size] [make figures]

The command line options can also be edited within the main routine:

This will compile and run the CUDA kernels and generate final images. It requires an ALMA style visibility dataset in FITS format that is set by the vfile keyword. This version is good for single channel images only (although it is in principle scalable for spectral lines or multi-frequency synthesis). We have supplied several examples along with reasonable imaging parameters in our code with the data available in the examples section. The gaussian, ring, and mickey examples are noiseless, simulated datasets while hd163296 is a single channel of the CO J=3-2 line observed by the sub-millimeter telescope ALMA.

Usage

First, set up the environment (this applicable to users of the Harvard SEAS Resonance cluster only):

gpu-login

module load courses/cs205/2012

To perform gridding and CLEANing for the Gaussian source example, simply run:

python gICLEAN.py

This script takes a few command line options:

python gICLEAN.py [EXAMPLE] [ISIZE] [PLOTME]

Within this module, there are several functions that have their own configurable options, although these are not given command line switches.

cuda_gridvis parameters:

cuda_hogbom parameters: