This function is a wrapper from the CopernicusMarine function from pyhton. A pyhton setup must be present in your computer, thus this function is testing if some pyhton is present and if not it offer to download it from R.

BEE.load.copernicus(
  username,
  password,
  dataset_id,
  dataset_version,
  variables,
  minimum_longitude,
  maximum_longitude,
  minimum_latitude,
  maximum_latitude,
  start_datetime,
  end_datetime,
  coordinates_selection_method = "strict-inside",
  disable_progress_bar = FALSE,
  output_directory = here::here("Data")
)

Arguments

username

: Is your Copernicus account username, you can create an account here : https://data.marine.copernicus.eu/register?redirect=%2Fproducts%3Fdisc%3Dnone

password

: Is your Copernicus account password.

dataset_id

: Is available on the corpernicus page of your product, in "Data access" rubric, under the temporal resolution name. It is usually start by cmems_ ... Check vignette 0.1 Download data from Copernicus. for more informations.

dataset_version

: It the version of the dataset, you can found it in the "Product user manual" or as subtitle in the Marine Data Store, it is usually in capital letters.

variables

: Is the variable you are interested in, you can only call one variable at a time. Variables name are visible in Marine Data Store - Product - Data access - From (bellow subset) - use the name in grey before square bracket. Check vignette 0.1 Download data from Copernicus. for more informations.

minimum_longitude

: You can use the "Draw on map" Copernicus tool to select an area of interest in Marine Data Store - Product - Data access

  • Form (bellow subset) and copy the values using "N" (north) as the maximum latitude and "W" (west) as the minimum longitude if working in the northwest hemisphere.

maximum_longitude

: Maximum longitude at which data will be extracted.

minimum_latitude

: Minimum latitude at which data will be extracted.

maximum_latitude

: Maximum latitude at which data will be extracted.

start_datetime

: First day wanted in the downloaded spatraster. Please make sure that the date is available on copernicus.

end_datetime

: Last day wanted in the downloaded spatraster. Please make sure that the date is available on copernicus.

coordinates_selection_method

: = stric-inside" by default, extraction method, to see more info, check the python API help to get moer detail https://help.marine.copernicus.eu/en/articles/7949409-copernicus-marine- toolbox-introduction

disable_progress_bar

: Allows to pot a progress bar of the downloading, by default it is set on 'FALSE'.

output_directory

: Where you want the data to be save, by default it goes to the "Data" file next to your script if there is one.

Value

A SpatRaster subset from the Copernicus Marine Data Store according to the provided timeframe and spatial frame. It is saved directly to your computer in an .nc file (see the 'output_directory' argument). To load the dataset in your R environment use: terra::rast("output_directory/data_set_name.nc")

Details

You can select your downloading conditions in https://data.marine.copernicus.eu/products : Product : Data access : Form and then copy and past the argument of the copernicusmarine.subset function in https://data.marine.copernicus.eu/products - Product - Data access : Form : Automate : Pyhton API and use them as this function arguments.

Examples

if (FALSE) { # \dontrun{
# Non interactive exemple because this function requieres personnal
# Copernicus logging informations. To test this function you can create the
# variables my_username and my_password in your environment and copy/paste
# the code bellow.
BEE.load.copernicus(
username=my_username,
password=my_password,
dataset_id="cmems_SST_MED_SST_L4_REP_OBSERVATIONS_010_021",
dataset_version="202411",
variables="analysed_sst",
minimum_longitude=2.9,
maximum_longitude=7.8,
minimum_latitude=42,
maximum_latitude=43.7,
start_datetime="1982-01-01T00:00:00",
end_datetime="2024-12-31T00:00:00",
coordinates_selection_method="strict-inside",
disable_progress_bar=TRUE,
output_directory = here::here("Data")
)
} # }