View source: R/cms_download_subset.r
cms_download_subset | R Documentation |
Subset and download a specific marine product from Copernicus. You need to register an account at https://data.marine.copernicus.eu before you can use this function.
cms_download_subset(
username = getOption("CopernicusMarine_uid", ""),
password = getOption("CopernicusMarine_pwd", ""),
destination,
product,
layer,
variable,
region,
timerange,
verticalrange,
overwrite = FALSE
)
username |
Your Copernicus marine user name. Can be provided as
|
password |
Your Copernicus marine password. Can be provided as
|
destination |
File or path where the requested file will be downloaded to. |
product |
An identifier (type |
layer |
The name of a desired layer within a product (type |
variable |
The name of a desired variable in a specific layer of a product (type |
region |
Specification of the bounding box as a |
timerange |
A |
verticalrange |
A |
overwrite |
A |
Returns a logical
value invisibly indicating whether the requested file was
successfully stored at the destination
.
Pepijn de Vries
## Not run:
destination <- tempfile("copernicus", fileext = ".nc")
## Assuming that Copernicus account details are provided as `options`
cms_download_subset(
destination = destination,
product = "GLOBAL_ANALYSISFORECAST_PHY_001_024",
layer = "cmems_mod_glo_phy-cur_anfc_0.083deg_P1D-m",
variable = "sea_water_velocity",
region = c(-1, 50, 10, 55),
timerange = c("2021-01-01 UTC", "2021-01-02 UTC"),
verticalrange = c(0, -2)
)
mydata <- stars::read_stars(destination)
plot(mydata["vo"])
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.