IterativeGaussian.generate_kernel

giant.point_spread_functions.gaussians:

IterativeGaussian.generate_kernel(size=None)

Generates a square kernel centered at the centroid of the PSF normalized to have a volume (sum) of 1 for the size input or specified in the size attribute.

Essentially this evaluates z=f(x,y) for x in [x0size//2,x0+size//2] and y in [y0size//2,y0+size//2] where x0 is the x location of the centroid of the PSF and y0 is the y location of the centroid of the PSF.

The resulting values are then normalized to sum to 1 so that the result can be applied using convolution without changing the overall signal level.

Parameters:

size (int | None) – The size of the kernel to generate (ie return a (size, size) shaped array). Overrides the size attribute.

Returns:

A normalized kernel of the PSF centered at the centroid