Full marine data sets can be downloaded using the File Transfer Protocol (FTP). Use these functions to list download locations and get the files.
Usage
copernicus_ftp_list(
product,
layer,
username = getOption("CopernicusMarine_uid", ""),
password = getOption("CopernicusMarine_pwd", ""),
recursive = TRUE,
subdir = NULL
)
copernicus_ftp_get(
url,
destination,
show_progress = TRUE,
overwrite = FALSE,
username = getOption("CopernicusMarine_uid", ""),
password = getOption("CopernicusMarine_pwd", "")
)
Arguments
- product
An identifier (type
character
) of the desired Copernicus marine product. Can be obtained withcopernicus_products_list
.- layer
The name of a desired layer within a product (type
character
). Can be obtained withcopernicus_product_details
.- username
Your Copernicus marine user name. Can be provided as
options(CopernicusMarine_uid = "my_user_name")
, or as argument here.- password
Your Copernicus marine password. Can be provided as
options(CopernicusMarine_pwd = "my_password")
, or as argument here.- recursive
A
logical
value. WhenTRUE
all nested files will be listed.- subdir
A
character
string of a subdir which will be appended to the obtained ftp address.- url
The URL of the file to be downloaded. Obtain this URL with
copernicus_ftp_list
.- destination
File or path where the requested file will be downloaded to.
- show_progress
A
logical
value. WhenTRUE
(default) the download progress will be shown. This can be useful for large files.- overwrite
A
logical
value. WhenFALSE
(default), files at thedestination
won't be overwritten when the exist. Instead an error will be thrown if this is the case. When set toTRUE
, existing files will be overwritten.
Value
In case of copernicus_ftp_list
a tibble
is returned containing available URLs
(for the specified product and layer) and some meta information is returned.
In case of copernicus_ftp_get
an invisible logical
value is returned, indicating whether
the requested file is successfully stored at the destination
path.
Examples
if (FALSE) {
## Assuming that Copernicus account details are provided as `options`
cop_ftp_files <- copernicus_ftp_list("GLOBAL_OMI_WMHE_heattrp")
destination <- tempdir()
copernicus_ftp_get(cop_ftp_files$url[[1]], destination)
}