Gridder UVW ES FFT functions

C/C++

sdp_GridderUvwEsFft *sdp_gridder_uvw_es_fft_create_plan(const sdp_Mem *uvw, const sdp_Mem *freq_hz, const sdp_Mem *vis, const sdp_Mem *weight, const sdp_Mem *dirty_image, const double pixel_size_x_rad, const double pixel_size_y_rad, const double epsilon, const double min_abs_w, const double max_abs_w, const int do_w_stacking, sdp_Error *status)

Creates Gridder’s plan based on the given buffers and parameters.

Parameters:
  • uvw – [in] The (u,v,w) coordinates. Must be complex with shape [num_rows, 3], and either float or double.

  • freq_hz – [in] The channel frequiencies in Hz. Must be real with shape [num_chan], and either float or double.

  • vis – [in, out] The visibility data. Must be complex with shape [num_rows, num_chan], and either float or double. Its data type determines the precision used for the (de)gridding.

  • weight – [in] Its values are used to multiply the input, must be real and same shape and precision as vis.

  • dirty_image – [in, out] The input/output dirty image, must be square. Must be real, and either float or double.

  • pixel_size_x_rad – [in] Angular x pixel size (in radians) of the dirty image (must be the same as pixel_size_y_rad).

  • pixel_size_y_rad – [in] Angular y pixel size (in radians) of the dirty image (must be the same as pixel_size_x_rad).

  • epsilon – [in] Accuracy at which the computation should be done. Must be larger than 2e-13. If vis is type float, it must be larger than 1e-5.

  • min_abs_w – [in] The minimum absolute value of the w-coords in uvw.

  • max_abs_w – [in] The maximum absolute value of the w-coords in uvw.

  • do_w_stacking – [in] Set true for 3D (de)gridding, false for 2D (de)gridding (treats all w-coords as zero, a faster, less-accurate option).

  • status – [in] Error status.

Returns:

sdp_GridderUvwEsFft* Handle to Gridder’s plan.

void sdp_grid_uvw_es_fft(sdp_GridderUvwEsFft *plan, const sdp_Mem *uvw, const sdp_Mem *freq_hz, const sdp_Mem *vis, const sdp_Mem *weight, sdp_Mem *dirty_image, sdp_Error *status)

Generate a dirty image from visibility data.

See sdp_gridder_uvw_es_fft_create_plan() for more details on the parameters.

Parameters:
  • plan – Handle to Gridder’s plan.

  • uvw – [in]

  • freq_hz – [in]

  • vis – [in]

  • weight – [in]

  • dirty_image – [out]

  • status – Error status.

void sdp_ifft_degrid_uvw_es(sdp_GridderUvwEsFft *plan, const sdp_Mem *uvw, const sdp_Mem *freq_hz, sdp_Mem *vis, const sdp_Mem *weight, sdp_Mem *dirty_image, sdp_Error *status)

Generate visibility data from a dirty image.

See sdp_gridder_uvw_es_fft_create_plan() for more details on the parameters.

Parameters:
  • plan – Handle to Gridder’s plan.

  • uvw – [in]

  • freq_hz – [in]

  • vis – [out]

  • weight – [in]

  • dirty_image – [in, out] NB: Even though this is an input, it is modified in place so can’t be const.

  • status – Error status.

void sdp_gridder_uvw_es_fft_free_plan(sdp_GridderUvwEsFft *plan)

Frees memory allocated to Gridder’s plan.

Parameters:

plan – Handle to Gridder’s plan.

Python

class ska_sdp_func.grid_data.GridderUvwEsFft(uvw, freq_hz, vis, weight, dirty_image, pixel_size_x_rad, pixel_size_y_rad, epsilon: float, do_w_stacking: bool)

Processing function GridderUvwEsFft.

__init__(uvw, freq_hz, vis, weight, dirty_image, pixel_size_x_rad, pixel_size_y_rad, epsilon: float, do_w_stacking: bool)

Creates a plan for (de)gridding using the supplied parameters and input and output buffers.

This currently only supports processing on a GPU.

Parameters:
  • uvw (cupy.ndarray((num_rows, 3), dtype=numpy.float32 or numpy.float64)) – (u,v,w) coordinates.

  • freq_hz (cupy.ndarray((num_chan,), dtype=numpy.float32 or) – numpy.float64) Channel frequencies.

  • vis (cupy.ndarray((num_rows, num_chan), dtype=numpy.complex64 or) – numpy.complex128) The input/output visibility data. Its data type determines the precision used for the (de)gridding.

  • weight (cupy.ndarray((num_rows, num_chan), same precision as vis)) – Its values are used to multiply the input.

  • dirty_image (cupy.ndarray((num_pix, num_pix), dtype=numpy.float32 or) – numpy.float64) The input/output dirty image, must be square.

  • pixel_size_x_rad (float) – Angular x pixel size (in radians) of the dirty image.

  • pixel_size_y_rad (float) – Angular y pixel size (in radians) of the dirty image (must be the same as pixel_size_x_rad).

  • epsilon (float) – Accuracy at which the computation should be done. Must be larger than 2e-13. If vis has type numpy.complex64, it must be larger than 1e-5.

  • do_w_stacking (bool) – If True, the full improved w-stacking algorithm is carried out, otherwise the w values are assumed to be zero.

static get_w_range(uvw, freq_hz)

Calculate w-range from UVW-coordinates.

grid_uvw_es_fft(uvw, freq_hz, vis, weight, dirty_image)

Generate a dirty image from visibility data.

Parameters:
  • uvw (as above.)

  • freq_hz (as above.)

  • vis (as above.)

  • weight (as above.)

  • dirty_image (as above.)

ifft_grid_uvw_es(uvw, freq_hz, vis, weight, dirty_image)

Generate visibility data from a dirty image.

Parameters:
  • uvw (as above.)

  • freq_hz (as above.)

  • vis (as above.)

  • weight (as above.)

  • dirty_image (as above.)