Andreoffringa

WSClean: WStackingGridder< T > Class Template Reference

WStackingGridder<T> Class Template Reference

This template class converts visibilities into UV space and back again, handling the required FFT operations and applying w-term correction through the w-stacking technique described by Offringa et al., 2014. It stays independent of the visibility data format and is built for high performance. The WSMSGridder class relies on it for both inversion and prediction, splitting large imaging jobs into several passes when needed, each pass gridding or sampling a handful of w-layers. Smaller applications that don't face very large images or w-terms can skip that multi-pass complexity.

The class supports both directions: turning visibilities into an image (Inversion) and turning a model image into visibilities (Prediction).

Doxygen documentation logo for the WSClean WStackingGridder class reference
WSClean API documentation

Class Details Header File Home

Public Types

  • num_t — numeric type used for the uv grid and images.

Public Member Functions

Static Public Member Functions

  • GetKernel — obtain the anti-aliasing gridding kernel.

Detailed Description

This class grids and/or samples visibilities to/from UV space, runs the necessary FFTs and applies w-term correction using the w-stacking method (see Offringa et al., 2014). It is generic with respect to the underlying visibility data format and is written for high performance. WSMSGridder uses it for inversion and prediction, where large imaging operations are split into multiple passes over the data if needed, each pass gridding or sampling a few w-layers. Simpler applications may choose not to support this when very large images or large w-terms are not a concern, which makes things easier.

The class handles both visibilities-to-image and (model) image-to-visibilities conversion. The first is called "Inversion" here and the latter "Prediction".

Inversion call sequence

  • Construct an instance with WStackingGridder().
  • Set settings if necessary (grid mode, denormal phase centre, complex...).
  • Call PrepareWLayers().
  • For each pass if multiple passes are necessary (or once otherwise): call StartInversionPass(); add all samples with AddDataSample(); call FinishInversionPass().
  • Finally, call FinalizeImage().
  • RealImage() and optionally ImaginaryImage() then return the image(s).

Alternatively, AddData() can be used instead of AddDataSample() to grid several samples that differ only in frequency. To use AddData(), PrepareBand() must be called first.

Prediction call sequence

  • Construct an instance with WStackingGridder().
  • Set settings if necessary.
  • Call PrepareWLayers().
  • Call InitializePrediction().
  • For each pass if multiple passes are necessary (or once otherwise): call StartPredictionPass(); get the predicted visibilities with SampleDataSample().

As with inversion, all values for a band can be predicted at once by calling SampleData() instead of SampleDataSample() when the band has been set beforehand with PrepareBand(). Prediction needs no finalisation calls.

Author: André Offringa. Date: 2013 (first version). See also: WSClean, an implementation of a fast, generic wide-field imager for radio astronomy.

Read the W-Stacking Paper Class Overview Doxygen

Constructor & Destructor Documentation

WStackingGridder()

template<typename T> WStackingGridder<T>::WStackingGridder(size_t width, size_t height, double pixelSizeX, double pixelSizeY, size_t fftThreadCount, size_t kernelSize = 7, size_t overSamplingFactor = 1023)

Build a new gridder with the supplied settings.

  • width — image width in pixels.
  • height — image height in pixels.
  • pixelSizeX — angular pixel width in radians.
  • pixelSizeY — angular pixel height in radians.
  • fftThreadCount — number of threads used for FFTs; see NFFTThreads() for details.
  • kernelSize — full width and height of the kernel in pixels; should be odd. Larger kernels reduce aliasing artefacts but cost more. The default of 7 balances effectiveness and speed.
  • overSamplingFactor — number of distinct horizontal and vertical kernels precalculated at different rational positions. Larger values are more accurate but need more memory and run slower, probably mainly due to the increased precalculation cost.