lib.deconvolve module

PSF DECONVOLUTION MODULE

This module deconvolves a set of galaxy images with a known object-variant PSF.

Author:Samuel Farrens <samuel.farrens@gmail.com>
Version:6.3
Date:23/10/2017
lib.deconvolve.get_lambda(n_images, p_pixel, sigma, spec_rad)[source]

Get lambda value

This method calculates the singular value threshold for low-rank regularisation

Parameters:
  • n_images (int) – Total number of images
  • p_pixel (int) – Total number of pixels
  • sigma (float) – Noise standard deviation
  • spec_rad (float) – The spectral radius of the gradient operator
Returns:

Return type:

float Lambda value

lib.deconvolve.perform_reweighting(**kwargs)[source]

Perform reweighting

This method updates the weights used for thresholding in the sparse domain

Returns:
Return type:dict Updated keyword arguments
lib.deconvolve.run(data, psf, **kwargs)[source]

Run deconvolution

This method initialises the operator classes and runs the optimisation algorithm

Parameters:
  • data (np.ndarray) – Input data array, an array of 2D images
  • psf (np.ndarray) – Input PSF array, a single 2D PSF or an array of 2D PSFs
Returns:

Return type:

np.ndarray decconvolved data

lib.deconvolve.set_condat_param(**kwargs)[source]

Set the Condat-Vu parameters

This method sets the values of tau and sigma in the Condat-Vu proximal-dual splitting algorithm if not already provided. It additionally checks that the combination of values will lead to convergence.

Returns:
Return type:dict Updated keyword arguments
lib.deconvolve.set_grad_op(data, psf, **kwargs)[source]

Set the gradient operator

This method defines the gradient operator class to use and add an instance to the keyword arguments.

Parameters:
  • data (np.ndarray) – Input noisy data (3D array)
  • psf (np.ndarray) – PSF data (2D or 3D array)
Returns:

Return type:

dict Updated keyword arguments

lib.deconvolve.set_linear_op(data, **kwargs)[source]

Set the gradient operator

This method defines the gradient operator class to use and add an instance to the keyword arguments. It additionally add the l1 norm of the linear operator and the wavelet filters (if used) to the kwagrs.

Parameters:data (np.ndarray) – Input noisy data (3D array)
Returns:
Return type:dict Updated keyword arguments

Todo

  • Clean up wavelet_filters and l1norm
lib.deconvolve.set_lowr_thresh(data_shape, **kwargs)[source]

Set the low-rank threshold

This method sets the value of the low-rank singular value threshold.

Parameters:data_shape (tuple) – Shape of the input data array
Returns:
Return type:dict Updated keyword arguments
lib.deconvolve.set_noise(data, **kwargs)[source]

Set the noise level

This method calculates the noise standard deviation using the median absolute deviation (MAD) of the input data and adds it to the keyword arguments.

Parameters:data (np.ndarray) – Input noisy data (3D array)
Returns:
Return type:dict Updated keyword arguments
lib.deconvolve.set_optimisation(**kwargs)[source]

Set the optimisation technique

This method sets the technique used for opttimising the problem

Returns:
Return type:dict Updated keyword arguments
lib.deconvolve.set_primal_dual(data_shape, **kwargs)[source]

Set primal and dual variables

This method sets the initial values of the primal and dual variables

Parameters:data_shape (tuple) – Shape of the input data array
Returns:
Return type:dict Updated keyword arguments
lib.deconvolve.set_prox_op_and_cost(data, **kwargs)[source]

Set the proximity operators and cost function

This method sets the proximity operators and cost function instances.

Parameters:data (np.ndarray) – Input noisy data (3D array)
Returns:
Return type:dict Updated keyword arguments
lib.deconvolve.set_sparse_weights(data_shape, psf, **kwargs)[source]

Set the sparsity weights

This method defines the weights for thresholding in the sparse domain and add them to the keyword arguments. It additionally defines the shape of the dual variable.

Parameters:
  • data_shape (tuple) – Shape of the input data array
  • psf (np.ndarray) – PSF data (2D or 3D array)
Returns:

Return type:

dict Updated keyword arguments