code: def gaussian_kernel(gstd):
      
      Nc = np.ceil(gstd*3)*2+1
      x = np.linspace(-(Nc-1)/2,(Nc-1)/2,Nc,endpoint=True)
      g = np.exp(-.5*((x/gstd)**2))
      g = g/np.sum(g)
  
      return g
docs: Generate odd sized truncated Gaussian
  
      The generated filter kernel has a cutoff at $3\sigma$
      and is normalized to sum to 1
  
      Parameters
      -------------
      gstd : float
              Standard deviation of filter
  
      Returns
      -------------
      g : ndarray
              Array with kernel coefficients