Copernicus Marine In Situ TAC

Marine Data Store and In Situ data

Marine Data Store and In Situ data

At the moment, all datasets are available via the Files service, using the File Browser or the Copernicus Marine Toolbox (more info here). 
However, not all datasets are available via the Subset service yet. You can check the status of each dataset in this table (PDF).
Exception: for IN SITU products, when available from the Subset, only the datasets part latest are available for download. The monthly and history datasets parts should be available via the Subset at the end of the year.

Here is the different status levels you’ll find in the table:

  • Available: the dataset is accessible now
  • Upcoming Details: the dataset will be available in the coming months
  • Future development: the dataset will be available in the future
  • N/A: the dataset won’t be accessible

Download In Situ TAC files using the command line

Command line :

(copernicus toolbox in cli)

Example of downloading files by name

~$copernicusmarine get --request-file ./request_file.json

Example of request_file.json

{
“dataset_id”: “cmems_obs-ins_glo_phybgcwav_mynrt_na_irr”,
“dataset_part”: “latest”,
“force_dataset_version”: “202311”,
“filter”: “20240312/BO_PR_CT.nc”,
“regex”: false,
“output_directory”: “data”,
“show_outputnames”: true,
“force_service”: “original-files”,
“force_download”: false,
“request_file”: false,
“overwrite_output_data”: false,
“overwrite_metadata_cache”: false,
“no_metadata_cache”: false
}

Example to get Index files (temporary):

~$copernicusmarine get --dataset-id cmems_obs-ins_glo_phybgcwav_mynrt_na_irr --index-parts

Get S3 files using aws command line

aws s3 cp –endpoint-url “https://s3.waw3-1.cloudferro.com” –no-sign-request s3://mdl-native-01/native/INSITU_GLO_PHYBGCWAV_DISCRETE_MYNRT_013_030/cmems_obs-ins_glo_phybgcwav_mynrt_na_irr_202211/history/BO/GL_PR_BO_EXIC0091.nc .

How to use new services in a Jupyter Notebook

import copernicusmarine
from pprint import pprint
username = 'yourlogin'
password = 'yourpassword'
dataset_id = 'cmems_obs-ins_glo_phybgcwav_mynrt_na_irr'
part = 'latest'

Check copernicusmarine version

Information about get function

?copernicusmarine.get
Many options are available.

Download files from a file list

Open a txt file and put here the files your want to download

Example:

~$cat >> files_to_download.txt

INSITU_GLO_PHYBGCWAV_DISCRETE_MYNRT_013_030/cmems_obs-ins_glo_phybgcwav_mynrt_na_irr_202311/history/MO/GL_TS_MO_6200001.nc

INSITU_GLO_PHYBGCWAV_DISCRETE_MYNRT_013_030/cmems_obs-ins_glo_phybgcwav_mynrt_na_irr_202311/history/MO/GL_TS_MO_6200069.nc

# Define output storage parameters
output_directory = './copernicus-data'
file_list = 'files_to_download.txt'


# Call the get function to save data
get_result = copernicusmarine.get(
username = username,
password = password,
dataset_id=dataset_id,
index_parts = True,
file_list = file_list,
output_directory=output_directory,
no_directories=True)


pprint(f"List of saved files: {get_result}")

Manipulate the NetCDF files downloaded

import matplotlib.pyplot as plt
import numpy as np
import xarray as xr
plt.style.use('ggplot')

path = r'./copernicus-data'
file = 'GL_TS_MO_6200069.nc'

ds = xr.open_dataset(path + '/' + file)

# Define the start and end dates
start_date = '2024-03-01'
end_date = '2024-05-01'


plt.figure(figsize=(10, 6))


# Select data for the specified time range
subset_data = ds.sel(TIME=slice(start_date, end_date))
VAVH = subset_data.VAVH
DEPH = subset_data.DEPH

plt.title('Wave Height between {} and {}'.format(start_date, end_date))
plt.xlabel('TIME')
plt.ylabel('Wave height (VAVH)')
plt.plot(subset_data.TIME,VAVH.sel(DEPTH=0))
plt.show()