 ;;; documented. Additionally, this will make converting between parameter
 ;;; schemes an explicit operation on explicit data.
 
-(defrecord Longitude [low high])
-(defrecord Latitude [low high])
-(defrecord Bounds [lat lon])
-
-(defn bounds->rec
-  [[lon-lo lat-lo lon-hi lat-hi]]
-  (map->Bounds
-    {:lat (map->Latitude {:low lat-lo :high lat-hi})
-     :lon (map->Longitude {:low lon-lo :high lon-hi})}))
-
 (defn ->pixels
   [{x-dim :x y-dim :y} bounds]
   (let [[lon-lo lat-lo lon-hi lat-hi] (map #(Integer/parseInt %) bounds)

                          (str "$1" fallback-replacement "$3")))))))

(defn data-files->opendap-urls
  [params pattern-info data-files]
  (->> data-files
       (map (partial data-file->opendap-url pattern-info))
       (map #(str % "." (:format params)))))

(defn get-opendap-urls
  [search-endpoint user-token raw-params]

        all-vars (collection/extract-variable-ids coll)
        vars (variable/get-metadata search-endpoint user-token params all-vars)
        bounding-info (map variable/extract-bounding-info vars)
        pixels (bounding-info->pixels bounding-info)
        query (bounding-info->opendap-query bounding-info)]
    (log/debug "data-files:" (into [] data-files))
    (log/debug "pattern-info:" pattern-info)
    (log/debug "all variable ids:" all-vars)
    (log/debug "variable bounding-info:" (into [] bounding-info))
    (log/debug "pixels:" (into [] pixels))
    (log/debug "query:" query)
    (results/create
     (data-files->opendap-urls params pattern-info data-files query)
     :elapsed (util/timed start))))
