Skip to content

Commit 2446e08

Browse files
committed
Update GUIs with new stuff
1 parent 55ed9ea commit 2446e08

File tree

8 files changed

+3347
-7
lines changed

8 files changed

+3347
-7
lines changed

docs/images/GUI_CI_boundaries2.png

724 KB
Loading

docs/run_ci.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ Data are sourced at 0.25° resolution from the [World Bank Climate Knowledge Por
5151
5252
```{figure} images/GUI_CI_selection2.png
5353
---
54-
width: 30%
54+
width: 50%
5555
align: center
5656
---
5757
```
@@ -84,7 +84,7 @@ Data are sourced at 0.25° resolution from the [World Bank Climate Knowledge Por
8484
8585
```{figure} images/GUI_CI_selection.png
8686
---
87-
width: 100%
87+
width: 50%
8888
align: center
8989
---
9090
```

docs/run_tc.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,14 @@ Sub-national boundaries for level 1 and 2 can be fetched automatically. Else, yo
4444
- Move to Hazard tab: select the hazard process, the minimum hazard intensity threshold, the time period and climate scenario. Select one or more Return Periods (CTRL+Click / drag mouse).
4545
```{figure} images/GUI_TC_hzd.png
4646
---
47-
width: 30%
47+
width: 50%
4848
align: center
4949
---
5050
```
5151
- Select one or more Exposure categories (CTRL+Click / drag mouse). You can select a custom exposure layer for each selected category (.tif raster, WGS 84).
5252
```{figure} images/GUI_TC_exp.png
5353
---
54-
width: 30%
54+
width: 50%
5555
align: center
5656
---
5757
```

tools/code/GUI.ipynb

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
"metadata": {},
77
"source": [
88
"<h1 style=\"text-align: center\"><b>RISK DATA LIBRARY - Analytical tools</b></h1>\n",
9-
"<h2 style=\"text-align: center\">A collection of python scripts to produce sub-national risk screening analysis</h2>\n",
10-
"<h3 style=\"text-align: center\">Select a hazard:</h3>\n",
9+
"<h2 style=\"text-align: center\">A collection of python scripts to produce sub-national climate risk screening analysis</h2>\n",
10+
"<h3 style=\"text-align: center\">Hazards Analytics</h3>\n",
1111
"\n",
1212
"<table>\n",
1313
" <tr>\n",
@@ -42,7 +42,7 @@
4242
" </a>\n",
4343
" </h2>\n",
4444
" <p>\n",
45-
" Based on STORM v4 hazard data, produces exposure by hazard thresholds or impact estimates on built-up based on regional damage curves (CLIMADA).\n",
45+
" Based on STORM v34 hazard data, produces exposure by hazard thresholds or impact estimates on built-up based on regional damage curves (CLIMADA).\n",
4646
" </p>\n",
4747
" </td>\n",
4848
" </tr>\n",
@@ -63,6 +63,35 @@
6363
" </tr>\n",
6464
"</table>\n",
6565
"\n",
66+
"<h3 style=\"text-align: center\">Climate Indices Analytics</h3>\n",
67+
"\n",
68+
"<table>\n",
69+
" <tr>\n",
70+
" <td>\n",
71+
" <h2 style=\"text-align: center;\">\n",
72+
" <a href=\"GUI_CI.ipynb\" style=\"text-decoration: none;\">\n",
73+
" <b>Projections Anomaly Visualization Tool</b>\n",
74+
" </a>\n",
75+
" </h2>\n",
76+
" <p>\n",
77+
" Based on ERA5 and CMIP6 data from CCKP, visualize historical mean and projected anomalies for a range of climate indices, and calculates sub-national averages.\n",
78+
" </p>\n",
79+
" </td>\n",
80+
" </tr>\n",
81+
" <tr>\n",
82+
" <td>\n",
83+
" <h2 style=\"text-align: center\">\n",
84+
" <a href=\"GUI_CI_TS.ipynb\" style=\"text-decoration: none;\">\n",
85+
" <b>Historical Timeseries Visualization Tool</b>\n",
86+
" </a>\n",
87+
" </h2>\n",
88+
" <p>\n",
89+
" Based on ERA5 historical data from CCKP, visualize historical annual mean for a range of climate indices, and calculates sub-national averages.\n",
90+
" </p>\n",
91+
" </td>\n",
92+
" </tr>\n",
93+
"</table>\n",
94+
"\n",
6695
"<p style=\"text-align: right; margin-top: 3em;\"><em>Developed by M. Amadio (mamadio@worldbank.org)</em></p>"
6796
]
6897
},

tools/code/GUI_CI.ipynb

Lines changed: 167 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,167 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "markdown",
5+
"id": "6ce9d524-db59-44c6-9122-c84a2e3594a1",
6+
"metadata": {},
7+
"source": [
8+
"# **Climate Indices - Projections Anomaly Visualization Tool**\n",
9+
"\n",
10+
"## Visualize historical mean and projected climate changes\n",
11+
"\n",
12+
"<p>Based on ERA5 historical data (1995-2014) and CMIP6 climate model projections. Visualize a variety of climate indices for countries worldwide.</p>\n",
13+
"<p>This tool provides a simple interface for comparing historical climate conditions with projected future changes under different Shared Socioeconomic Pathways (SSP) scenarios and time periods.</p>\n",
14+
"<p>Choose from a selection of climate indices to analyze temperature extremes, precipitation patterns, heat stress indicators, and drought metrics.</p>\n",
15+
"<p>Subnational boundaries are fetched from the WB server up to level 2. Custom boundaries at any level can also be used.</p>\n",
16+
"<p>Results can be exported as pictures and geodata.</p>\n",
17+
"\n",
18+
"### Run this cell to launch the interface: Cell > Run or CTRL + Enter"
19+
]
20+
},
21+
{
22+
"cell_type": "code",
23+
"execution_count": 1,
24+
"id": "86fc5cc8-22d6-4dfd-816f-739ed9738273",
25+
"metadata": {},
26+
"outputs": [
27+
{
28+
"data": {
29+
"application/vnd.jupyter.widget-view+json": {
30+
"model_id": "98ee1558b9de4f1485fb51d871d443e3",
31+
"version_major": 2,
32+
"version_minor": 0
33+
},
34+
"text/plain": [
35+
"HBox(children=(VBox(children=(VBox(children=(VBox(children=(Textarea(value='Hover over items for descriptions.…"
36+
]
37+
},
38+
"metadata": {},
39+
"output_type": "display_data"
40+
},
41+
{
42+
"data": {
43+
"text/html": [
44+
"\n",
45+
" <script>\n",
46+
" document.querySelector('.country-selector-2116403956368').onmouseover = function() {\n",
47+
" document.querySelector('.info-box textarea').value = 'Enter a country name. You can type to filter the list.';\n",
48+
" };\n",
49+
" document.querySelector('.adm-level-selector-2116403958768').onmouseover = function() {\n",
50+
" document.querySelector('.info-box textarea').value = 'Select the administrative level for analysis boundaries.\\n0 = Country\\n1 = State/Province\\n2 = District/County';\n",
51+
" };\n",
52+
" document.querySelector('.custom-boundaries-radio-2116403959440').onmouseover = function() {\n",
53+
" document.querySelector('.info-box textarea').value = 'Choose between default administrative boundaries or custom boundaries provided by the user.';\n",
54+
" };\n",
55+
" document.querySelector('.custom-boundaries-file-2116403961072').onmouseover = function() {\n",
56+
" document.querySelector('.info-box textarea').value = 'Enter the path to your custom boundaries file (Shapefile or GeoPackage).';\n",
57+
" };\n",
58+
" document.querySelector('.custom-boundaries-id-field-2116403956992').onmouseover = function() {\n",
59+
" document.querySelector('.info-box textarea').value = 'Enter the field name in your custom boundaries file that contains the unique identifier for each zone.';\n",
60+
" };\n",
61+
" document.querySelector('.custom-boundaries-name-field-2116403960256').onmouseover = function() {\n",
62+
" document.querySelector('.info-box textarea').value = 'Enter the field name in your custom boundaries file that contains the name or label for each zone.';\n",
63+
" };\n",
64+
" document.querySelector('.climate-index-selector-2116403959488').onmouseover = function() {\n",
65+
" document.querySelector('.info-box textarea').value = 'Select the climate index to analyze. Different indices measure various aspects of climate like temperature, precipitation, or heat stress.';\n",
66+
" };\n",
67+
" document.querySelector('.projection-period-selector-2116403957904').onmouseover = function() {\n",
68+
" document.querySelector('.info-box textarea').value = 'Select the Shared Socioeconomic Pathway (SSP) scenario for climate projections:\\n- SSP1-1.9/2.6: Sustainability\\n- SSP2-4.5: Middle of the road\\n- SSP3-7.0: Regional rivalry\\n- SSP5-8.5: Fossil-fueled development';\n",
69+
" };\n",
70+
" document.querySelector('.time-period-selector-2116403962272').onmouseover = function() {\n",
71+
" document.querySelector('.info-box textarea').value = 'Select the future time period for analysis. Each period represents a 20-year average.';\n",
72+
" };\n",
73+
" document.querySelector('.standardization-selector-2116403963040').onmouseover = function() {\n",
74+
" document.querySelector('.info-box textarea').value = 'Select the method to standardize anomalies:\\n- None: Raw anomaly values\\n- Epsilon: Standard percent change with epsilon correction (good general-purpose method)\\n- Log: Logarithmic ratio (good for precipitation indices)';\n",
75+
" };\n",
76+
" </script>\n",
77+
" "
78+
],
79+
"text/plain": [
80+
"<IPython.core.display.HTML object>"
81+
]
82+
},
83+
"metadata": {},
84+
"output_type": "display_data"
85+
}
86+
],
87+
"source": [
88+
"%matplotlib inline\n",
89+
"from gui_ci_utils import initialize_tool\n",
90+
"initialize_tool()"
91+
]
92+
},
93+
{
94+
"cell_type": "markdown",
95+
"id": "8f194706-429e-440a-a09d-26aaa17077be",
96+
"metadata": {},
97+
"source": [
98+
"### Reference Guide\n",
99+
"\n",
100+
"#### Climate Indices Overview\n",
101+
"\n",
102+
"| Type | Index | Description | Unit |\n",
103+
"|------|-------|-------------|------|\n",
104+
"| **Temperature** | tas, tasmax, tasmin | Mean, max and min temperature | °C |\n",
105+
"| **Heat Stress** | hd30, hd35, hi35, hi39 | Days with Tmax > 30°C, 35°C or Heat Index > 35°C, 39°C | days |\n",
106+
"| **Heat Risk** | tx84rr | Heat risk categorization and excess mortality indices | index |\n",
107+
"| **Precipitation** | rx1day, rx5day | Maximum 1-day and 5-day rainfall | mm |\n",
108+
"| **Rain Intensity** | r20mm, r50mm | Days with precipitation > 20mm or 50mm | days |\n",
109+
"| **Wet/Dry Periods** | cwd, cdd | Consecutive wet/dry days | days |\n",
110+
"| **Drought** | spei12 | Standardized Precipitation-Evapotranspiration Index | index |\n",
111+
"\n",
112+
"#### Standardization Methods\n",
113+
"\n",
114+
"- **None**: Shows raw anomaly values (future minus present)\n",
115+
"- **Epsilon**: Shows percentage change with stability for near-zero values\n",
116+
"- **Log**: Shows logarithmic change ratio (best for precipitation)\n",
117+
"\n",
118+
"#### SSP Scenarios\n",
119+
"\n",
120+
"- **SSP1-1.9/2.6**: Sustainability - low challenges to mitigation and adaptation\n",
121+
"- **SSP2-4.5**: Middle of the road - medium challenges to mitigation and adaptation\n",
122+
"- **SSP3-7.0**: Regional rivalry - high challenges to mitigation and adaptation\n",
123+
"- **SSP5-8.5**: Fossil-fueled development - high challenges to mitigation, low challenges to adaptation\n",
124+
"- \n",
125+
"#### Exporting Data\n",
126+
"\n",
127+
"Use the export options to save:\n",
128+
"- Visualizations as PNG files\n",
129+
"- Boundary-level statistics as GeoPackage files\n",
130+
"\n",
131+
"#### Data Source\n",
132+
"\n",
133+
"This tool uses ERA5 reanalysis data, which provides a consistent global dataset of climate variables from 1950 to present;\n",
134+
"and CMIP6 data, which provides projections of anomaly values for the same climate variables, up to end of the century. The ensemble median of the climatology (20 years average) is used for the calculation."
135+
]
136+
},
137+
{
138+
"cell_type": "code",
139+
"execution_count": null,
140+
"id": "cadd70b2-48d3-4fd7-9667-af4059178b82",
141+
"metadata": {},
142+
"outputs": [],
143+
"source": []
144+
}
145+
],
146+
"metadata": {
147+
"kernelspec": {
148+
"display_name": "Python 3 (ipykernel)",
149+
"language": "python",
150+
"name": "python3"
151+
},
152+
"language_info": {
153+
"codemirror_mode": {
154+
"name": "ipython",
155+
"version": 3
156+
},
157+
"file_extension": ".py",
158+
"mimetype": "text/x-python",
159+
"name": "python",
160+
"nbconvert_exporter": "python",
161+
"pygments_lexer": "ipython3",
162+
"version": "3.10.14"
163+
}
164+
},
165+
"nbformat": 4,
166+
"nbformat_minor": 5
167+
}

0 commit comments

Comments
 (0)