View source: R/griddap_split.R
| griddap_split | R Documentation |
griddap_season uses the R program 'rerddap::griddap()' to extract environmental data
from an 'ERDDAP' server in an (time, z, y ,x) bounding box where time is restricted to a
given season of the year (see below). Arguments are the same as in 'rerddap::griddap()'
except for the added 'season' parameter. 'read' and 'fmt' options are ignored.
griddap_split(
datasetx,
...,
fields = "all",
stride = 1,
request_split = NULL,
fmt = "nc",
url = rerddap::eurl(),
store = rerddap::disk(),
read = TRUE,
callopts = list(),
aggregate_file = NULL
)
datasetx |
Anything coercable to an object of class info. So the output of a
call to |
... |
Dimension arguments. See examples. Can be any 1 or more of the dimensions for the particular dataset - and the dimensions vary by dataset. For each dimension, pass in a vector of length two, with min and max value desired. at least 1 required. |
fields |
(character) Fields to return, in a character vector. |
stride |
(integer) How many values to get. 1 = get every value, 2 = get every other value, etc. Default: 1 (i.e., get every value) |
request_split |
A numeric vector indicating the number of splits for each dimension, used to segment the request into manageable chunks. This is particularly useful for large datasets. |
fmt |
(character) One of:
|
url |
A URL for an ERDDAP server. Default:
https://upwell.pfeg.noaa.gov/erddap/ - See |
store |
ignored |
read |
ignored |
callopts |
Curl options passed on to |
aggregate_file |
A string specifying:
|
Varies by format requested:
if "fmt = nc" the path to the NetCDF file where the results are stored
if "fmt = duckdb" the path to the duckdb file where the results are stored
if "fmt = memory" the usual rerddap::griddap dataframe
myURL <- "https://coastwatch.pfeg.noaa.gov/erddap/"
response <- try(httr::HEAD(myURL, httr::timeout(20)), silent = TRUE)
if (inherits(response, "try-error")) {
message("The ERDDAP\u2122 server is not responding")
} else
{
data(wind_info)
request_split <- list(time = 2, altitude = 1, latitude = 1, longitude = 1)
res <- try(griddap_split(wind_info,
time = c('2015-12-31','2016-01-01'),
latitude = c(20, 21),
longitude = c(220, 221),
fields = 'mod_current',
request_split = request_split
), silent = TRUE)
if (inherits(res, "try-error")) {
message("Unable to retrieve data from the ERDDAP\u2122 server")
}
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.