ska_sdp_spectral_line_imaging.data_procs.imaging module

ska_sdp_spectral_line_imaging.data_procs.imaging.image_ducc(weight, flag, uvw, freq, vis, cell_size, nx, ny, epsilon, nchan, ntime, nbaseline)[source]

Perform imaging using ducc0.gridder

Parameters:
  • weight (numpy.array) -- Weights array

  • flag (numpy.array) -- Flag array

  • uvw (numpy.array) -- Polarization array

  • freq (numpy.array) -- Frequency array

  • vis (numpy.array) -- Visibility array

  • cell_size (float) -- Cell size in arcsecond

  • nx (int) -- Size of image X

  • ny (int) -- Size of image y

  • epsilon (float) -- Epsilon

  • nchan (int) -- Number of channel dimension

  • ntime (int) -- Number of time dimension

  • nbaseline (int) -- Number of baseline dimension

Returns:

xarray.DataArray

ska_sdp_spectral_line_imaging.data_procs.imaging.chunked_imaging(ps, cell_size, nx, ny, epsilon=0.0001)[source]

Perform imaging on individual chunks

Parameters:
  • ps (xarray.Dataset) -- Observation

  • cell_size (float) -- Cell size in radian

  • nx (int) -- Image size X

  • ny (int) -- Image size Y

  • epsilon (float) -- Epsilon

Returns:

xarray.DataArray

ska_sdp_spectral_line_imaging.data_procs.imaging.cube_imaging(ps, cell_size, nx, ny, epsilon, wcs, polarization_frame)[source]

Creates an Image object from a xarray dataset

Parameters:
  • ps (xarray.Dataset) -- Observation

  • cell_size (float) -- Cell size in arcsecond

  • nx (int) -- Image size X

  • ny (int) -- Image size Y

  • epsilon (float) -- Epsilon

  • wcs (WCS) -- WCS Information

  • polarization_frame (PolarizationFrame) -- Polarization information

Returns:

ska_sdp_datamodels.image.image_model.Image

ska_sdp_spectral_line_imaging.data_procs.imaging.generate_psf_image(ps, cell_size, nx, ny, epsilon, wcs, polarization_frame)[source]

Creates a PSF Image object from a xarray dataset

Parameters:
  • ps (xarray.Dataset) -- Observation

  • cell_size (float) -- Cell size in arcsecond

  • nx (int) -- Image size X

  • ny (int) -- Image size Y

  • epsilon (float) -- Epsilon

  • wcs (WCS) -- WCS Information

  • polarization_frame (PolarizationFrame) -- Polarization information

Returns:

ska_sdp_datamodels.image.image_model.Image

ska_sdp_spectral_line_imaging.data_procs.imaging.clean_cube(ps, psf_image_path, n_iter_major, gridding_params, deconvolution_params, beam_info)[source]

Perform cube clean on an xarray dataset

Parameters:
  • ps (xarray.Dataset) -- Observation

  • psf_image_path (str) -- File path to psf image stored in FITS format

  • n_iter_major (int) -- Number of major iterations

  • gridding_params (dict) -- Prameters to perform gridding.

  • deconvolution_params (dict) -- Deconvolution parameters

  • beam_info -- Clean beam e.g. {"bmaj":0.1, "bmin":0.05, "bpa":-60.0}. Units are deg, deg, deg

Returns:

cleaned products, which is a mapping with following keys and value types:

  • model: Image

  • psf: Image

  • residual: Image

  • restored: Image

Return type:

dict

ska_sdp_spectral_line_imaging.data_procs.imaging.get_cell_size_from_obs(observation, scaling_factor)[source]

A helper function which reads UVW and other metadata from xradio observation dataset, and estimates cell size to be used for imaging.

The function is dask compatible, i.e. input dask arrays are not eagerly computed. Consumer of this function must call compute() on the returned object to get the actual values.

Parameters:
  • observation (xarray.Dataset) -- Xradio observation

  • scaling_factor (float) -- Scaling factor for estimation of cell size

Returns:

xarray.Dataarray

Dataarray which wraps a dask array of size 1, representing cell size value.

ska_sdp_spectral_line_imaging.data_procs.imaging.get_image_size_from_obs(observation, cell_size)[source]

A helper function which reads antenna information and other metadata from xradio observation dataset, and estimates image size to be used for imaging.

The function is dask compatible, i.e. input dask arrays are not eagerly computed. Consumer of this function must call compute() on the returned object to get the actual values.

Parameters:
  • observation (xarray.Dataset) -- Xradio observation

  • cell_size (float) -- Cell size in arcsecond.

Returns:

xarray.Dataarray

Dataarray which wraps a dask array of size 1, representing image size value.