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=None, res=False)[source]#
Clean Hogbom.
Function to perform the Hogbom’s clean algorithm on a dirty image. Cleaning is positive-only: at each iteration the brightest positive residual peak is selected as a component, and cleaning stops when that peak falls below
threshold.- 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 on the residual peak to stop the cleaning process.
clean_beam_size_px (float, optional) – The size (FWHM, in pixels) of the circular restoring beam. If
None(default), it is estimated from the dirty beam: an ellipse is fitted to the dirty-beam main lobe and a round beam of FWHM equal to the mean of the two fitted FWHMs is used (a warning prints the estimated size). A round beam is used on purpose, so sources are restored as they are, undistorted by the (elliptical) interferometer beam.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 brightest (positive) peak of an image. Cleaning is positive-only, so the maximum value is used rather than the maximum absolute value — negative sidelobes are never selected as components.
- 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