                                 (constrained-tap
                                  ts-pail-path "ndvi" s-res t-res))))
 
-              fire-step ([:tmp-dirs fire-path]
-                           (?- (hfs-seqfile fire-path)
-                               (tseries/fire-query pail-path
-                                                   t-res
-                                                   "2000-11-01"
-                                                   est-end)))
-
-              adjustfires
-              ([:tmp-dirs adjusted-fire-path]
-                 (?- (hfs-seqfile adjusted-fire-path)
-                     (forma/fire-tap est-map (hfs-seqfile fire-path))))
-
-              rain-step
-              ([:tmp-dirs rain-path]
-                 (?- (hfs-seqfile rain-path)
-                     (mk-filter vcf-path
-                                (new-adjusted-precl-tap
-                                 ts-pail-path s-res "32" t-res))))
-
-              reli-step
-              ([:tmp-dirs reli-path]
-                 (?- (hfs-seqfile reli-path)
-                     (mk-filter vcf-path
-                                (constrained-tap
-                                 ts-pail-path "reli" s-res t-res))))
-              
-              adjustseries
-              ([:tmp-dirs adjusted-series-path]
-                 "Adjusts lengths of all timeseries so they all cover the same
-                  time spans."
-                 (with-job-conf {"mapred.min.split.size" 805306368}
-                   (?- (hfs-seqfile adjusted-series-path)
-                       (forma/dynamic-filter (hfs-seqfile ndvi-path)
-                                             (hfs-seqfile reli-path)
-                                             (hfs-seqfile rain-path)))))
-
-              cleanseries ([:tmp-dirs clean-series]
-                             "Runs the trends processing."
-                             (?- (hfs-seqfile clean-series)
-                                 (forma/dynamic-clean
-                                  est-map (hfs-seqfile adjusted-series-path))))
-
-              trends ([:tmp-dirs trends-path]
-                        "Runs the trends processing."
-                        (?- (hfs-seqfile trends-path)
-                            (forma/analyze-trends
-                             est-map (hfs-seqfile clean-series))))
-
-              mid-forma ([:tmp-dirs forma-mid-path
-                          :deps [trends adjustfires]]
-                           (?- (hfs-seqfile forma-mid-path)
-                               (forma/forma-tap (hfs-seqfile trends-path)
-                                                (hfs-seqfile adjusted-fire-path))))
-              
-              final-forma
-              ([] (let [names ["?s-res" "?period" "?mod-h" "?mod-v"
-                               "?sample" "?line" "?forma-val"]
-                        mid-src (-> (hfs-seqfile forma-mid-path)
-                                    (name-vars names))]
-                    (?- (hfs-seqfile out-path)
-                        (forma/forma-query est-map mid-src)))))))
-
-(defmain ultrarunner
-  [tmp-root eco-beta-path full-beta-path static-path dynamic-path out-path country-or-eco pre-beta-out-path]
-  (let [est-map (forma-run-parameters "500-16")]
-    (workflow [tmp-root]              
-              ;; genbetas
-              ;; ([]
-              ;;    (let [beta-path (if (= "eco" country-or-eco)
-              ;;                      eco-beta-path
-              ;;                      full-beta-path)]
-              ;;      (?- (hfs-seqfile beta-path)
-              ;;          (forma/beta-generator est-map
-              ;;                                (hfs-seqfile final-path)
-              ;;                                (hfs-seqfile static-path)))))
-              applybetas
-              ([] (?- (hfs-seqfile out-path :sinkmode :replace)
-                      (forma/forma-estimate (hfs-seqfile eco-beta-path)
-                                            (hfs-seqfile dynamic-path)
-                                            (hfs-seqfile
-                                            static-path)))))))
-
-(defn run-forma-estimate
-  [beta-src dynamic-src static-src out-loc trap-path period]
-  (?- (hfs-seqfile out-loc :sinkmode :replace)
-      (forma/forma-estimate 
-       (hfs-seqfile beta-src)
-       (hfs-seqfile dynamic-src)
-       (hfs-seqfile static-src)
-       (hfs-seqfile trap-path)
-       period)))
-
-(comment
-  (run-forma-estimate "s3n://formaresults/ecobetatemp"
-                      "s3n://formaresults/finalbuckettemp"
-                      "s3n://formaresults/staticbuckettemp"
-                      "s3n://formaresults/finaloutput"
-                      "s3n://formaresults/trapped"
-                      827))
-
+              )))

              :long-block 15
              :window 5}
   "500-16" {:est-start "2005-12-31"
             :est-end "2012-01-17"
             :s-res "500"
             :t-res "16"
             :neighbors 1

            [forma.hadoop.jobs.forma :as forma]
            [forma.hadoop.jobs.timeseries :as tseries]
            [forma.date-time :as date]
            [forma.classify.logistic :as log]
            [forma.thrift :as thrift]))

(def convert-line-src
  (hfs-textline "s3n://modisfiles/ascii/admin-map.csv"))
