dc.g1sst: Download and Cache a G1SST (SST data/model) File

Description Usage Arguments Value History References See Also Examples

View source: R/g1sst.R

Description

dc.g1sst() downloads data from a G1SST server.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
dc.g1sst(
  year,
  month,
  day,
  lonW,
  lonE,
  latS,
  latN,
  server = "https://coastwatch.pfeg.noaa.gov/erddap/griddap",
  destdir = ".",
  destfile,
  force = FALSE,
  dryrun = FALSE,
  debug = getOption("dcDebug", 0)
)

Arguments

year, month, day

Numerical values of the year, month, and day of the desired dataset.

lonW, lonE

Numerical values, in range -180 to 180, specifying the longitudes of the western and eastern boundaries of the focus region.

latS, latN

Numerical values, in range -90 to 90, specifying the latitudes of the southern and northern boundaries of the focus region.

server

character value giving the base name of the server, used in the construction of URL queries. Since servers tend to change over time, this is a good argument to check, when debugging code that once worked but now fails.

destdir

character value indicating the directory in which to store downloaded files. The default value of "." means to store the downloaded file in the present working directory. Set destdir=NULL if destfile is a filename with full path information. File clutter is reduced by creating a top-level directory called data, with subdirectories for various file types; see “Examples”.

destfile

character value indicating the name of the file. If not supplied, then the file name is constructed from the other parameters of the function call, so that subsequent calls with the same parameters will yield the same result; this is useful for caching.

force

A logical value that indicates whether to force the download, even if the pathname constructed from destdir and destfile already exists.

dryrun

A logical value that indicates whether to return the constructed web query, without attempting to download the file. This can be helpful in designing responses to changing URLs.

debug

an integer specifying whether debugging information is to be printed during processing. The printing is done by a call to dcDebug(). Setting debug=0 turns off this form of debugging, while higher values yield more information. If one dc function calls another, it passes the value of debug but decreased by 1, which means that the value of debug controls not just the breadth of debugging, but also the depth.

Value

String indicating the full pathname to the downloaded file.

History

Download URLs working as of 2018-02-07.

References

  1. source URL-construction tutorial https://coastwatch.pfeg.noaa.gov/erddapinfo/index.html

  2. status page https://coastwatch.pfeg.noaa.gov/erddap/status.html

See Also

Other functions that download ocean-related data: dc.coastline(), dc.hydrography(), dc.met(), dc.topo(), dc.woa()

Examples

1
2
3
4
5
6
7
8
9
## Not run: 
## Scotian Shelf on Oct 14, 2015.
f <- dc.g1sst(2015, 10, 14, -66, -60, 41, 46, destdir="~/data/g1sst")
library(oce)
d <- read.g1sst(f, destdir="~/data/g1sst")
plot(d, "SST")
mtext(d[["time"]], side=3, line=0, adj=0)

## End(Not run)

dankelley/dc documentation built on June 3, 2020, 8:25 a.m.