1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
| ### PART I-----DOWNLOAD DATA----------------------------------------------------
# load packages
library(CopernicusMarine)
library(tidyverse)
*
# check out products listttty7656
x <- copernicus_products_list()
*
# filter to selection
selection <- filter(x, str_detect(str_to_lower(mainVariables), "temp")) %>%*
* filter(str_detect(tempResolutions, "Monthly")) %>% filter(str_detect(areas, "Mediterranean Sea"))
*
# check variable list of "MEDSEA_ANALYSISFORECAST_PHY_006_013" product
selection$mainVariables[1]
*
# select product of interest
my_product <- selection$product_id[1]
*
# check product details for layer info
pr_info <- copernicus_product_details(my_product) # pick a layer and copy
*
# download
copernicus_download_motu(
* username = "",
* password = "",
* destination** = "dates", # folder created previously
* product****** = my_product,
* layer******** = "cmems_mod_med_phy-tem_anfc_4.2km_P1M-m", # monthly data
* variable***** = "thetao", # Sea water potential temperature
* output******* = "netcdf",
* region******* = c(-4, 30, 17, 45), # xmin ymin xmax ymax*
* timerange**** = c("2022-01-01", "2022-12-31"),*
* verticalrange = c(0, 2),
* sub_variables = c("thetao")
) |
Partager