Learn R Programming

CopernicusMarine (version 0.2.3)

copernicus_ftp_list: List and get FTP files for a Copernicus marine product

Description

[Deprecated] 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", "") )

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.

Arguments

product

An identifier (type character) of the desired Copernicus marine product. Can be obtained with copernicus_products_list.

layer

The name of a desired layer within a product (type character). Can be obtained with copernicus_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. When TRUE 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. When TRUE (default) the download progress will be shown. This can be useful for large files.

overwrite

A logical value. When FALSE (default), files at the destination won't be overwritten when the exist. Instead an error will be thrown if this is the case. When set to TRUE, existing files will be overwritten.

Author

Pepijn de Vries

Examples

Run this code
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)
}

Run the code above in your browser using DataLab