% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/griddap_season.R
\name{griddap_season}
\alias{griddap_season}
\title{Title Get ERDDAP gridded data restricted to a given season of the year}
\usage{
griddap_season(
  datasetx,
  ...,
  fields = "all",
  stride = 1,
  season = NULL,
  fmt = "nc",
  url = rerddap::eurl(),
  store = rerddap::disk(),
  read = TRUE,
  callopts = list()
)
}
\arguments{
\item{datasetx}{Anything coercable to an object of class info. So the output of a
call to \code{\link[rerddap]{info}}, or a datasetid, which will internally be passed
through \code{\link[rerddap]{info}}}

\item{...}{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.}

\item{fields}{(character) Fields to return, in a character vector.}

\item{stride}{(integer) How many values to get. 1 = get every value, 2 = get every other value, etc.
Default: 1 (i.e., get every value)}

\item{season}{(character) a character array with the times of the trajectory in
the form  c("MM-DD", "MM-DD")}

\item{fmt}{(character) ignored}

\item{url}{A URL for an ERDDAP server. Default:
https://upwell.pfeg.noaa.gov/erddap/ - See \code{\link[rerddap:eurl]{rerddap::eurl()}} for
more information}

\item{store}{ignored}

\item{read}{ignored}

\item{callopts}{Curl options passed on to \code{\link[crul]{verb-GET}}}
}
\value{
An object of class \code{griddap_csv} if csv chosen or
\code{griddap_nc} if nc file format chosen.
}
\description{
\code{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.
}
\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")
   }
 }
}
