swiftly

Module for constructing and orchestrating SwiFTly instances

class ska_sdp_distributed_self_cal_prototype.data_managers.swiftly.Swiftly(config: PipelineConfig, limit_facets: bool = False)[source]

Bases: object

Class to construct and store a SwiFTly instance.

Parameters:

config – PipelineConfig object containing swiftly_info.

apply_degrid_corrections(facets: list[numpy.ndarray], kernel: ska_sdp_func.grid_data.gridder_wtower_uvw.GridderWtowerUVW, normalisation_factor: float) list[numpy.ndarray][source]

Applies corrections to the facets before degridding.

This function iterates over a list of facet images, then applies a degrid correction using the provided kernel.

Parameters:
  • facets – A list of image facets as 2D numpy arrays.

  • kernel – The gridding kernel used for correcting facet images.

  • normalisation_factor – Factor used to normalise the pixel values.

Returns:

A list of image facets as 2D numpy arrays with degrid corrections applied.

Return type:

facets

apply_grid_corrections(facets: list[numpy.ndarray], kernel: ska_sdp_func.grid_data.gridder_wtower_uvw.GridderWtowerUVW) list[numpy.ndarray][source]

Applies corrections to the facets after gridding.

This function iterates over a list of facet images, then applies a grid correction using the provided kernel.

Parameters:
  • facets – A list of image facets as 2D numpy arrays.

  • kernel – The gridding kernel used for correcting facet images.

  • normalisation_factor – Factor used to normalise the pixel values.

Returns:

A list of image facets as 2D numpy arrays with grid corrections applied.

Return type:

facets

compute_normalisation_factor(facets: list[numpy.ndarray], total_num_visibilities: int, channel_count: int) float[source]

Compute normalisation factor using sum of absolute brightness in image facets.

Parameters:
  • facets – list of image facets to use for computing maximum brightness

  • total_num_visibilities – total number of visibilities in whole dataset

  • channel_count – number of channels

Returns:

normalisation factor to use for this major cycle

Return type:

normalisation_factor

property config

Returns the config attribute.

create_facets() list[numpy.ndarray][source]

Create facets using SwiFTly backward.

Returns:

A list of image facets as 2D numpy arrays.

Return type:

facets

property facet_config_list

Returns the facet_config_list attribute.

property facet_count

Returns the facet_count from the SwiftlyInfo object.

generate_grid_corrected_facets(gridding_kernel: ska_sdp_func.grid_data.gridder_wtower_uvw.GridderWtowerUVW, total_num_visibilities: int, channel_count: int) list[numpy.ndarray][source]

Generate grid corrected facets.

Parameters:
  • gridding_kernel – The gridding kernel used for correcting facet images.

  • total_num_visibilities – Factor used with the pixel sum to normalise the pixel values.

  • channel_count – number of channels

Returns:

A list of image facets as 2D numpy arrays with grid corrections applied.

Return type:

facets

generate_image_from_facets(gridding_kernel: ska_sdp_func.grid_data.gridder_wtower_uvw.GridderWtowerUVW, total_num_visibilities: int, channel_count: int) numpy.ndarray[source]

Generate full image from facets.

Parameters:
  • gridding_kernel – The gridding kernel used for correcting facet images.

  • total_num_visibilities – Constant used with pixel sum to normalise the pixel values.

  • channel_count – number of channels

Returns:

The full image after stitching facets together.

Return type:

full_image

get_facet_tasks(facets: list[numpy.ndarray]) None[source]

Get list of facet dask tasks for SwiftlyForward.

Uses list of facets and facet configurations.

Parameters:

facets – List of facets.

Returns:

None.

join_facets(facets: list[numpy.ndarray]) numpy.ndarray[source]

Stitch facets together into full image.

Parameters:

facets – A list of image facets as 2D numpy arrays.

Returns:

Full image after stitching facets together

Return type:

full_image

normalise_facets(facets: list[numpy.ndarray], total_num_visibilities: int, channel_count: int) list[numpy.ndarray][source]

Normalise the pixel values in the facets using total number of visibilities.

N.B. Channel count is not currently used in the normalisation calculation.

Parameters:
  • facets – A list of image facets as 2D numpy arrays.

  • total_num_visibilities – Total number of visibility values in the dataset.

  • channel_count – number of channels

Returns:

A list of image facets as 2D numpy arrays with normalised pixel values. normalisation_factor: Factor used to normalise the pixel values.

Return type:

facets