code: def pysal_G(self, **kwargs):
          
          if self.weights is None:
              self.raster_weights(**kwargs)
          rasterf = self.raster.flatten()
          rasterf = rasterf[rasterf.mask==False]
          self.G = pysal.G(rasterf, self.weights, **kwargs)
docs: Compute Getis and Ord’s G for GeoRaster
  
          Usage:
          geo.pysal_G(permutations = 1000, rook=True)
  
          arguments passed to raster_weights() and pysal.G
          See help(gr.raster_weights), help(pysal.G) for options