sainsc.lazykde.LazyKDE.gaussian_kernel

sainsc.lazykde.LazyKDE.gaussian_kernel(bw, *, unit='px', truncate=2, circular=False)

Set the kernel used for kernel density estimation (KDE) to gaussian.

Parameters:
  • bw (float) – Bandwidth of the kernel.

  • unit (str) – Which unit the bandwidth of the kernel is defined in: ‘px’ or ‘um’. ‘um’ requires sainsc.LazyKDE.resolution to be set correctly.

  • truncate (float, optional) – The radius for calculating the KDE is calculated as bw * truncate. Refer to scipy.ndimage.gaussian_filter().

  • circular (bool, optional) – If True calculate the KDE using a circular kernel instead of square by setting all values outside the radius bw * truncate to 0.

Raises:
  • ValueError – If unit is neither ‘px’ nor ‘um’.

  • ValueError – If unit is ‘um’ but resolution is not set.