barak.convolve.convolve_psf¶
- barak.convolve.convolve_psf(a, fwhm, edge='invert', replace_nan=True, debug=False)[source]¶
Convolve an array with a gaussian window.
Given an array of values a and a gaussian full width at half maximum fwhm in pixel units, returns the convolution of the array with the normalised gaussian.
Parameters : a : array, shape(N,)
Array to convolve
fwhm : float
Gaussian full width at half maximum in pixels. This should be > 2 to sample the gaussian PSF properly.
Returns : convolved_a : array, shape (N,)
Notes
The Gaussian kernel is calculated for as many pixels required until it drops to 1% of its peak value. The data will be spoiled at distances n/2 (rounding down) from the edges, where n is the width of the Gaussian in pixels.