  271: last period in test time series"
  (count (telescoping-long-trend 23 100 271 ndvi reli rain)) => 172
  (count (first (telescoping-long-trend 23 100 271 ndvi reli rain))) => 3
- (count (telescoping-short-trend 30 10 23 100 110 ndvi reli))  => 11
- (last  (telescoping-short-trend 30 10 23 100 110 ndvi reli))  => (roughly -63.2393))
+ (count (telescoping-short-trend 30 10 23 100 271 ndvi reli))  => 172
+ (last  (telescoping-short-trend 30 10 23 100 271 ndvi reli))  => (roughly -89.45618))
 
 (fact
  "test that the magnitude of the short-term drop of the
  transformed (shifted down) time series is higher than that of the
  original time series"
- (let [s-drop (telescoping-short-trend 30 10 23 138 (count ndvi) ndvi reli)
-       big-drop (telescoping-short-trend 30 10 23 138 (count ndvi) (shift-down-end ndvi) reli)]
+ (let [s-drop (telescoping-short-trend 30 10 23 138 271 ndvi reli)
+       big-drop (telescoping-short-trend 30 10 23 138 271 (shift-down-end ndvi) reli)]
    (- (abs (reduce min big-drop)) (abs (reduce min s-drop))) => pos?))
 
 ;; Benchmark

          (transpose
           (telescoping-long-trend 23 start end ndvi-ts reli-ts rain-ts))))))

<<<<<<< HEAD
(defn short-trend-results
  "returns three vectors, the first with the hansen statistic for time
  series ranging from 0 through 135 (end of training period) and 136;

  in there anyway to ensure forward compatibility"
  [m]
  (let [start 135
        end 136
        [ndvi-ts reli-ts] ((juxt :ndvi :reli) m)]
    (schema/timeseries-value start end
     (telescoping-short-trend 30 10 23 start end ndvi-ts reli-ts))))

(deftest long-trends-test
  (facts
   "check that the long- and short-term statistics match the expected
values of the test data vectors."
   (let [long-trend-query
         (<- [?han-stat ?long-drop ?long-tstat]
             (ts-tap ?ts-map)
             (long-trend-results ?ts-map :> ?han-stat ?long-drop ?long-tstat)
             (:distinct false))
         short-trend-query
         (<- [?min-drop]
             (ts-tap ?ts-map)
             (short-trend-results ?ts-map :> ?min-drop)
             (:distinct false))]
     long-trend-query =>
     (produces-some [[{:start-idx 135
                       :end-idx 136
                       :series [1.2393550741169639 1.2133709085855648]}
                      {:start-idx 135
                       :end-idx 136
                       :series [2.4915869043482424 1.3049908881259853]}
                      {:start-idx 135
                       :end-idx 136
                       :series [1.1504228201940752 0.5951173333726173]}]])
     short-trend-query =>
     (produces-some [[{:start-idx 135
                       :end-idx 136
                       :series [-63.23936661263988 -63.23936661263988]}]]))))

