This is experimental code that could be used in the spatialDomainNoGrid
    section to build a grid of points on which to generate the solution.
    However, the current development plan (as of 27 Jan 2015) is to have the 
    end user supply the list of points where they want a solution (and/or for 
    it to be provided in a more automated way by GRASS GIS). But because this 
    (untested) code may still be useful, it will remain as its own function 
    here.
    It used to be in f2d.py.

def define_points_grid(self):
    """
    This is experimental code that could be used in the spatialDomainNoGrid
    section to build a grid of points on which to generate the solution.
    However, the current development plan (as of 27 Jan 2015) is to have the 
    end user supply the list of points where they want a solution (and/or for 
    it to be provided in a more automated way by GRASS GIS). But because this 
    (untested) code may still be useful, it will remain as its own function 
    here.
    It used to be in f2d.py.
    """
    # Grid making step
    # In this case, an output at different (x,y), e.g., on a grid, is desired
    # First, see if there is a need for a grid, and then make it
    # latlon arrays must have a pre-set grid
    if self.latlon == False:
      # Warn that any existing grid will be overwritten
      try:
        self.dx
        if self.Quiet == False:
          print("dx and dy being overwritten -- supply a full grid")
      except:
        try:
          self.dy
          if self.Quiet == False:
            print("dx and dy being overwritten -- supply a full grid")
        except:
          pass
      # Boundaries
      n = np.max(self.y) + self.alpha
      s = np.min(self.y) - self.alpha
      w = np.min(self.x) + self.alpha
      e = np.max(self.x) - self.alpha
      # Grid spacing
      dxprelim = self.alpha/50. # x or y
      nx = np.ceil((e-w)/dxprelim)
      ny = np.ceil((n-s)/dxprelim)
      dx = (e-w) / nx
      dy = (n-s) / ny
      self.dx = self.dy = (dx+dy)/2. # Average of these to create a 
                                     # square grid for more compatibility
      self.xw = np.linspace(w, e, nx)
      self.yw = np.linspace(s, n, ny)
    else:
      print("Lat/lon xw and yw must be pre-set: grid will not be square")
      print("and may run into issues with poles, so to ensure the proper")
      print("output points are chosen, the end user should do this.")
      sys.exit()