prtools.gauss#

gauss(x1, x2, sigma, oversample=1, indexing='ij', normalize=False)[source]#

2D Gaussian function

Parameters:
  • x1 (array_like) – 1-D arrays representing the grid coordinates

  • x2 (array_like) – 1-D arrays representing the grid coordinates

  • sigma (float or (2,) array_like) – Standard deviation of Gaussian. Providing two values allows for non-symmetric Gaussian interpreted as (sigma_row, sigma_col)

  • oversample (float, optional) – Oversampling factor. Defailt is 1.

  • indexing ({'ij', 'xy'}, optional) – Matrix (‘ij’, default) or cartesian (‘xy’) indexing of output.

  • normalize (bool, optional) – If True, the output is normalized such that its sum is equal to 1. If False (default), the output has max equal to one.

Return type:

ndarray

Examples

>>> r = np.arange(-128,128)
>>> c = np.arange(-128,128)
>>> g = prtools.gauss(r, c, sigma=20)
>>> plt.imshow(g, cmap='gray')
../_images/prtools-gauss-1.png