         [clojure.contrib.math :only (sqrt)])
   (:require [incanter.core :as i]
             [incanter.stats :as s]))
-
-;; NOTE Currently, the NDVI and reliability sample time-series comes from the NDVI
-;; trends presentation.  We will have to start a test data file at
-;; some point, but I don't want to fuck with the directory structure
-;; right now, while I am learning to navigate the project.
 
 ;; The first few functions are more general, and could be pulled into,
 ;; say, the matrix operation namespace.  For now, we will leave them

  (let [offset (+ long-block window)
        [x y z] (map #(-> % (- offset) (+ 2)) [ref-pd start-pd end-pd])
        full-ts (whoop-full ts reli-ts long-block window)]
    (apply array-map
           (interleave
            [:reference :for-est]
            (map (partial subvec full-ts) [(dec x) (dec y)] [x z])))))

;; {:reference (subvec full-ts (dec x) x)
;;      :for-est (subvec full-ts (dec y) z)}

;; WHIZBANG


  [f window xs]
  (pmap f (partition window 1 xs)))

(defn make-monotonic
  "move through a collection `coll` picking up the min or max values, depending
  on the value of `comparator` which can be either `min` or `max`.  This is very
  similar, I think, to the `reduce` function, but with side effects that print
  into a vector."
  [comparator coll]
  (reduce (fn [acc val]
            (conj acc
