1. Import Necessary Packages¶
In this section, we import the required Python packages to work with ESA Climate Change Initiative (CCI) data. Most notably, we use the ESA Climate Toolbox which simplifies access, manipulation, and visualization of CCI datasets in Python.
These packages allow us to:
- Access satellite-based climate data records from ESA.
- Handle geospatial and temporal dimensions efficiently.
- Visualize data with intuitive plotting tools.
📚 For a broader introduction to the toolbox and how to install it, visit:
🔗 ESA CCI Climate Toolbox Quick Start
🔗 ESA Climate Data Toolbox Website
from xcube.core.store import new_data_store
from esa_climate_toolbox.core import get_op
from esa_climate_toolbox.core import list_ecv_datasets
from esa_climate_toolbox.core import get_store
from esa_climate_toolbox.core import list_datasets
from esa_climate_toolbox.ops import plot
import xarray as xr
import matplotlib.pyplot as plt
import warnings
%matplotlib inline
Step 2: Connect to the ESA CCI Data Store¶
The ESA Climate Toolbox provides direct access to the ESA Climate Data Store, which hosts harmonized satellite-based climate data records produced under the ESA Climate Change Initiative (CCI).
In this step, we establish a connection to the data store so we can browse and open datasets. This connection allows us to access data without having to download files manually — a convenient way to explore and analyze large geospatial datasets in cloud-friendly formats such as Zarr or Kerchunk.
The data store includes a wide range of essential climate variables (ECVs), such as aerosols, land surface temperature, sea level, and soil moisture.
📘 Learn more about available datasets:
🔗 ESA Climate Data Toolbox – Quick Start Guide
cci_store = new_data_store("esa-cci")
# List all available data sets of an ECV
# list_ecv_datasets("Icesheets")
Step 3: Define the Dataset ID¶
To work with a specific ESA CCI dataset, we need to specify its dataset ID. This unique identifier tells the toolbox which variable and product we want to access.
In this example, we are using a dataset from the Ice Sheets CCI project, providing annual Surface Elevation Change (SEC) data over the Greenland Ice Sheet. SEC is derived from multiple satellite altimeter missions and is a key variable for understanding ice sheet mass balance, sea level rise, and climate change impacts in polar regions.
For other ESA CCI projects (e.g., Cloud, Land Cover, Greenhouse Gases), simply replace the dataset ID accordingly to access the relevant product.
We will use the following dataset ID:
data_id = 'esacci.ICESHEETS.yr.Unspecified.SEC.multi-sensor.multi-platform.UNSPECIFIED.1-2.r1'
📘 A full list of dataset IDs can be retrieved from the store or found in the ESA CCI Climate Toolbox documentation.
Step 4: Describe Dataset (Check Available Variables and Metadata)¶
Before loading the full dataset, it’s helpful to inspect the metadata to understand its structure. This includes:
- Available variables (e.g., AOD, uncertainty estimates)
- Temporal and spatial coverage
- Data format and structure
This step ensures we know what the dataset contains and how to work with it. It also helps confirm that the variable we want to plot or analyze is actually included.
🛠️ Tip: You can use the description to verify variable names, dimensions (e.g., lat
, lon
, time
), and time coverage.
📘 More on dataset structure:
🔗 ESA Climate Toolbox – Data Access
cci_store.describe_data(data_id)
Step 5: Check Open Parameters for the Dataset¶
Before opening the dataset, we can inspect which parameters are supported by the Zarr opener (e.g., time_range
, bbox
, variable_names
). This step helps ensure that we pass valid arguments when loading data and avoid errors.
The command below lists all expected input parameters and their allowed values for the selected dataset.
cci_store.get_open_data_params_schema(data_id=data_id, opener_id='dataset:zarr:cciodp')
Step 6: Define Region, Time Range, and Variables of Interest¶
Before opening the dataset, we define a few key parameters:
- Time range: the date(s) we want to load
- Variables: which data variable(s) to retrieve
- (Optional) Bounding box: spatial region of interest — here we skip it to load the global dataset
variables = ['SEC'] # Variable to retrieve
start_date = '2014-01-01' # Start and end date (same for a single timestep)
end_date = '2014-12-31'
# bbox = (-10.0, 35.0, 30.0, 60.0) # Optional: restrict to a region like Europe
Step 7: Open the Dataset¶
Now we open the dataset using the selected parameters.
The ESA Climate Toolbox will download only the necessary data (e.g., variable and time range).
You can always adjust the time range or variables to explore different slices of the dataset.
icesheet_ds = cci_store.open_data(
data_id=data_id,
variable_names=variables,
time_range=[start_date, end_date]
# bbox=bbox # Uncomment if regional selection is needed
)
Step 8: Display Dataset Structure¶
We print a summary of the opened dataset to inspect its structure, dimensions, variables, and metadata.
This helps verify that the data was loaded correctly and shows what is available for analysis and visualization.
This step is useful to understand what the dataset contains before working with it further.
print("\nOpened Dataset:\n", icesheet_ds)
Opened Dataset:
<xarray.Dataset> Size: 655kB
Dimensions: (time: 1, y: 541, x: 301, bnds: 2)
Coordinates:
* time (time) datetime64[ns] 8B 2014-07-02T12:00:00
time_bnds (time, bnds) datetime64[ns] 16B dask.array<chunksize=(1, 2), meta=np.ndarray>
* x (x) float32 1kB -6.5e+05 -6.45e+05 ... 8.45e+05 8.5e+05
* y (y) float32 2kB -6.5e+05 -6.55e+05 ... -3.345e+06 -3.35e+06
Dimensions without coordinates: bnds
Data variables:
SEC (time, y, x) float32 651kB dask.array<chunksize=(1, 541, 301), meta=np.ndarray>
grid_projection <U0 0B ...
Attributes:
Conventions: CF-1.7
title: esacci.ICESHEETS.yr.Unspecified.SEC.multi-sensor...
date_created: 2025-04-16T11:22:56.456245
processing_level: Unspecified
time_coverage_start: 2014-01-01T00:00:00
time_coverage_end: 2015-01-01T00:00:00
time_coverage_duration: P365DT0H0M0S
history: [{'program': 'xcube_cci.chunkstore.CciChunkStore...
Step 9: Visualize Results¶
We now create a simple map plot of the selected variable.
This allows us to explore the spatial patterns of the data — in this case, the Aerosol Optical Depth (AOD) for the selected day.
For more interactive and advanced visualizations, check out the ESA Climate Toolbox or the Toolbox documentation.
import matplotlib.pyplot as plt
# Extract the SEC data for the first (and only) time slice
sec = icesheet_ds["SEC"].isel(time=0)
# Flip the y-axis if needed by sorting
if sec.y[0] > sec.y[-1]:
sec = sec.sortby("y")
# Plot
plt.figure(figsize=(10, 6))
sec.plot(
cmap="RdBu_r",
robust=True,
cbar_kwargs={"label": "Surface Elevation Change (m/year)"}
)
plt.title("Surface Elevation Change (Greenland Ice Sheet) – 2014")
plt.xlabel("x (m)")
plt.ylabel("y (m)")
plt.tight_layout()
plt.show()
