Description Usage Arguments Details Value Caution Author(s) References See Also Examples
Download and cache data from an argo profiling float.
1 2 3 4 5 6 7 8 9 10 11 12 |
id |
a character string giving the
float ID to be queried.
argo float. If this is provided, then |
longitude |
Two-element numerical vector holding the limits of longitude (degrees East) to search for Argo profiles. |
latitude |
Two-element numerical vector holding the latitude limits (degrees North). |
time |
Two-element character vector holding the time limits in YYYY-MM-DD format. |
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 |
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 |
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 |
dc.argoById()
downloads data for the float with
a specified identifier, dc.argoSearch()
downloads the
most recent profile for all floats in a specified longitude,
latitude, and time box, and dc.argo
is a wrapper that
calls either of the first two functions, depending on
whether the id
argument is provided.
In any case, the downloads are made from the USGODAE server (ref 1)
by default (or from any other server that obeys the same directory
structure). Since the servers do not provide an API for such
downloads, the dc.argo*
functions are forced to work by
constructing URLs that are devised based on inspection of queries
constructed from a GUI-style webpage (ref 2). This leads to a
brittleness that is discussed in “Caution”.
String indicating the full pathname to the downloaded file.
The queries used by the dc.argo
functions will fail
if USGODAE changes their system. For an example, USGODAE presently looks
for the substring ".submit=++Go++"
in the query, but if this
were to be switched to ".submit=Go"
, a seemingly trivial
change, then dc.argo
would fail entirely. For this reason,
the read.argo*
functions may fail at any time. Users who
encounter this problem should contact the author, who may be able
to find a way to reverse-engineer the updated Argo system.
Dan Kelley
Other functions related to argo data:
dc.argoById()
,
dc.argoIndex()
,
dc.argoSearch()
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | library(dc)
## Not run:
library(oce)
## 1. Get float profiles near Nova Scotia on Remembrance Day, 2017,
## and plot the first one as a CTD.
n <- dc.argo(longitude=c(-65,-55), latitude=c(40,50),
time=c("2017-11-11","2017-11-11"), destdir="~/data/argo")
a <- read.argo(n[1])
plotTS(as.ctd(a))
## 2. All profiles for a particular float.
N <- dc.argo(id="4902912", destdir="~/data/argo")
A <- read.argo(N)
plot(A, type="l") # trajectory
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.