   [series]
   (vec-ify (cons (first series) (rest (reductions max series)))))
 
+(defn dec->int100
+  [coll]
+  (map (comp int round (partial * 100)) coll))
+
+(defn clean-probs
+  "smooth the probabilities with a backward-looking moving average, make the 
+  series monotonically increasing, and finally make each probability 0->1 an 
+  integer 0->100"
+  [coll]
+  (let [window 3]
+    [(vec (-> coll
+              (backward-looking-mavg window)
+              (mono-inc)
+              (dec->int100)))]))
+
 (defn date-no-sep
   [date-str]
   (reduce str (split date-str #"-")))

        [forma.reproject :only (modis->latlon)]
        [forma.date-time :only (period->datetime datetime->period)]
        [clojure.string :only (split join)]
        [forma.utils :only (moving-average average)])
  (:require [cascalog.ops :as c]))

(defn get-val
  [out-m & k]

  (let [dates (mk-date-header tres date-prefix ts)
        header (csv-ify args)]
    (csv-ify header dates)))
