code: def gauss_array(nx, ny=None, fwhm=1.0, sigma_x=None, sigma_y=None,
                  zero_norm=False):
      
  
      if ny is None:
          ny = nx
  
      if sigma_x is None:
          if fwhm is None:
              print('A value for either "fwhm" or "sigma_x" needs to be '
                    'specified!')
              raise ValueError
          else:
              # Convert input FWHM into sigma
              sigma_x = fwhm / (2 * np.sqrt(2 * np.log(2)))
  
      if sigma_y is None:
          sigma_y = sigma_x
  
      xradius = nx // 2
      yradius = ny // 2
  
      # Create grids of distance from center in X and Y
      xarr = np.abs(np.arange(-xradius, xradius + 1))
      yarr = np.abs(np.arange(-yradius, yradius + 1))
      hnx = gauss(xarr, sigma_x)
      hny = gauss(yarr, sigma_y)
      hny = hny.reshape((ny, 1))
      h = hnx * hny
  
      # Normalize gaussian kernel to a sum of 1
      h = h / np.abs(h).sum()
      if zero_norm:
          h -= h.mean()
  
      return h
docs: Computes the 2D Gaussian with size nx*ny.
  
          Parameters
          ----------
          nx : int
          ny : int [Default: None]
              Size of output array for the generated Gaussian. If ny == None,
              output will be an array nx X nx pixels.
  
          fwhm : float [Default: 1.0]
              Full-width, half-maximum of the Gaussian to be generated
  
          sigma_x : float [Default:  None]
          sigma_y : float [Default:  None]
              Sigma_x and sigma_y are the stddev of the Gaussian functions.
  
          zero_norm : bool [Default:  False]
              The kernel will be normalized to a sum of 1 when True.
  
          Returns
          -------
          gauss_arr : array
              A numpy array with the generated gaussian function