 (def sample-output-map
   [{:cntry       "IDN"
     :admin       23456
-    :lat         45
-    :lon         90
-    :pixel       5
+    :modh 28
+    :modv 7
+    :line 5
+    :sample 10
     :prob-series (schema/timeseries-value
                   (end-training "16")
                   [0.1 0.2 0.4 0.7 0.9])
     :tres        "16"
-    :sres        500
+    :sres        "500"
     :hansen      0}
    {:cntry       "IDN"
     :admin       23456
-    :lat         46
-    :lon         91
-    :pixel       6
+    :modh 28
+    :modv 7
+    :line 5
+    :sample 9
     :prob-series (schema/timeseries-value
                   (end-training "16")
                   [0.1 0.1 0.1 0.1 0.1])
     :tres        "16"
-    :sres        500
+    :sres        "500"
     :hansen      1}
    {:cntry       "IDN"
     :admin       23456
-    :lat         45.2
-    :lon         90.1
-    :pixel       7
+    :modh 28
+    :modv 7
+    :line 4
+    :sample 10
     :prob-series (schema/timeseries-value
                   (end-training "16")
                   [0.1 0.2 0.4 0.7 0.9])
     :tres        "16"
-    :sres        500
+    :sres        "500"
     :hansen      0}
    {:cntry       "IDN"
     :admin       23456
-    :lat         45.3
-    :lon         90.2
-    :pixel       8
+    :modh 28
+    :modv 7
+    :line 5
+    :sample 11
     :prob-series (schema/timeseries-value
                   (end-training "16")
                   [0.1 0.6 0.6 0.65 0.9])
     :tres         "16"
-    :sres         500
+    :sres        "500"
     :hansen       1}
    {:cntry       "MYS"
     :admin       12345
-    :lat         32
-    :lon         89
-    :pixel       5
+    :modh 28
+    :modv 7
+    :line 4
+    :sample 9
     :prob-series (schema/timeseries-value
                   (end-training "16")
                   [0.1 0.2 0.4 0.7 0.9])
     :tres        "16"
-    :sres        500
+    :sres        "500"
     :hansen      1}])
+
+
+;; (defn latlon-series
+;;   [res out-m]
+;;   (modis->latlon  ))
+
+(defn grab-modis-coords
+  [m]
+  (vec (map #(get m %) [:sres :modh :modv :sample :line])))
+
+(defn grab-series
+  [m]
+  (:series (:prob-series m)))
+
+(defn convert-to-latlon
+  [out-m]
+  (let [series (grab-series out-m)
+        [res modh modv sample line] (grab-modis-coords out-m)]
+    (modis->latlon res modh modv sample line)))
+
+(def latlon-series-tap
+  (<- [?lat ?lon ?series]
+      (sample-output-map ?m)
+      (convert-to-latlon ?m :> ?lat ?lon ?series)))
+
+(fact
+  (grab-modis-coords (first sample-output-map)) => [500 28 7 10 5])
+
+(fact
+  (grab-series (first sample-output-map)) => [0.1 0.2 0.4 0.7 0.9])
+
+(fact
+  (convert-to-latlon (first sample-output-map)) => [5])
+
+;; (deftest adding-latlon
+;;   (fact
+;;     (get-latlon-series sample-output-map) => (produces [{:lat 1 :lon 1 }])))
+
+;; (def sample-pixel-map
+;;   (schema/pixel-location "500" 28 7 5 10)
+;;   (modis->latlon ))
 
 (defmapcatop grab-sig-pixels
   "return a vector of three-tuples, with the country iso code, the

                         ["MYS" 830 0.7]
                         ["MYS" 831 0.9]
                         ["nil" 0 0]])))





  the alert.  If the probability of clearing never exceeds the
  threshold, then a stand-in three-tuple is returned."
  [res out-m thresh]
  (let [series (grab-series out-m)
        idx (positions #(> % thresh) series)
        offset (end-training res)]
    (if (empty? idx)
