{ "cells": [ { "cell_type": "markdown", "id": "eecd1d2c-6b93-428e-8a60-5800274da618", "metadata": {}, "source": [ "## Using the ESA CCI Toolbox with the xcube Viewer\n", "\n", "The xcube viewer is an easy way to display gridded data. In this notebook, we show how the viewer can be started from a notebook and how cci datasets can be added to it.\n", "\n", "To run this Notebook, make sure the ESA CCI Toolbox is setup correctly." ] }, { "cell_type": "markdown", "id": "cb14d9ac-8491-410d-a836-c554dae785c7", "metadata": {}, "source": [ "The viewer requires datasets. For this notebook, we will access them from the Zarr store and the regular store." ] }, { "cell_type": "code", "execution_count": 1, "id": "c8835695-30f4-49aa-9a83-bd83f66db59e", "metadata": { "tags": [] }, "outputs": [], "source": [ "from xcube.core.store import new_data_store\n", "\n", "zarr_store = new_data_store('esa-cci-zarr')\n", "cci_store = new_data_store('esa-cci')" ] }, { "cell_type": "markdown", "id": "e2b51cb0-ebf9-4579-b4ab-83ea6141bd9b", "metadata": {}, "source": [ "If you want, you can execute the following lines to see which datasets are available. For now, this part is in a comment as we do not want to print all the datasets for reasons of readability." ] }, { "cell_type": "code", "execution_count": 2, "id": "db8b5afb-3f1f-4e3d-b02d-66f23fb15b1a", "metadata": {}, "outputs": [], "source": [ "# zarr_store.list_data_ids()" ] }, { "cell_type": "code", "execution_count": 3, "id": "9452e767-c40c-4081-a05d-051daf84f93a", "metadata": {}, "outputs": [], "source": [ "# cci_store.list_data_ids()" ] }, { "cell_type": "markdown", "id": "83cf99d0-98df-4550-aed2-a32d9bcda85c", "metadata": {}, "source": [ "From the Zarr store, we pick a snow dataset." ] }, { "cell_type": "code", "execution_count": 4, "id": "5185b930-ec04-4a63-abb6-592345663b8f", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
<xarray.Dataset> Size: 823GB\n",
"Dimensions: (lat: 1800, nv: 2, lon: 3600, time: 7934)\n",
"Coordinates:\n",
" * lat (lat) float64 14kB -89.95 -89.85 -89.75 ... 89.75 89.85 89.95\n",
" lat_bnds (lat, nv) float64 29kB dask.array<chunksize=(900, 2), meta=np.ndarray>\n",
" * lon (lon) float64 29kB -179.9 -179.8 -179.8 ... 179.7 179.8 179.9\n",
" lon_bnds (lon, nv) float64 58kB dask.array<chunksize=(900, 2), meta=np.ndarray>\n",
" * time (time) datetime64[ns] 63kB 1979-01-02 1979-01-04 ... 2020-05-24\n",
"Dimensions without coordinates: nv\n",
"Data variables:\n",
" swe (time, lat, lon) float64 411GB dask.array<chunksize=(10, 900, 900), meta=np.ndarray>\n",
" swe_std (time, lat, lon) float64 411GB dask.array<chunksize=(10, 900, 900), meta=np.ndarray>\n",
"Attributes: (12/43)\n",
" Conventions: CF-1.9\n",
" cdm_data_type: grid\n",
" comment: The following auxiliary datasets are used for...\n",
" creator_email: kari.luojus@fmi.fi (Scientific and Production...\n",
" creator_name: Finnish Meteorological Institute\n",
" creator_url: www.fmi.fi\n",
" ... ...\n",
" time_coverage_duration: P1D\n",
" time_coverage_end: 20200524T000000Z\n",
" time_coverage_resolution: P1D\n",
" time_coverage_start: 19790102T000000Z\n",
" title: ESA CCI snow SWE product level L3C daily, Dyn...\n",
" tracking_id: 25063fb5-47ad-424a-8f26-29bdf35efb78<xarray.Dataset> Size: 308kB\n",
"Dimensions: (time: 12, lat: 80, lon: 80, bnds: 2)\n",
"Coordinates:\n",
" * lat (lat) float32 320B -39.5 -38.5 -37.5 ... 38.5 39.5\n",
" * lon (lon) float32 320B -22.5 -21.5 -20.5 ... 55.5 56.5\n",
" * time (time) datetime64[ns] 96B 2005-01-16T12:00:00 .....\n",
" time_bnds (time, bnds) datetime64[ns] 192B dask.array<chunksize=(12, 2), meta=np.ndarray>\n",
"Dimensions without coordinates: bnds\n",
"Data variables:\n",
" absorbing_aerosol_index (time, lat, lon) float32 307kB dask.array<chunksize=(1, 80, 80), meta=np.ndarray>\n",
"Attributes:\n",
" Conventions: CF-1.7\n",
" title: esacci.AEROSOL.mon.L3.AAI.multi-sensor.multi-pla...\n",
" date_created: 2025-12-04T11:52:18.378325\n",
" processing_level: L3\n",
" time_coverage_start: 2005-01-01T00:00:00\n",
" time_coverage_end: 2006-01-01T00:00:00\n",
" time_coverage_duration: P365DT0H0M0S\n",
" history: [{'program': 'xcube_cci.chunkstore.CciChunkStore...