                     (metadata dataset "SUBDATASETS")))
       (finally (.delete dataset)))))
 
+;; TODO: Check if this is eqivalent with tests.
+(defn subdataset-names
+  "Returns the NAME entries of the SUBDATASETS metadata Hashtable for
+  the dataset at a given filepath."
+  [hdf-path]
+  (with-gdal-open [dataset (str hdf-path)]
+    (vals (filter #(s/substring? "_NAME" (key %))
+                  (metadata dataset "SUBDATASETS")))))
+
 (defn subdataset-key
   "Takes a long-form path to a MODIS subdataset, and checks to see if
   any of the values of the modis-subsets map can be found as

     (let [bytes (get-bytes stream)
           temp-hdf (contrib.io/file tdir (hash-str stream))
           keep? (dataset-filter to-keep)]
       (do
         (contrib.io/copy bytes temp-hdf)
         (map make-subdataset
              (filter keep? (subdataset-names temp-hdf))))))
  ([tdir]
     (contrib.io/delete-file-recursively tdir)))


   SUBDATASETS metadata dictionary against the supplied collection of
   acceptable dataset keys."
  [good-keys]
  (fn [name]
    (->> good-keys
         (map modis-subsets)
         (some #(s/substring? % name)))))

(defn make-subdataset
  "Accepts a filepath from the SUBDATASETS dictionary of a MODIS Dataset,
