Takes the result of estimate_griddap_size() together with a named list of split counts per dimension and reports the estimated uncompressed size of one split. The total number of splits is the product of all split counts (e.g. splits = list(time = 5, latitude = 2, longitude = 2) means 20 total splits). Per-split point counts use ceiling(n_pts / split_count) so uneven divisions are handled correctly and estimates are conservative.

estimate_griddap_split_size(size_est, splits, verbose = TRUE)

Arguments

size_est

The list returned invisibly by estimate_griddap_size().

splits

Named list of split counts per dimension. Dimensions not listed are assumed to have a split count of 1 (no split).

verbose

Logical; print a summary (default TRUE).

Value

Invisibly, a named list with the total split count, per-split cell count, per-variable byte estimates, total per-split bytes, and a formatted size string.

Examples

if (FALSE) { # \dontrun{
  library(rerddap)

  myURL = 'https://coastwatch.pfeg.noaa.gov/erddap/'
  response <- try(httr::HEAD(myURL, httr::timeout(10)), silent = TRUE)
  if (inherits(response, "try-error")) {
     stop("The ERDDAP\u2122 server is not responding")
  }
  wind_info <- info("erdQMekm14day", url = myURL)
  sz <- estimate_griddap_size(wind_info,
    latitude  = c(20, 40),
    longitude = c(-140, -110),
    time      = c("2015-01-01", "2016-01-01"),
    fields    = "mod_current")

  estimate_griddap_split_size(sz,
    splits = list(time = 5, altitude = 1, latitude = 2, longitude = 2))
} # }