           mod-v (range v-tiles)
           chunk (range (/ (sqr edge-length) chunk-size))
           :when (valid-modis? mod-h mod-v)]
-      (let [chunk-seq (resample data res mod-h mod-v chunk chunk-size)]
-        [mod-h mod-v chunk chunk-seq]))))+      (let [idx-seq (resample data res mod-h mod-v chunk chunk-size)]
+        [mod-h mod-v chunk idx-seq]))))
        sample (+ line index)]
    [sample line]))

(defn rain-index
  "INCOMPLETE. Returns the index inside a rain data vector for the
  given inputs."
  [mod-h mod-v sample line res]
  (geo-coords mod-h mod-v sample line res))

(defn resample
  "Takes in a month's worth of PREC/L rain data, and returns a lazy

  [data res mod-h mod-v chunk chunk-size]
  (let [rain (vec data)]
    (for [pixel (range chunk-size)]
      (let [[sample line] (tile-position chunk pixel chunk-size)]
        (rain-index mod-h mod-v sample line res)))))

;; TODO -- this query currents generates all chunks for a specific
;; rain month. We want to convert this so that it generates the MAPS
;; of all chunks! Then, we'll feed this whole business in with each
;; month, and (map month-data idx-seq).
(defmapcatop [rain-chunks [chunk-size]]
  ^{:doc "Takes in data for a single month of rain data, and resamples
  it to the MODIS sinusoidal grid at the supplied resolution. Returns
