R/download_data.R
download_data.RdSatellite tracking data are accessed from the SMRU data server,
or accessed from the Wildlife Computers Portal API via the source argument.
Data files are saved to the data.dir specified in the JSON config file.
SMRU tag data are currently downloaded as a single .mdb (Microsoft Access
Database) file. Wildlife Computers tag data are downloaded as a series of .CSV
files saved in tag-specific directories (uniquely named with WC UUID's).
Wildlife Computers data, partial deployment metadata are output as an R object.
download_data(
dest = NULL,
source = "smru",
cid = NULL,
user = NULL,
pwd = NULL,
wc.akey = NULL,
wc.skey = NULL,
owner.id = NULL,
subset.ids = NULL,
download = TRUE,
...
)destination path to save download
source type of data to be downloaded. Can be one of:
smru - SMRU Data Server;
wc - Wildlife Computers Data Portal API;
SMRU tag deployment campaign id(s) to download, eg. "ct180"
SMRU data server username as a quoted string
SMRU data server password as a quoted string
an Access Key issued by Wildlife Computers for their API
a Secret Key issued by Wildlife Computers for their API
the Wildlife Computers uuid associated with the data owner
a single column .CSV file of WC UUID's to be included in the QC, with uuid as the variable name.
(logical) indicating if the data is to be downloaded from
the tag manufacturer's server. If the source is wc and download = FALSE
then only the Wildlife Computers tag deployment metadata is downloaded.
additional arguments passed to smru_get_mdb() or wc_get_files()
if (FALSE) { # \dontrun{
## SMRU data download
download_data(
dest = file.path(wd, config$setup$data.dir),
source = "smru",
cid = config$harvest$cid,
user = config$harvest$smru.usr,
pwd = config$harvest$smru.pwd,
timeout = config$harvest$timeout
)
## Wildlife Computers data download & deployment metadata acquisition
wc.deploy.meta <- download_data(
dest = file.path(wd, config$setup$data.dir),
source = "wc",
unzip = TRUE,
wc.akey = config$harvest$wc.akey,
wc.skey = config$harvest$wc.skey,
subset.ids = config$harvest$tag.list,
download = TRUE,
owner.id = config$harvest$owner.id
)
} # }