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).
Class Details Header File Home
Public Types
- num_t — numeric type used for the uv grid and images.
Public Member Functions
- WStackingGridder — build a gridder from the supplied settings.
- ~WStackingGridder — release image buffers and clean up.
- AddData — grid an array of data values for inversion.
- AddDataSample — grid one visibility value for inversion.
- FinalizeImage — finish inversion after all passes.
- FinishInversionPass — close an inversion gridding pass.
- GetGriddedUVLayer — fetch a gridded uv layer.
- GetGridMode — read the kernel function and interpolation method in use.
- Height — image height as given at construction.
- ImaginaryImage — imaginary part of the complex image after inversion.
- ImaginaryImageFloat — imaginary image always returned as 32-bit float.
- InitializePrediction — prepare the gridder for prediction with a target image.
- InitializePrediction — complex variant taking separate real and imaginary images.
- IsComplex — whether the image is complex for inversion or prediction.
- IsInLayerRange — check whether a w-value belongs in this pass.
- IsInLayerRange — check whether any samples in a w-range belong in this pass.
- LayerToW — central w-value for a given w-layer index.
- NFFTThreads — number of threads used for the FFTs.
- NPasses — passes needed when all w-layers don't fit in memory.
- NWLayers — number of w-layers set in PrepareWLayers().
- PixelSizeX — angular pixel width in radians.
- PixelSizeY — angular pixel height in radians.
- PrepareBand — set up inversion or prediction for a given band.
- PrepareWLayers — set up inversion or prediction with a given number of w-layers.
- RealImage — image produced by inversion.
- RealImageFloat — real image always returned as 32-bit float.
- SampleData — predict values for every channel in a band.
- SampleDataSample — predict one visibility value in double precision.
- SetDenormalPhaseCentre — configure the gridder for a shifted phase centre.
- SetGridMode — choose the kernel function and interpolation method.
- SetIsComplex — configure for real or complex images.
- SetNFFTThreads — set the thread count for the FFTs.
- StartInversionPass — begin a new inversion gridding pass.
- StartPredictionPass — begin a new prediction pass.
- Width — image width as given at construction.
- WToLayer — layer that a given w-value belongs to.
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.
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.