argosim.clean module

argosim.clean module#

Clean.

This module contains the functions to perform the Hogbom’s clean algorithm on dirty observations.

Authors:

Ezequiel Centofanti <ezequiel.centofanti@cea.fr>

argosim.clean.clean_hogbom(I_obs, B, gamma=0.2, max_iter=100, threshold=None, clean_beam_size_px=2, res=False)[source]#

Clean Hogbom.

Function to perform the Hogbom’s clean algorithm on a dirty image.

Parameters:
  • I_obs (np.ndarray) – The dirty image.

  • B (np.ndarray) – The beam image (fft shifted).

  • gamma (float) – The clean gain.

  • max_iter (int) – The maximum number of iterations.

  • threshold (float) – The threshold to stop the cleaning process.

  • clean_beam_size_px (int) – The size (FWHM) of the clean beam in pixels.

  • res (bool) – Add residual signal to clean image.

Returns:

  • I_clean (np.ndarray) – The cleaned image.

  • sky_model (np.ndarray) – The sky model image.

argosim.clean.find_peak(I)[source]#

Find peak.

Function to find the peak of an image.

Parameters:

I (np.ndarray) – The image.

Returns:

  • max_val (float) – The maximum value of the image.

  • x_max (int) – The x coordinate of the maximum value.

  • y_max (int) – The y coordinate of the maximum value.

  • shift_x (int) – The shift in the x direction from the center of the image.

  • shift_y (int) – The shift in the y direction from the center of the image.

argosim.clean.pad_odd(im)[source]#

Pad odd.

Function to pad an image with zeros to make it odd in size.

Parameters:

im (np.ndarray) – The image to pad.

Returns:

im_padded – The padded image.

Return type:

np.ndarray

argosim.clean.shift_beam(beam, shift_x, shift_y)[source]#

Shift beam.

Function to shift the beam image by a given amount of pixels in the x and y directions.

Parameters:
  • beam (np.ndarray) – The beam image.

  • shift_x (int) – The shift in the x direction.

  • shift_y (int) – The shift in the y direction.

Returns:

beam_shift – The shifted beam image.

Return type:

np.ndarray