Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 37 additions & 10 deletions docs/notebooks/era5_decadal_warming.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": 4,
"id": "imports",
"metadata": {},
"outputs": [],
Expand All @@ -40,7 +40,7 @@
"import matplotlib.pyplot as plt\n",
"import pandas as pd\n",
"\n",
"from earthkit.climate.indicators.temperature import tn_days_above, tx_days_above"
"from earthkit.climate.indicators import temperature"
]
},
{
Expand All @@ -55,15 +55,42 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 5,
"id": "download_code",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Requesting data from CDS... This may take a few minutes as we are fetching 80+ years of data.\n",
"Requesting data from CDS... This may take a few minutes as we are fetching 80+ years of data.\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"2026-04-08 11:59:10,503 INFO [2026-02-16T00:00:00] - To generate this ERA5 hourly time series dataset, **homogenisation conventions have been applied to the ERA5 source GRIB data** to ensure consistency, usability, and alignment across chosen variables and time steps. The processed data were then written to an **ARCO Zarr archive**, enabling efficient cloud-optimised access and scalable data retrieval. Please refer to the [user guide](https://confluence.ecmwf.int/x/R6cfHg) for details.\n",
"\n",
"- The dataset presented here is a subset of selected parameters from the full [CDS ERA5 hourly data on single levels (1940–present)](https://cds.climate.copernicus.eu/datasets/reanalysis-era5-single-levels?tab=overview). **Requirements for additional parameters may be considered**. Please raise your request with ECMWF Support [here](https://jira.ecmwf.int/plugins/servlet/desk/portal/1/create/202).\n",
"INFO:ecmwf.datastores.legacy_client:[2026-02-16T00:00:00] - To generate this ERA5 hourly time series dataset, **homogenisation conventions have been applied to the ERA5 source GRIB data** to ensure consistency, usability, and alignment across chosen variables and time steps. The processed data were then written to an **ARCO Zarr archive**, enabling efficient cloud-optimised access and scalable data retrieval. Please refer to the [user guide](https://confluence.ecmwf.int/x/R6cfHg) for details.\n",
"\n",
"- The dataset presented here is a subset of selected parameters from the full [CDS ERA5 hourly data on single levels (1940–present)](https://cds.climate.copernicus.eu/datasets/reanalysis-era5-single-levels?tab=overview). **Requirements for additional parameters may be considered**. Please raise your request with ECMWF Support [here](https://jira.ecmwf.int/plugins/servlet/desk/portal/1/create/202).\n",
"2026-04-08 11:59:10,504 INFO Request ID is c5b84fff-de98-4e65-b043-443d2327fd5d\n",
"INFO:ecmwf.datastores.legacy_client:Request ID is c5b84fff-de98-4e65-b043-443d2327fd5d\n",
"2026-04-08 11:59:10,585 INFO status has been updated to accepted\n",
"INFO:ecmwf.datastores.legacy_client:status has been updated to accepted\n",
"2026-04-08 11:59:19,107 INFO status has been updated to running\n",
"INFO:ecmwf.datastores.legacy_client:status has been updated to running\n",
"2026-04-08 11:59:31,903 INFO status has been updated to successful\n",
"INFO:ecmwf.datastores.legacy_client:status has been updated to successful\n",
" \r"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"Data loaded successfully.\n"
]
}
Expand Down Expand Up @@ -98,7 +125,7 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 6,
"id": "processing_code",
"metadata": {},
"outputs": [],
Expand Down Expand Up @@ -135,16 +162,16 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": 7,
"id": "indicators_code",
"metadata": {},
"outputs": [],
"source": [
"# Summer Days: Tmax > 25°C (298.15 K)\n",
"su_annual = tx_days_above(tmax_daily, thresh=\"25 degC\").squeeze()\n",
"su_annual = temperature.tx_days_above(tmax_daily, thresh=\"25 degC\").squeeze()\n",
"\n",
"# Tropical Nights: Tmin > 20°C (293.15 K)\n",
"tr_annual = tn_days_above(tmin_daily, thresh=\"20 degC\").squeeze()"
"tr_annual = temperature.tn_days_above(tmin_daily, thresh=\"20 degC\").squeeze()"
]
},
{
Expand All @@ -159,7 +186,7 @@
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": 8,
"id": "visualization_code",
"metadata": {},
"outputs": [
Expand Down Expand Up @@ -249,7 +276,7 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 9,
"id": "decadal_code",
"metadata": {},
"outputs": [
Expand Down
18 changes: 9 additions & 9 deletions docs/notebooks/frost_days_pyrenees.ipynb
Comment thread
chpolste marked this conversation as resolved.

Large diffs are not rendered by default.

9 changes: 3 additions & 6 deletions docs/notebooks/heatwave_evolution.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,7 @@
"import xarray\n",
"\n",
"from earthkit.climate.datasets import load_sample_datasets\n",
"from earthkit.climate.indicators.temperature import (\n",
" heat_wave_frequency,\n",
" heat_wave_total_length,\n",
")\n",
"from earthkit.climate.indicators import temperature\n",
"\n",
"warnings.filterwarnings(\"ignore\")\n",
"datasets = load_sample_datasets()"
Expand Down Expand Up @@ -118,8 +115,8 @@
" window=window,\n",
" freq=\"YS\",\n",
" )\n",
" hwf = heat_wave_frequency(ds_tasmin.tasmin, ds_tasmax.tasmax, **hw_args)\n",
" hwt = heat_wave_total_length(ds_tasmin.tasmin, ds_tasmax.tasmax, **hw_args)\n",
" hwf = temperature.heat_wave_frequency(ds_tasmin.tasmin, ds_tasmax.tasmax, **hw_args)\n",
" hwt = temperature.heat_wave_total_length(ds_tasmin.tasmin, ds_tasmax.tasmax, **hw_args)\n",
" for da in [hwf, hwt]:\n",
" if da.attrs.get(\"units\") == \"1\":\n",
" da.attrs[\"units\"] = \"dimensionless\"\n",
Expand Down
21 changes: 9 additions & 12 deletions docs/notebooks/intro_precipitation_indices.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
},
{
"cell_type": "code",
"execution_count": 14,
"execution_count": null,
"id": "1b36bd42f74117db",
"metadata": {},
"outputs": [],
Expand All @@ -36,10 +36,7 @@
"import xarray as xr\n",
"\n",
"from earthkit.climate.datasets import load_sample_datasets\n",
"from earthkit.climate.indicators.precipitation import (\n",
" daily_pr_intensity,\n",
" maximum_consecutive_wet_days,\n",
")\n",
"from earthkit.climate.indicators import precipitation\n",
"\n",
"warnings.filterwarnings(\"ignore\")\n",
"\n",
Expand Down Expand Up @@ -104,7 +101,7 @@
},
{
"cell_type": "code",
"execution_count": 15,
"execution_count": null,
"id": "5c6692d99197d4af",
"metadata": {},
"outputs": [],
Expand All @@ -126,7 +123,7 @@
},
{
"cell_type": "code",
"execution_count": 16,
"execution_count": null,
"id": "51a81669f2d9f6fd",
"metadata": {},
"outputs": [
Expand Down Expand Up @@ -169,7 +166,7 @@
},
{
"cell_type": "code",
"execution_count": 17,
"execution_count": null,
"id": "4d1d91636c7a72d7",
"metadata": {},
"outputs": [
Expand Down Expand Up @@ -906,7 +903,7 @@
],
"source": [
"# Compute SDII\n",
"sdii = daily_pr_intensity(pr_ssp585)\n",
"sdii = precipitation.daily_pr_intensity(pr_ssp585)\n",
"sdii"
]
},
Expand All @@ -922,7 +919,7 @@
},
{
"cell_type": "code",
"execution_count": 18,
"execution_count": null,
"id": "e963ee8391584c3",
"metadata": {},
"outputs": [
Expand Down Expand Up @@ -1675,7 +1672,7 @@
],
"source": [
"# Compute CWD\n",
"cwd = maximum_consecutive_wet_days(pr_ssp585)\n",
"cwd = precipitation.maximum_consecutive_wet_days(pr_ssp585)\n",
"cwd"
]
},
Expand All @@ -1691,7 +1688,7 @@
},
{
"cell_type": "code",
"execution_count": 19,
"execution_count": null,
"id": "89b94098923a139a",
"metadata": {},
"outputs": [
Expand Down
Loading
Loading