 
 (defn rain-chunker
   "Like `modis-chunker`, for NOAA PRECL data files."
-  [m-res chunk-size tile-seq path pail-path]
+  [m-res chunk-size tiles source-path sink-path]
   (with-fs-tmp [fs tmp-dir]
-    (let [file-tap  (io/hfs-wholefile path)
-          pix-tap   (p/pixel-generator tmp-dir m-res tile-seq)
+    (let [file-tap (io/hfs-wholefile source-path)
+          pix-tap (p/pixel-generator tmp-dir m-res tiles)
           ascii-map (:precl static/static-datasets)]
       (->> (r/rain-chunks m-res ascii-map chunk-size file-tap pix-tap)
-           (to-pail pail-path)))))
+           (to-pail sink-path)))))
 
 (defmain PreprocessRain
-  "See project wiki for example usage."
-  [path pail-path & countries]
-  (let [countries (map read-string countries)]
-    (rain-chunker "1000"
-                  static/chunk-size
-                  (apply tile-set countries)
-                  path
-                  pail-path)))
+  "The locations can be ISO keywords or [h v] tuples."
+  [source-path sink-path s-res & locations]
+  {:pre [(string? s-res)
+         locations]}
+  (let [tiles (apply tile-set (map read-string locations))
+        chunk-size static/chunk-size]
+    (rain-chunker s-res chunk-size tiles source-path sink-path)))
 
 (defn static-chunker
+  "m-res - MODIS resolution. "
   [m-res chunk-size tile-seq dataset agg ascii-path pail-path]
   (with-fs-tmp [_ tmp-dir]
     (let [line-tap (hfs-textline ascii-path)


(defmain PreprocessStatic
  "See project wiki for example usage."
  [dataset ascii-path output-path & countries]
  (static-chunker "500"
                  static/chunk-size
                  (->> countries
                       (map read-string)

(defmain PreprocessAscii
  "TODO: This is only good for hansen datasets looking to be combined
  Tidy up. This needs to be combined with PreprocessStatic."
  [dataset ascii-path pail-path s-res & countries]
  {:pre [(#{"hansen" "vcf"} dataset)
         (string? s-res)]}
  (with-fs-tmp [_ tmp-dir]
    (let [line-tap (hfs-textline ascii-path)
          pix-tap  (->> countries
                        (map read-string)
                        (apply tile-set)
                        (p/pixel-generator tmp-dir s-res))]
      (->> (s/static-modis-chunks static/chunk-size
                                  dataset
                                  ({"vcf" c/min "hansen" c/sum} dataset c/max)
