getProfiles | R Documentation |
This takes an index constructed with getIndex()
, possibly
after focusing with subset,argoFloats-method()
, and creates
a list of files to download from the server named in the index.
Then these files are downloaded to the destdir
directory,
using filenames inferred from the source filenames. The
value returned by getProfiles()
is suitable for use
by readProfiles()
.
getProfiles(
index,
destdir = argoDefaultDestdir(),
age = argoDefaultProfileAge(),
retries = 3,
skip = TRUE,
quiet = TRUE,
debug = 0
)
index |
an |
destdir |
character value indicating the directory in which to store
downloaded files. The default value is to compute this using
|
age |
Option 1) a numerical value indicating a time interval, in days. If the file to be downloaded from the server already exists locally, and was created is less than age days in the past, it will not be downloaded. The default is one year. Setting age=0 will force a download. Option 2) "latest" meaning the file will only be downloaded if A) the file doesn't exist or B) the file does exist and the time it was created is older than the date_update in the index file |
retries |
integer telling how many times to retry a download, if the first attempt fails. |
skip |
A logical value indicating whether to skip over netcdf
files that cannot be downloaded from the server. This is |
quiet |
logical value; use |
debug |
integer value indicating level of debugging. If this
is less than 1, no debugging is done. Otherwise, some functions
will print debugging information. If a function call fails, the
first step should be to rerun the function with |
It should be noted that the constructed server URL follows
a different pattern on the USGODAE an Ifremer servers, and
so if some other server is used, the URL may be wrong, leading
to an error. Similarly, if the patterns on these two
servers change, then getProfiles()
will fail. Users who
encounter such problems are requested to report them
to the authors.
If a particular data file cannot be downloaded after multiple trials, then
the behaviour depends on the value of the skip
argument. If that is
TRUE
then a NA
value is inserted in the corresponding
spot in the return value, but if it is FALSE
(the default), then an error is reported.
Note that readProfiles()
skips over any such NA
entries,
while reporting their positions within index
.
For more on this function, see Kelley et al. (2021).
An object of class argoFloats
with type="profiles"
, the
data
slot of which contains two items: url
,
which holds the URLs from which the NetCDF
files were downloaded, and file
, which
holds the path names of the downloaded files; the latter
is used by readProfiles()
.
Dan Kelley
Kelley, D. E., Harbin, J., & Richards, C. (2021). argoFloats: An R package for analyzing Argo data. Frontiers in Marine Science, (8), 636922. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.3389/fmars.2021.635922")}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.