             ModisPixelLocation ModisChunkLocation]
            [java.util ArrayList]
            [cascading.tuple Fields]
-           [cascading.scheme Scheme]
-           [cascading.tap TemplateTap SinkMode GlobHfs]
            [org.apache.hadoop.io BytesWritable]))
 
 ;; ## Custom File Input


(ns forma.hadoop.io
  (:use cascalog.api
        [clojure.contrib.def :only (defnk)]
        [clojure.string :only (join)]
        [cascalog.tap :only (hfs-tap)])
  (:require [forma.source.modis :as m]

  will be returned as 2-tuples, formatted as `<filename, file>` The
  filename is a text object, while the entire, unchopped file is
  encoded as a Hadoop `BytesWritable` object."
  [path & opts]
  (let [scheme (-> (:outfields opts Fields/ALL)
                   (whole-file))]
    (apply hfs-tap scheme path opts)))

;; ## Bucket to Cluster
;;
;; To get tuples back out of our directory structure on S3, we employ
;; Cascading's [GlobHFS] (http://goo.gl/1Vwdo) tap, along with an
;; interface tailored for datasets stored in the MODIS sinusoidal
;; projection. For details on the globbing syntax, see
;; [here](http://goo.gl/uIEzu).
;;
;; GlobHfs is activated through the `:source-pattern` argument to one
;; of the hfs- taps.

(defn tiles->globstring
  [& tiles]
