CLEAN functions

C/C++

void sdp_hogbom_clean(const sdp_Mem *dirty_img, const sdp_Mem *psf, const sdp_Mem *cbeam_details, const double loop_gain, const double threshold, const int cycle_limit, sdp_Mem *clean_model, sdp_Mem *residual, sdp_Mem *skymodel, sdp_Error *status)

Perform the Hogbom CLEAN algorithm on a dirty image.

Parameters:
  • dirty_img – Input dirty image is 2D and real-valued with square shape: [X SIZE, Y SIZE].

  • psf – Input Point Spread Function is 2D and real-valued with square shape: [X SIZE * 2, Y SIZE * 2].

  • cbeam_details – Input shape of CLEAN beam, with the size of the array to be generated [BMAJ, BMINN, THETA, SIZE]

  • loop_gain – Gain to be used in the CLEAN loop (typically 0.1)

  • threshold – Minimum intensity of peak to search for, loop terminates if peak is found under this threshold. Can be set to a negative number to ensure CLEAN loop is run exactly cycle_limit times.

  • cycle_limit – Maximum nuber of loops to perform, if the stop threshold is not reached first.

  • clean_model – Map of CLEAN components, unconvolved pixels.

  • residual – Residual image, flux remaining after CLEANing.

  • skymodel – Output Skymodel, CLEAN components convolved with CLEAN beam + residuals.

  • status – Error status.

void sdp_ms_clean_cornwell(const sdp_Mem *dirty_img, const sdp_Mem *psf, const sdp_Mem *cbeam_details, const sdp_Mem *scale_list, const double loop_gain, const double threshold, const int cycle_limit, sdp_Mem *clean_model, sdp_Mem *residual, sdp_Mem *skymodel, sdp_Error *status)

Perform the msCLEAN algorithm on a dirty image.

Based on the version decribed by T. J. Cornwell, “Multiscale CLEAN Deconvolution of Radio Synthesis Images,” in IEEE Journal of Selected Topics in Signal Processing, vol. 2, no. 5, pp. 793-801, Oct. 2008, doi: 10.1109/JSTSP.2008.2006388. https://ieeexplore.ieee.org/document/4703304

Parameters:
  • dirty_img – Input dirty image is 2D and real-valued with square shape: [X SIZE, Y SIZE].

  • psf – Input Point Spread Function is 2D and real-valued with square shape: [X SIZE * 2, Y SIZE * 2].

  • cbeam_details – Input shape of CLEAN beam, with the size of the array to be generated [BMAJ, BMINN, THETA, SIZE]

  • scale_list – List of scales to use, in pixels e.g. [0,4,8,16,32]

  • loop_gain – Gain to be used in the CLEAN loop (typically 0.1)

  • threshold – Minimum intensity of peak to search for, loop terminates if peak is found under this threshold. Can be set to a negative number to ensure CLEAN loop is run exactly cycle_limit times.

  • cycle_limit – Maximum nuber of loops to perform, if the stop threshold is not reached first.

  • clean_model – Map of CLEAN components, unconvolved pixels.

  • residual – Residual image, flux remaining after CLEANing.

  • skymodel – Output Skymodel, CLEAN components convolved with CLEAN beam + residuals.

  • status – Error status.

Python

ska_sdp_func.clean.hogbom_clean(dirty_img, psf, cbeam_details, loop_gain, threshold, cycle_limit, clean_model, residual, skymodel)

Implementation of Hogbom CLEAN, requires dirty image, psf and details of the CLEAN beam

Parameters can be either numpy or cupy arrays, but must all be consistent. Computation is performed either on the CPU or GPU as appropriate.

Parameters:
  • dirty_img (numpy.ndarray or cupy.ndarray) – Input dirty image.

  • psf (numpy.ndarray or cupy.ndarray) – Input Point Spread Function.

  • cbeam_details (numpy.ndarray) – Input shape of cbeam [BMAJ, BMINN, THETA, SIZE]

  • loop_gain (float) – Gain to be used in the CLEAN loop (typically 0.1)

  • threshold (float) – Minimum intensity of peak to search for, loop terminates if peak is found under this threshold.

  • cycle_limit (float) – Maximum number of loops to perform, if the stop threshold is not reached first.

  • clean_model (numpy.ndarray or cupy.ndarray) – Map of CLEAN components, unconvolved pixels.

  • residual (numpy.ndarray or cupy.ndarray) – Residual image, flux remaining after CLEANing.

  • skymodel (numpy.ndarray or cupy.ndarray) – Output Skymodel, CLEAN components convolved with CLEAN beam + residuals.

ska_sdp_func.clean.ms_clean_cornwell(dirty_img, psf, cbeam_details, scale_list, loop_gain, threshold, cycle_limit, clean_model, residual, skymodel)

Implimentation of the Tim Cornwell version of msCLEAN, also found in RASCIL. Requires dirty image, psf and detals of the CLEAN beam

Parameters can be either numpy or cupy arrays, but must all be consistent. Computation is performed either on the CPU or GPU as appropriate.

Parameters:
  • dirty_img (numpy.ndarray or cupy.ndarray) – Input dirty image.

  • psf (numpy.ndarray or cupy.ndarray) – Input Point Spread Function.

  • cbeam_details (numpy.ndarray or cupy.ndarray) – Input shape of cbeam [BMAJ, BMINN, THETA, SIZE].

  • scale_list (numpy.ndarray or cupy.ndarray) – List of scales to use [scale1, scale2, scale3 ……..].

  • loop_gain (float) – Gain to be used in the CLEAN loop (typically 0.1).

  • threshold (float) – Minimum intensity of peak to search for, loop terminates if peak is found under this threshold.

  • cycle_limit (float) – Maximum number of loops to perform, if the stop threshold is not reached first.

  • clean_model (numpy.ndarray or cupy.ndarray) – Map of CLEAN components, unconvolved pixels.

  • residual (numpy.ndarray or cupy.ndarray) – Residual image, flux remaining after CLEANing.

  • skymodel (numpy.ndarray or cupy.ndarray) – Output Skymodel, CLEAN components convolved with CLEAN beam + residuals.