View source: R/cms_download_subset.r
| cms_download_subset | R Documentation |
Subset and download a specific marine product
from Copernicus.
cms_download_subset(
username = cms_get_username(),
password = cms_get_password(),
product,
layer,
variable,
region,
timerange,
verticalrange,
progress = TRUE,
crop = TRUE,
asset,
...
)
username |
Your Copernicus marine user name. Can be provided with
|
password |
Your Copernicus marine password. Can be provided as
|
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 |
progress |
A logical value. When |
crop |
On the server, the data is organised in chunks. The subset
will download chunks that overlap with the specified ranges, but often
covers a larger area. When |
asset |
Type of asset to be used when subsetting data. Should be one
of |
... |
Ignored (reserved for future features). |
Returns a stars::st_as_stars() object.
Pepijn de Vries
if (interactive() && requireNamespace("blosc")) {
mydata <- cms_download_subset(
product = "GLOBAL_ANALYSISFORECAST_PHY_001_024",
layer = "cmems_mod_glo_phy-cur_anfc_0.083deg_P1D-m",
variable = c("uo", "vo"),
region = c(-1, 50, 10, 55),
timerange = c("2025-01-01 UTC", "2025-01-02 UTC"),
verticalrange = c(0, -2)
)
plot(mydata["vo"])
} else {
message("Make sure to run this in an interactive environment")
message("and that the package 'blosc' is installed")
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.