                              format
                              (count data-files)
                              vars
-                             sample-granule-metadata-size)]
+                             sample-granule-metadata-size
+                             params)]
        ;; Error handling for post-stages processing
        (if (errors/erred? estimate-or-errs)
          (do

        measurements (reduce + (map get-measurement variables))]
    (+ (* granule-count compression measurements) metadata)))

(defn estimate-netcdf3-size
  [granule-count variables metadata]
  (let [compression 1
        measurements (reduce + (map get-measurement variables))]
    (+ (* granule-count compression measurements) metadata)))

(defn- -estimate-size
  [fmt granule-count vars granule-metadata-size]
  (case (keyword (string/lower-case fmt))
    :dods (estimate-dods-size granule-count vars)
    :nc (estimate-netcdf3-size granule-count vars granule-metadata-size)
    (do
      (log/errorf "Cannot estimate size for %s (not implemented)." fmt)
      {:errors ["not-implemented"]})))

;;; Note that all internal operations for estimating size are performed
;;; assuming bytes as the units.

(defn- get-measurement
  [variable]
  (let [dims (get-in variable [:umm :Dimensions])
        total-dimensionality (reduce * (map :Size dims))
        data-type (get-in variable [:umm :DataType])]
    (* total-dimensionality
       (util/data-type->bytes data-type))))

(defn- get-avg-gran-size
  [vars]
  (let [value (get-in (first vars) [:umm :SizeEstimation :AvgCompressionRateASCII])]
    (if (string? value)
      (read-string value)
      value)))

(defn- get-avg-compression-rate
  [vars]
  (let [value (get-in (first vars) [:umm :SizeEstimation :AverageSizeOfGranulesSampled])]
    (if (string? value)
      (read-string value)
      value)))

(defn estimate-dods-size
  [granule-count variables]
