 ;; grid.
 
 (defn travel
-  "travel along a grid with cellsize `step` in the direction
-  given by `dir` from an initial position `start` to a position
-  `pos` which is intended to be, for most applications, row or
-  column within the grid.  Note that this takes you to the
-  centroid of the row or column position that you specify."
+  "travel along a grid with cellsize `step` in the direction given by
+  `dir` from an initial position `start` to a position `pos` which is
+  intended to be, for most applications, row or column within the
+  grid.  Note that this takes you to the centroid of the row or column
+  position that you specify."
   [step dir start pos]
   (-> start (dir (* pos step)) (dir (/ step 2))))
 


(defn index-textfile
  "Prepend a row index to a text file `old-file-name`, located at `base-path`,
  and save in the same directory with new name `new-file-name`. The `num-drop`
  parameter specifies the number of lines to drop from the beginning of the 
  text file.  Note that indexing begins with the first textline not dropped,
  and starts at 0. This function was originally written to clean an ASCII
  raster file for input into the sampling functions."
  [base-path old-file-name new-file-name num-drop]
  (let [old-file (str base-path old-file-name)
        new-file (str base-path new-file-name)]

;; direction, between modis and wgs84. Replace with a calculation.

(defn sample-modis
  "This function is based on the reference MODIS grid (currently at
  1000m res).  The objective of the function is to tag each MODIS
  pixel with a value from an input ASCII grid.  The process diverges
  based on whether the ASCII grid is at coarser or finer resolution
  than the MODIS grid.  If higher, then each ASCII point is assigned a
  unique MODIS identifier, and the duplicate values are aggregated
  based on an input aggregator (sum, max, etc.).  If lower, each MODIS
  pixel is tagged with the ASCII grid cell that it falls within.  Note
  that the ASCII grid must be in WGS84, with row indices prepended and
  the ASCII header lopped off."
  ([m-res dataset pixel-tap ascii-path & [agg]]
     (let [ascii-info ((keyword dataset) static-datasets)
           grid-source (ascii-source ascii-path)]
