code: def clean_coordinates(coords, silent=False):
      
      l1 = len(coords)
      coords = coords[~N.isnan(coords).any(axis=1)] # remove NaN values
      l2 = len(coords)
      if not silent:
          msg = "{0} coordinates".format(l2)
          if l2 < l1:
              msg += " ({0} removed as invalid)".format(l1-l2)
          print(msg)
      return coords
docs: Removes invalid coordinates (this is generally caused
      by importing coordinates outside of the DEM)