Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Notebook title

binderkagglecolab

Provide an introduction and context for the notebook here.

Learning objectives 🎯

This is a mandatory section for C3S training material

Describe briefly what the learner/user can expect to learn in this notebook. Address the learner directly, for example:

You will use and adapt this Jupyter notebook template to create your own Jupyter notebook tutorials. Having followed this notebook, you will gain an understanding of the overall layout, common elements, metadata schema and best practices to apply in creating Jupyter notebook based learning resources for ECMWF.

If the notebook is targeted to a niche audience and is not already stated in a Jupyterbook or webpage where the notebook can be accessed, please summarise them here, or in a separate section.

Prepare your environment

Insert here any necessary instructions to set-up the environment of learners, any background information on data, projects, access to data catalogues, or preliminary steps necessary to run the notebooks. These may include instructions for installing packages, imports, etc.

(Install and) Import libraries

# Install required libraries
!pip install -q cdsapi
# Import your libraries here
import cdsapi

Setup credentials (optional)

If you have not setup your ~/.cdsapirc file with your credentials, you can replace None with your credentials that can be found on the how to api page (you will need to log in to see your credentials).

# If you have already setup your .cdsapirc file you can leave this as None
cdsapi_key = None
cdsapi_url = None

Define your data request (optional)

If your notebook retrieves data, describe (or link to) the request parameters and expected outputs here.

dataset = "reanalysis-era5-single-levels-monthly-means"
filename = "dataset-filename.nc"
request = {
    "product_type": ["monthly_averaged_reanalysis"],
    "variable": ["2m_temperature"],
    "year": ["2023"],
    "month": ["06", "07", "08"],
    "time": ["00:00"],
    "data_format": "netcdf",
    "download_format": "unarchived",
}

client = cdsapi.Client(url=cdsapi_url, key=cdsapi_key)
client.retrieve(dataset, request).download({filename})

Take home messages 📌

In this section, summarise key take home messages.

  • Key message 1

  • Key message 2

  • Key message 3