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 in 'rerddap::griddap()' except for the added 'season' parameter. 'read' and 'fmt' options are ignored.

griddap_season(
  datasetx,
  ...,
  fields = "all",
  stride = 1,
  season = NULL,
  fmt = "nc",
  url = rerddap::eurl(),
  store = rerddap::disk(),
  read = TRUE,
  callopts = list()
)

Arguments

datasetx

Anything coercable to an object of class info. So the output of a call to info, or a datasetid, which will internally be passed through info

...

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)

season

(character) a character array with the times of the trajectory in the form c("MM-DD", "MM-DD")

fmt

(character) ignored

url

A URL for an ERDDAP server. Default: https://upwell.pfeg.noaa.gov/erddap/ - See rerddap::eurl() for more information

store

ignored

read

ignored

callopts

Curl options passed on to verb-GET

Value

An object of class griddap_csv if csv chosen or griddap_nc if nc file format chosen.

Examples

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)
season <- c('03-01', '03-04')
season_extract <- try(griddap_season(wind_info,
                                 time = c('2015-01-01','2016-01-01'),
                                 latitude = c(20, 21),
                                 longitude = c(220, 221),
                                 fields = 'mod_current',
                                 season = season
                                 ), silent = TRUE)
if (inherits(season_extract, "try-error")) {
   message("Unable to retrieve data from the ERDDAP\u2122 server")
   }
 }
#> info() output passed to x; setting base url to: https://coastwatch.pfeg.noaa.gov/erddap
#> info() output passed to x; setting base url to: https://coastwatch.pfeg.noaa.gov/erddap
#> info() output passed to x; setting base url to: https://coastwatch.pfeg.noaa.gov/erddap
#> info() output passed to x; setting base url to: https://coastwatch.pfeg.noaa.gov/erddap