code: def immoments(im, p,q):
      x = list(range(im.shape[1]))
      y = list(range(im.shape[0]))
      #coord=np.array([x.flatten(),y.flatten()]).T
      
      moment = np.sum([i**p*j**q*im[i,j] for j in x for i in y], dtype=np.float64)
      return moment
docs: moment = 0
      momentx = 0
      for i in x.flatten():
          moment+=momentx
          sumx=0
          for j in y.flatten():
              sumx+=i**0*j**0*star0[i,j]