From 10ba9b352fb45bacc3156c832879c3165361c5f1 Mon Sep 17 00:00:00 2001 From: Joe Moorhouse <5102656+joemoorhouse@users.noreply.github.com> Date: Sun, 31 Mar 2024 21:04:57 +0100 Subject: [PATCH] Move CI to pdm (#42) * Changes to remove tox and move CI to use pdm. Signed-off-by: Joe Moorhouse <5102656+joemoorhouse@users.noreply.github.com> --------- Signed-off-by: Joe Moorhouse <5102656+joemoorhouse@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .github/workflows/ci.yml | 39 +- .gitignore | 1 + .pre-commit-config.yaml | 39 +- CONTRIBUTING.md | 21 +- inventories/hazard/inventory.json | 2770 ----------------- notebooks/launcher.ipynb | 32 +- .../onboarding/onboard_ESP_GOV_flood.ipynb | 561 ---- notebooks/onboarding/onboard_JRC_flood.ipynb | 426 --- pdm.lock | 108 +- pyproject.toml | 14 +- src/hazard/models/wet_bulb_globe_temp.md | 2 +- src/hazard/onboard/wri_aqueduct_water_risk.md | 6 +- src/hazard/utilities/zarr_utilities.py | 4 +- src/inventories/hazard/inventory.json | 28 +- tests/{utilities.py => conftest.py} | 0 tests/drought_indicators_test.py | 18 +- tests/heat_indicators_test.py | 22 +- tests/inventory_test.py | 8 +- tests/onboarding_test.py | 7 +- tests/temperature_indicators_test.py | 6 +- tests/tile_creation_test.py | 40 +- tests/utilities_test.py | 4 +- tests/water_temp_indicators_test.py | 2 +- tests/wind_onboarding_test.py | 4 +- tox.ini | 35 - 25 files changed, 187 insertions(+), 4010 deletions(-) delete mode 100644 inventories/hazard/inventory.json delete mode 100644 notebooks/onboarding/onboard_ESP_GOV_flood.ipynb delete mode 100644 notebooks/onboarding/onboard_JRC_flood.ipynb rename tests/{utilities.py => conftest.py} (100%) delete mode 100644 tox.ini diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7be77a5..bd8ad5f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,25 +6,26 @@ on: pull_request: branches: [ main ] -env: - python-version: "3.8" - jobs: ci: - runs-on: ubuntu-latest - + runs-on: ${{ matrix.os }} + strategy: + matrix: + python-version: [3.9, '3.10', '3.11'] + os: [ubuntu-latest] + # add, if needed: [macOS-latest, windows-latest] + steps: - - uses: actions/checkout@v4 - - - name: "Setup Python" - uses: actions/setup-python@v4.7.0 - with: - python-version: ${{ env.python-version }} - - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install tox - - - name: Run auto-tests - run: tox + - uses: actions/checkout@v3 + - name: Set up PDM + uses: pdm-project/setup-pdm@v3 + with: + python-version: ${{ matrix.python-version }} + + - name: Install dependencies + run: | + pdm config venv.with_pip True + pdm sync -d -G testing + - name: Run Tests and Checks + run: | + pdm run all \ No newline at end of file diff --git a/.gitignore b/.gitignore index c757ee1..692f450 100644 --- a/.gitignore +++ b/.gitignore @@ -59,3 +59,4 @@ src/inventories/hazard/inventory_live.json .vscode/launch.json .vscode/settings.json .pdm-python +.python-version diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index ad73084..d1617ce 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,7 +1,42 @@ --- repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.1.0 + rev: v4.5.0 hooks: + - id: trailing-whitespace - id: check-merge-conflict - + - id: end-of-file-fixer + - id: name-tests-test + - id: check-byte-order-marker + - id: check-case-conflict + - id: check-docstring-first + - id: check-json + - id: check-toml + - id: check-yaml + - id: check-symlinks + - id: detect-private-key + - id: check-ast + - id: debug-statements + + - repo: https://github.com/Lucas-C/pre-commit-hooks + rev: v1.5.5 + hooks: + - id: remove-tabs + + - repo: https://github.com/psf/black + rev: '24.2.0' + hooks: + - id: black + - id: black-jupyter + + - repo: https://github.com/s-weigand/flake8-nb + rev: v0.5.3 + hooks: + - id: flake8-nb + additional_dependencies: + - pep8-naming + # Ignore all format-related checks as Black takes care of those. + args: + - --ignore=E2, W5, F401, E401, E704 + - --select=E, W, F, N + - --max-line-length=120 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 6c9838e..0208f2a 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -13,7 +13,7 @@ consistent working environment. Install via, e.g.: pip install pdm ``` -For use with Jupyter, the configuration is convenient: +For use with Jupyter and mypy, the configuration is needed: ``` pdm config venv.with_pip True ``` @@ -32,7 +32,7 @@ testing or development, `pdm add -dG `. ### JupyterHub and requirements.txt It may be useful to generate a requirements.txt file: ``` -pipenv requirements > requirements.txt +pdm export -o requirements.txt --without-hashes ``` ## Development @@ -42,6 +42,11 @@ https://github.com/os-climate/hazard. All changes must pass the automated test suite, along with various static checks. +The easiest way to run these is via: +``` +pdm run all +``` + [Black](https://black.readthedocs.io/) code style and [isort](https://pycqa.github.io/isort/) import ordering are enforced and enabling automatic formatting via [pre-commit](https://pre-commit.com/) @@ -60,18 +65,6 @@ isort . black . ``` -Code can then be tested using tox. -``` -# run static checks and unit tests -tox -# run only tests -tox -e py3 -# run only static checks -tox -e static -# run unit tests and produce an HTML code coverage report (/htmlcov) -tox -e cov -``` - ## IDE set-up For those using VS Code, configure tests ('Python: Configure Tests') to use 'pytest' to allow running of tests within the IDE. diff --git a/inventories/hazard/inventory.json b/inventories/hazard/inventory.json deleted file mode 100644 index cac2105..0000000 --- a/inventories/hazard/inventory.json +++ /dev/null @@ -1,2770 +0,0 @@ -{ - "resources": [ - { - "hazard_type": "RiverineInundation", - "group_id": "public", - "path": "inundation/wri/v2/inunriver_{scenario}_000000000WATCH_{year}", - "indicator_id": "flood_depth", - "indicator_model_id": null, - "indicator_model_gcm": "historical", - "params": {}, - "display_name": "Flood depth/baseline (WRI)", - "display_groups": [], - "description": "\nWorld Resources Institute Aqueduct Floods baseline riverine model using historical data.\n\n \nThe World Resources Institute (WRI) [Aqueduct Floods model](https://www.wri.org/aqueduct) is an acute riverine and coastal flood hazard model with a spatial resolution of 30 \u00d7 30 arc seconds (approx. 1 km at the equator). Flood intensity is provided as a _return period_ map: each point comprises a curve of inundation depths for 9 different return periods (also known as reoccurrence periods). If a flood event has depth $d_i$ with return period of $r_i$ this implies that the probability of a flood event with depth greater than $d_i$ occurring in any one year is $1 / r_i$; this is the _exceedance probability_. Aqueduct Floods is based on Global Flood Risk with IMAGE Scenarios (GLOFRIS); see [here](https://www.wri.org/aqueduct/publications) for more details.\n\nFor more details and relevant citations see the\n[OS-Climate Physical Climate Risk Methodology document](https://github.com/os-climate/physrisk/blob/main/methodology/PhysicalRiskMethodology.pdf).\n", - "map": { - "colormap": { - "min_index": 1, - "min_value": 0.0, - "max_index": 255, - "max_value": 2.0, - "name": "flare", - "nodata_index": 0, - "units": "m" - }, - "path": "inundation/wri/v2/inunriver_{scenario}_000000000WATCH_{year}_map", - "bounds": [ - [ - -180.0, - 85.0 - ], - [ - 180.0, - 85.0 - ], - [ - 180.0, - -85.0 - ], - [ - -180.0, - -85.0 - ] - ], - "index_values": null, - "source": "map_array_pyramid" - }, - "scenarios": [ - { - "id": "historical", - "years": [ - 1980 - ] - } - ], - "units": "metres" - }, - { - "hazard_type": "RiverineInundation", - "group_id": "public", - "path": "inundation/wri/v2/inunriver_{scenario}_00000NorESM1-M_{year}", - "indicator_id": "flood_depth", - "indicator_model_id": null, - "indicator_model_gcm": "NorESM1-M", - "params": {}, - "display_name": "Flood depth/NorESM1-M (WRI)", - "display_groups": [], - "description": "\nWorld Resources Institute Aqueduct Floods riverine model using GCM model from\nBjerknes Centre for Climate Research, Norwegian Meteorological Institute.\n\n \nThe World Resources Institute (WRI) [Aqueduct Floods model](https://www.wri.org/aqueduct) is an acute riverine and coastal flood hazard model with a spatial resolution of 30 \u00d7 30 arc seconds (approx. 1 km at the equator). Flood intensity is provided as a _return period_ map: each point comprises a curve of inundation depths for 9 different return periods (also known as reoccurrence periods). If a flood event has depth $d_i$ with return period of $r_i$ this implies that the probability of a flood event with depth greater than $d_i$ occurring in any one year is $1 / r_i$; this is the _exceedance probability_. Aqueduct Floods is based on Global Flood Risk with IMAGE Scenarios (GLOFRIS); see [here](https://www.wri.org/aqueduct/publications) for more details.\n\nFor more details and relevant citations see the\n[OS-Climate Physical Climate Risk Methodology document](https://github.com/os-climate/physrisk/blob/main/methodology/PhysicalRiskMethodology.pdf).\n", - "map": { - "colormap": { - "min_index": 1, - "min_value": 0.0, - "max_index": 255, - "max_value": 2.0, - "name": "flare", - "nodata_index": 0, - "units": "m" - }, - "path": "inundation/wri/v2/inunriver_{scenario}_00000NorESM1-M_{year}_map", - "bounds": [ - [ - -180.0, - 85.0 - ], - [ - 180.0, - 85.0 - ], - [ - 180.0, - -85.0 - ], - [ - -180.0, - -85.0 - ] - ], - "index_values": [ - 8 - ], - "source": "map_array_pyramid" - }, - "scenarios": [ - { - "id": "rcp4p5", - "years": [ - 2030, - 2050, - 2080 - ] - }, - { - "id": "rcp8p5", - "years": [ - 2030, - 2050, - 2080 - ] - } - ], - "units": "metres" - }, - { - "hazard_type": "RiverineInundation", - "group_id": "public", - "path": "inundation/wri/v2/inunriver_{scenario}_0000GFDL-ESM2M_{year}", - "indicator_id": "flood_depth", - "indicator_model_id": null, - "indicator_model_gcm": "GFDL-ESM2M", - "params": {}, - "display_name": "Flood depth/GFDL-ESM2M (WRI)", - "display_groups": [], - "description": "\nWorld Resource Institute Aqueduct Floods riverine model using GCM model from\nGeophysical Fluid Dynamics Laboratory (NOAA).\n\n \nThe World Resources Institute (WRI) [Aqueduct Floods model](https://www.wri.org/aqueduct) is an acute riverine and coastal flood hazard model with a spatial resolution of 30 \u00d7 30 arc seconds (approx. 1 km at the equator). Flood intensity is provided as a _return period_ map: each point comprises a curve of inundation depths for 9 different return periods (also known as reoccurrence periods). If a flood event has depth $d_i$ with return period of $r_i$ this implies that the probability of a flood event with depth greater than $d_i$ occurring in any one year is $1 / r_i$; this is the _exceedance probability_. Aqueduct Floods is based on Global Flood Risk with IMAGE Scenarios (GLOFRIS); see [here](https://www.wri.org/aqueduct/publications) for more details.\n\nFor more details and relevant citations see the\n[OS-Climate Physical Climate Risk Methodology document](https://github.com/os-climate/physrisk/blob/main/methodology/PhysicalRiskMethodology.pdf).\n", - "map": { - "colormap": { - "min_index": 1, - "min_value": 0.0, - "max_index": 255, - "max_value": 2.0, - "name": "flare", - "nodata_index": 0, - "units": "m" - }, - "path": "inundation/wri/v2/inunriver_{scenario}_0000GFDL-ESM2M_{year}_map", - "bounds": [ - [ - -180.0, - 85.0 - ], - [ - 180.0, - 85.0 - ], - [ - 180.0, - -85.0 - ], - [ - -180.0, - -85.0 - ] - ], - "index_values": [ - 8 - ], - "source": "map_array_pyramid" - }, - "scenarios": [ - { - "id": "rcp4p5", - "years": [ - 2030, - 2050, - 2080 - ] - }, - { - "id": "rcp8p5", - "years": [ - 2030, - 2050, - 2080 - ] - } - ], - "units": "metres" - }, - { - "hazard_type": "RiverineInundation", - "group_id": "public", - "path": "inundation/wri/v2/inunriver_{scenario}_0000HadGEM2-ES_{year}", - "indicator_id": "flood_depth", - "indicator_model_id": null, - "indicator_model_gcm": "HadGEM2-ES", - "params": {}, - "display_name": "Flood depth/HadGEM2-ES (WRI)", - "display_groups": [], - "description": "\nWorld Resource Institute Aqueduct Floods riverine model using GCM model:\nMet Office Hadley Centre.\n\n \nThe World Resources Institute (WRI) [Aqueduct Floods model](https://www.wri.org/aqueduct) is an acute riverine and coastal flood hazard model with a spatial resolution of 30 \u00d7 30 arc seconds (approx. 1 km at the equator). Flood intensity is provided as a _return period_ map: each point comprises a curve of inundation depths for 9 different return periods (also known as reoccurrence periods). If a flood event has depth $d_i$ with return period of $r_i$ this implies that the probability of a flood event with depth greater than $d_i$ occurring in any one year is $1 / r_i$; this is the _exceedance probability_. Aqueduct Floods is based on Global Flood Risk with IMAGE Scenarios (GLOFRIS); see [here](https://www.wri.org/aqueduct/publications) for more details.\n\nFor more details and relevant citations see the\n[OS-Climate Physical Climate Risk Methodology document](https://github.com/os-climate/physrisk/blob/main/methodology/PhysicalRiskMethodology.pdf).\n", - "map": { - "colormap": { - "min_index": 1, - "min_value": 0.0, - "max_index": 255, - "max_value": 2.0, - "name": "flare", - "nodata_index": 0, - "units": "m" - }, - "path": "inundation/wri/v2/inunriver_{scenario}_0000HadGEM2-ES_{year}_map", - "bounds": [ - [ - -180.0, - 85.0 - ], - [ - 180.0, - 85.0 - ], - [ - 180.0, - -85.0 - ], - [ - -180.0, - -85.0 - ] - ], - "index_values": [ - 8 - ], - "source": "map_array_pyramid" - }, - "scenarios": [ - { - "id": "rcp4p5", - "years": [ - 2030, - 2050, - 2080 - ] - }, - { - "id": "rcp8p5", - "years": [ - 2030, - 2050, - 2080 - ] - } - ], - "units": "metres" - }, - { - "hazard_type": "RiverineInundation", - "group_id": "public", - "path": "inundation/wri/v2/inunriver_{scenario}_00IPSL-CM5A-LR_{year}", - "indicator_id": "flood_depth", - "indicator_model_id": null, - "indicator_model_gcm": "IPSL-CM5A-LR", - "params": {}, - "display_name": "Flood depth/IPSL-CM5A-LR (WRI)", - "display_groups": [], - "description": "\nWorld Resource Institute Aqueduct Floods riverine model using GCM model from\nInstitut Pierre Simon Laplace\n\n \nThe World Resources Institute (WRI) [Aqueduct Floods model](https://www.wri.org/aqueduct) is an acute riverine and coastal flood hazard model with a spatial resolution of 30 \u00d7 30 arc seconds (approx. 1 km at the equator). Flood intensity is provided as a _return period_ map: each point comprises a curve of inundation depths for 9 different return periods (also known as reoccurrence periods). If a flood event has depth $d_i$ with return period of $r_i$ this implies that the probability of a flood event with depth greater than $d_i$ occurring in any one year is $1 / r_i$; this is the _exceedance probability_. Aqueduct Floods is based on Global Flood Risk with IMAGE Scenarios (GLOFRIS); see [here](https://www.wri.org/aqueduct/publications) for more details.\n\nFor more details and relevant citations see the\n[OS-Climate Physical Climate Risk Methodology document](https://github.com/os-climate/physrisk/blob/main/methodology/PhysicalRiskMethodology.pdf).\n", - "map": { - "colormap": { - "min_index": 1, - "min_value": 0.0, - "max_index": 255, - "max_value": 2.0, - "name": "flare", - "nodata_index": 0, - "units": "m" - }, - "path": "inundation/wri/v2/inunriver_{scenario}_00IPSL-CM5A-LR_{year}_map", - "bounds": [ - [ - -180.0, - 85.0 - ], - [ - 180.0, - 85.0 - ], - [ - 180.0, - -85.0 - ], - [ - -180.0, - -85.0 - ] - ], - "index_values": [ - 8 - ], - "source": "map_array_pyramid" - }, - "scenarios": [ - { - "id": "rcp4p5", - "years": [ - 2030, - 2050, - 2080 - ] - }, - { - "id": "rcp8p5", - "years": [ - 2030, - 2050, - 2080 - ] - } - ], - "units": "metres" - }, - { - "hazard_type": "RiverineInundation", - "group_id": "public", - "path": "inundation/wri/v2/inunriver_{scenario}_MIROC-ESM-CHEM_{year}", - "indicator_id": "flood_depth", - "indicator_model_id": null, - "indicator_model_gcm": "MIROC-ESM-CHEM", - "params": {}, - "display_name": "Flood depth/MIROC-ESM-CHEM (WRI)", - "display_groups": [], - "description": "World Resource Institute Aqueduct Floods riverine model using\n GCM model from Atmosphere and Ocean Research Institute\n (The University of Tokyo), National Institute for Environmental Studies, and Japan Agency\n for Marine-Earth Science and Technology.\n\n \nThe World Resources Institute (WRI) [Aqueduct Floods model](https://www.wri.org/aqueduct) is an acute riverine and coastal flood hazard model with a spatial resolution of 30 \u00d7 30 arc seconds (approx. 1 km at the equator). Flood intensity is provided as a _return period_ map: each point comprises a curve of inundation depths for 9 different return periods (also known as reoccurrence periods). If a flood event has depth $d_i$ with return period of $r_i$ this implies that the probability of a flood event with depth greater than $d_i$ occurring in any one year is $1 / r_i$; this is the _exceedance probability_. Aqueduct Floods is based on Global Flood Risk with IMAGE Scenarios (GLOFRIS); see [here](https://www.wri.org/aqueduct/publications) for more details.\n\nFor more details and relevant citations see the\n[OS-Climate Physical Climate Risk Methodology document](https://github.com/os-climate/physrisk/blob/main/methodology/PhysicalRiskMethodology.pdf).\n", - "map": { - "colormap": { - "min_index": 1, - "min_value": 0.0, - "max_index": 255, - "max_value": 2.0, - "name": "flare", - "nodata_index": 0, - "units": "m" - }, - "path": "inundation/wri/v2/inunriver_{scenario}_MIROC-ESM-CHEM_{year}_map", - "bounds": [ - [ - -180.0, - 85.0 - ], - [ - 180.0, - 85.0 - ], - [ - 180.0, - -85.0 - ], - [ - -180.0, - -85.0 - ] - ], - "index_values": [ - 8 - ], - "source": "map_array_pyramid" - }, - "scenarios": [ - { - "id": "rcp4p5", - "years": [ - 2030, - 2050, - 2080 - ] - }, - { - "id": "rcp8p5", - "years": [ - 2030, - 2050, - 2080 - ] - } - ], - "units": "metres" - }, - { - "hazard_type": "CoastalInundation", - "group_id": "public", - "path": "inundation/wri/v2/inuncoast_historical_nosub_hist_0", - "indicator_id": "flood_depth", - "indicator_model_id": "nosub", - "indicator_model_gcm": "unknown", - "params": {}, - "display_name": "Flood depth/baseline, no subsidence (WRI)", - "display_groups": [], - "description": "\nWorld Resources Institute Aqueduct Floods baseline coastal model using historical data. Model excludes subsidence.\n\n \nThe World Resources Institute (WRI) [Aqueduct Floods model](https://www.wri.org/aqueduct) is an acute riverine and coastal flood hazard model with a spatial resolution of 30 \u00d7 30 arc seconds (approx. 1 km at the equator). Flood intensity is provided as a _return period_ map: each point comprises a curve of inundation depths for 9 different return periods (also known as reoccurrence periods). If a flood event has depth $d_i$ with return period of $r_i$ this implies that the probability of a flood event with depth greater than $d_i$ occurring in any one year is $1 / r_i$; this is the _exceedance probability_. Aqueduct Floods is based on Global Flood Risk with IMAGE Scenarios (GLOFRIS); see [here](https://www.wri.org/aqueduct/publications) for more details.\n\nFor more details and relevant citations see the\n[OS-Climate Physical Climate Risk Methodology document](https://github.com/os-climate/physrisk/blob/main/methodology/PhysicalRiskMethodology.pdf).\n", - "map": { - "colormap": { - "min_index": 1, - "min_value": 0.0, - "max_index": 255, - "max_value": 2.0, - "name": "flare", - "nodata_index": 0, - "units": "m" - }, - "path": "inundation/wri/v2/inuncoast_historical_nosub_hist_0_map", - "bounds": [ - [ - -180.0, - 85.0 - ], - [ - 180.0, - 85.0 - ], - [ - 180.0, - -85.0 - ], - [ - -180.0, - -85.0 - ] - ], - "index_values": [ - 8 - ], - "source": "map_array_pyramid" - }, - "scenarios": [ - { - "id": "historical", - "years": [ - 1980 - ] - } - ], - "units": "metres" - }, - { - "hazard_type": "CoastalInundation", - "group_id": "public", - "path": "inundation/wri/v2/inuncoast_{scenario}_nosub_{year}_0", - "indicator_id": "flood_depth", - "indicator_model_id": "nosub/95", - "indicator_model_gcm": "unknown", - "params": {}, - "display_name": "Flood depth/95%, no subsidence (WRI)", - "display_groups": [], - "description": "\nWorld Resource Institute Aqueduct Floods coastal model, excluding subsidence; 95th percentile sea level rise.\n\n \nThe World Resources Institute (WRI) [Aqueduct Floods model](https://www.wri.org/aqueduct) is an acute riverine and coastal flood hazard model with a spatial resolution of 30 \u00d7 30 arc seconds (approx. 1 km at the equator). Flood intensity is provided as a _return period_ map: each point comprises a curve of inundation depths for 9 different return periods (also known as reoccurrence periods). If a flood event has depth $d_i$ with return period of $r_i$ this implies that the probability of a flood event with depth greater than $d_i$ occurring in any one year is $1 / r_i$; this is the _exceedance probability_. Aqueduct Floods is based on Global Flood Risk with IMAGE Scenarios (GLOFRIS); see [here](https://www.wri.org/aqueduct/publications) for more details.\n\nFor more details and relevant citations see the\n[OS-Climate Physical Climate Risk Methodology document](https://github.com/os-climate/physrisk/blob/main/methodology/PhysicalRiskMethodology.pdf).\n", - "map": { - "colormap": { - "min_index": 1, - "min_value": 0.0, - "max_index": 255, - "max_value": 2.0, - "name": "flare", - "nodata_index": 0, - "units": "m" - }, - "path": "inundation/wri/v2/inuncoast_{scenario}_nosub_{year}_0_map", - "bounds": [ - [ - -180.0, - 85.0 - ], - [ - 180.0, - 85.0 - ], - [ - 180.0, - -85.0 - ], - [ - -180.0, - -85.0 - ] - ], - "index_values": [ - 8 - ], - "source": "map_array_pyramid" - }, - "scenarios": [ - { - "id": "rcp4p5", - "years": [ - 2030, - 2050, - 2080 - ] - }, - { - "id": "rcp8p5", - "years": [ - 2030, - 2050, - 2080 - ] - } - ], - "units": "metres" - }, - { - "hazard_type": "CoastalInundation", - "group_id": "public", - "path": "inundation/wri/v2/inuncoast_{scenario}_nosub_{year}_0_perc_05", - "indicator_id": "flood_depth/nosub/5", - "indicator_model_id": "nosub/5", - "indicator_model_gcm": "unknown", - "params": {}, - "display_name": "Flood depth/5%, no subsidence (WRI)", - "display_groups": [], - "description": "\nWorld Resource Institute Aqueduct Floods coastal model, excluding subsidence; 5th percentile sea level rise.\n\n \nThe World Resources Institute (WRI) [Aqueduct Floods model](https://www.wri.org/aqueduct) is an acute riverine and coastal flood hazard model with a spatial resolution of 30 \u00d7 30 arc seconds (approx. 1 km at the equator). Flood intensity is provided as a _return period_ map: each point comprises a curve of inundation depths for 9 different return periods (also known as reoccurrence periods). If a flood event has depth $d_i$ with return period of $r_i$ this implies that the probability of a flood event with depth greater than $d_i$ occurring in any one year is $1 / r_i$; this is the _exceedance probability_. Aqueduct Floods is based on Global Flood Risk with IMAGE Scenarios (GLOFRIS); see [here](https://www.wri.org/aqueduct/publications) for more details.\n\nFor more details and relevant citations see the\n[OS-Climate Physical Climate Risk Methodology document](https://github.com/os-climate/physrisk/blob/main/methodology/PhysicalRiskMethodology.pdf).\n", - "map": { - "colormap": { - "min_index": 1, - "min_value": 0.0, - "max_index": 255, - "max_value": 2.0, - "name": "flare", - "nodata_index": 0, - "units": "m" - }, - "path": "inundation/wri/v2/inuncoast_{scenario}_nosub_{year}_0_perc_05_map", - "bounds": [ - [ - -180.0, - 85.0 - ], - [ - 180.0, - 85.0 - ], - [ - 180.0, - -85.0 - ], - [ - -180.0, - -85.0 - ] - ], - "index_values": [ - 8 - ], - "source": "map_array_pyramid" - }, - "scenarios": [ - { - "id": "rcp4p5", - "years": [ - 2030, - 2050, - 2080 - ] - }, - { - "id": "rcp8p5", - "years": [ - 2030, - 2050, - 2080 - ] - } - ], - "units": "metres" - }, - { - "hazard_type": "CoastalInundation", - "group_id": "public", - "path": "inundation/wri/v2/inuncoast_{scenario}_nosub_{year}_0_perc_50", - "indicator_id": "flood_depth", - "indicator_model_id": "nosub/50", - "indicator_model_gcm": "unknown", - "params": {}, - "display_name": "Flood depth/50%, no subsidence (WRI)", - "display_groups": [], - "description": "\nWorld Resource Institute Aqueduct Floods model, excluding subsidence; 50th percentile sea level rise.\n\n \nThe World Resources Institute (WRI) [Aqueduct Floods model](https://www.wri.org/aqueduct) is an acute riverine and coastal flood hazard model with a spatial resolution of 30 \u00d7 30 arc seconds (approx. 1 km at the equator). Flood intensity is provided as a _return period_ map: each point comprises a curve of inundation depths for 9 different return periods (also known as reoccurrence periods). If a flood event has depth $d_i$ with return period of $r_i$ this implies that the probability of a flood event with depth greater than $d_i$ occurring in any one year is $1 / r_i$; this is the _exceedance probability_. Aqueduct Floods is based on Global Flood Risk with IMAGE Scenarios (GLOFRIS); see [here](https://www.wri.org/aqueduct/publications) for more details.\n\nFor more details and relevant citations see the\n[OS-Climate Physical Climate Risk Methodology document](https://github.com/os-climate/physrisk/blob/main/methodology/PhysicalRiskMethodology.pdf).\n", - "map": { - "colormap": { - "min_index": 1, - "min_value": 0.0, - "max_index": 255, - "max_value": 2.0, - "name": "flare", - "nodata_index": 0, - "units": "m" - }, - "path": "inundation/wri/v2/inuncoast_{scenario}_nosub_{year}_0_perc_50_map", - "bounds": [ - [ - -180.0, - 85.0 - ], - [ - 180.0, - 85.0 - ], - [ - 180.0, - -85.0 - ], - [ - -180.0, - -85.0 - ] - ], - "index_values": [ - 8 - ], - "source": "map_array_pyramid" - }, - "scenarios": [ - { - "id": "rcp4p5", - "years": [ - 2030, - 2050, - 2080 - ] - }, - { - "id": "rcp8p5", - "years": [ - 2030, - 2050, - 2080 - ] - } - ], - "units": "metres" - }, - { - "hazard_type": "CoastalInundation", - "group_id": "public", - "path": "inundation/wri/v2/inuncoast_historical_wtsub_hist_0", - "indicator_id": "flood_depth", - "indicator_model_id": "wtsub", - "indicator_model_gcm": "unknown", - "params": {}, - "display_name": "Flood depth/baseline, with subsidence (WRI)", - "display_groups": [], - "description": "\nWorld Resource Institute Aqueduct Floods model, excluding subsidence; baseline (based on historical data).\n\n \nThe World Resources Institute (WRI) [Aqueduct Floods model](https://www.wri.org/aqueduct) is an acute riverine and coastal flood hazard model with a spatial resolution of 30 \u00d7 30 arc seconds (approx. 1 km at the equator). Flood intensity is provided as a _return period_ map: each point comprises a curve of inundation depths for 9 different return periods (also known as reoccurrence periods). If a flood event has depth $d_i$ with return period of $r_i$ this implies that the probability of a flood event with depth greater than $d_i$ occurring in any one year is $1 / r_i$; this is the _exceedance probability_. Aqueduct Floods is based on Global Flood Risk with IMAGE Scenarios (GLOFRIS); see [here](https://www.wri.org/aqueduct/publications) for more details.\n\nFor more details and relevant citations see the\n[OS-Climate Physical Climate Risk Methodology document](https://github.com/os-climate/physrisk/blob/main/methodology/PhysicalRiskMethodology.pdf).\n", - "map": { - "colormap": { - "min_index": 1, - "min_value": 0.0, - "max_index": 255, - "max_value": 2.0, - "name": "flare", - "nodata_index": 0, - "units": "m" - }, - "path": "inundation/wri/v2/inuncoast_historical_wtsub_hist_0_map", - "bounds": [ - [ - -180.0, - 85.0 - ], - [ - 180.0, - 85.0 - ], - [ - 180.0, - -85.0 - ], - [ - -180.0, - -85.0 - ] - ], - "index_values": [ - 8 - ], - "source": "map_array_pyramid" - }, - "scenarios": [ - { - "id": "historical", - "years": [ - 1980 - ] - } - ], - "units": "metres" - }, - { - "hazard_type": "CoastalInundation", - "group_id": "public", - "path": "inundation/wri/v2/inuncoast_{scenario}_wtsub_{year}_0", - "indicator_id": "flood_depth", - "indicator_model_id": "wtsub/95", - "indicator_model_gcm": "unknown", - "params": {}, - "display_name": "Flood depth/95%, with subsidence (WRI)", - "display_groups": [], - "description": "\nWorld Resource Institute Aqueduct Floods model, including subsidence; 95th percentile sea level rise.\n\n \nThe World Resources Institute (WRI) [Aqueduct Floods model](https://www.wri.org/aqueduct) is an acute riverine and coastal flood hazard model with a spatial resolution of 30 \u00d7 30 arc seconds (approx. 1 km at the equator). Flood intensity is provided as a _return period_ map: each point comprises a curve of inundation depths for 9 different return periods (also known as reoccurrence periods). If a flood event has depth $d_i$ with return period of $r_i$ this implies that the probability of a flood event with depth greater than $d_i$ occurring in any one year is $1 / r_i$; this is the _exceedance probability_. Aqueduct Floods is based on Global Flood Risk with IMAGE Scenarios (GLOFRIS); see [here](https://www.wri.org/aqueduct/publications) for more details.\n\nFor more details and relevant citations see the\n[OS-Climate Physical Climate Risk Methodology document](https://github.com/os-climate/physrisk/blob/main/methodology/PhysicalRiskMethodology.pdf).\n", - "map": { - "colormap": { - "min_index": 1, - "min_value": 0.0, - "max_index": 255, - "max_value": 2.0, - "name": "flare", - "nodata_index": 0, - "units": "m" - }, - "path": "inundation/wri/v2/inuncoast_{scenario}_wtsub_{year}_0_map", - "bounds": [ - [ - -180.0, - 85.0 - ], - [ - 180.0, - 85.0 - ], - [ - 180.0, - -85.0 - ], - [ - -180.0, - -85.0 - ] - ], - "index_values": [ - 8 - ], - "source": "map_array_pyramid" - }, - "scenarios": [ - { - "id": "rcp4p5", - "years": [ - 2030, - 2050, - 2080 - ] - }, - { - "id": "rcp8p5", - "years": [ - 2030, - 2050, - 2080 - ] - } - ], - "units": "metres" - }, - { - "hazard_type": "CoastalInundation", - "group_id": "public", - "path": "inundation/wri/v2/inuncoast_{scenario}_wtsub_{year}_0_perc_05", - "indicator_id": "flood_depth", - "indicator_model_id": "wtsub/5", - "indicator_model_gcm": "unknown", - "params": {}, - "display_name": "Flood depth/5%, with subsidence (WRI)", - "display_groups": [], - "description": "\nWorld Resource Institute Aqueduct Floods model, including subsidence; 5th percentile sea level rise.\n\n \nThe World Resources Institute (WRI) [Aqueduct Floods model](https://www.wri.org/aqueduct) is an acute riverine and coastal flood hazard model with a spatial resolution of 30 \u00d7 30 arc seconds (approx. 1 km at the equator). Flood intensity is provided as a _return period_ map: each point comprises a curve of inundation depths for 9 different return periods (also known as reoccurrence periods). If a flood event has depth $d_i$ with return period of $r_i$ this implies that the probability of a flood event with depth greater than $d_i$ occurring in any one year is $1 / r_i$; this is the _exceedance probability_. Aqueduct Floods is based on Global Flood Risk with IMAGE Scenarios (GLOFRIS); see [here](https://www.wri.org/aqueduct/publications) for more details.\n\nFor more details and relevant citations see the\n[OS-Climate Physical Climate Risk Methodology document](https://github.com/os-climate/physrisk/blob/main/methodology/PhysicalRiskMethodology.pdf).\n", - "map": { - "colormap": { - "min_index": 1, - "min_value": 0.0, - "max_index": 255, - "max_value": 2.0, - "name": "flare", - "nodata_index": 0, - "units": "m" - }, - "path": "inundation/wri/v2/inuncoast_{scenario}_wtsub_{year}_0_perc_05_map", - "bounds": [ - [ - -180.0, - 85.0 - ], - [ - 180.0, - 85.0 - ], - [ - 180.0, - -85.0 - ], - [ - -180.0, - -85.0 - ] - ], - "index_values": [ - 8 - ], - "source": "map_array_pyramid" - }, - "scenarios": [ - { - "id": "rcp4p5", - "years": [ - 2030, - 2050, - 2080 - ] - }, - { - "id": "rcp8p5", - "years": [ - 2030, - 2050, - 2080 - ] - } - ], - "units": "metres" - }, - { - "hazard_type": "CoastalInundation", - "group_id": "public", - "path": "inundation/wri/v2/inuncoast_{scenario}_wtsub_{year}_0_perc_50", - "indicator_id": "flood_depth", - "indicator_model_id": "wtsub/50", - "indicator_model_gcm": "unknown", - "params": {}, - "display_name": "Flood depth/50%, with subsidence (WRI)", - "display_groups": [], - "description": "\nWorld Resource Institute Aqueduct Floods model, including subsidence; 50th percentile sea level rise.\n\n \nThe World Resources Institute (WRI) [Aqueduct Floods model](https://www.wri.org/aqueduct) is an acute riverine and coastal flood hazard model with a spatial resolution of 30 \u00d7 30 arc seconds (approx. 1 km at the equator). Flood intensity is provided as a _return period_ map: each point comprises a curve of inundation depths for 9 different return periods (also known as reoccurrence periods). If a flood event has depth $d_i$ with return period of $r_i$ this implies that the probability of a flood event with depth greater than $d_i$ occurring in any one year is $1 / r_i$; this is the _exceedance probability_. Aqueduct Floods is based on Global Flood Risk with IMAGE Scenarios (GLOFRIS); see [here](https://www.wri.org/aqueduct/publications) for more details.\n\nFor more details and relevant citations see the\n[OS-Climate Physical Climate Risk Methodology document](https://github.com/os-climate/physrisk/blob/main/methodology/PhysicalRiskMethodology.pdf).\n", - "map": { - "colormap": { - "min_index": 1, - "min_value": 0.0, - "max_index": 255, - "max_value": 2.0, - "name": "flare", - "nodata_index": 0, - "units": "m" - }, - "path": "inundation/wri/v2/inuncoast_{scenario}_wtsub_{year}_0_perc_50_map", - "bounds": [ - [ - -180.0, - 85.0 - ], - [ - 180.0, - 85.0 - ], - [ - 180.0, - -85.0 - ], - [ - -180.0, - -85.0 - ] - ], - "index_values": [ - 8 - ], - "source": "map_array_pyramid" - }, - "scenarios": [ - { - "id": "rcp4p5", - "years": [ - 2030, - 2050, - 2080 - ] - }, - { - "id": "rcp8p5", - "years": [ - 2030, - 2050, - 2080 - ] - } - ], - "units": "metres" - }, - { - "hazard_type": "ChronicHeat", - "group_id": "", - "path": "chronic_heat/osc/v2/mean_degree_days_v2_above_32c_{gcm}_{scenario}_{year}", - "indicator_id": "mean_degree_days/above/32c", - "indicator_model_id": null, - "indicator_model_gcm": "{gcm}", - "params": { - "gcm": [ - "ACCESS-CM2", - "CMCC-ESM2", - "CNRM-CM6-1", - "MIROC6", - "MPI-ESM1-2-LR", - "NorESM2-MM" - ] - }, - "display_name": "Mean degree days above 32\u00b0C/{gcm}", - "display_groups": [ - "Mean degree days" - ], - "description": "Degree days indicators are calculated by integrating over time the absolute difference in temperature\nof the medium over a reference temperature. The exact method of calculation may vary;\nhere the daily maximum near-surface temperature 'tasmax' is used to calculate an annual indicator:\n\n$$\nI^\\text{dd} = \\frac{365}{n_y} \\sum_{i = 1}^{n_y} | T^\\text{max}_i - T^\\text{ref} | \\nonumber\n$$\n\n$I^\\text{dd}$ is the indicator, $T^\\text{max}$ is the daily maximum near-surface temperature, $n_y$ is the number of days in the year and $i$ is the day index.\nand $T^\\text{ref}$ is the reference temperature of 32\u00b0C. The OS-Climate-generated indicators are inferred\nfrom downscaled CMIP6 data, averaged over 6 models: ACCESS-CM2, CMCC-ESM2, CNRM-CM6-1, MPI-ESM1-2-LR, MIROC6 and NorESM2-MM.\nThe downscaled data is sourced from the [NASA Earth Exchange Global Daily Downscaled Projections](https://www.nccs.nasa.gov/services/data-collections/land-based-products/nex-gddp-cmip6).\nThe indicators are generated for periods: 'historical' (averaged over 1995-2014), 2030 (2021-2040), 2040 (2031-2050)\nand 2050 (2041-2060).\n", - "map": { - "colormap": { - "min_index": 1, - "min_value": 0.0, - "max_index": 255, - "max_value": 4000.0, - "name": "heating", - "nodata_index": 0, - "units": "degree days" - }, - "path": "mean_degree_days_v2_above_32c_{gcm}_{scenario}_{year}_map", - "bounds": [ - [ - -180.0, - 85.0 - ], - [ - 180.0, - 85.0 - ], - [ - 180.0, - -60.0 - ], - [ - -180.0, - -60.0 - ] - ], - "index_values": null, - "source": "map_array" - }, - "scenarios": [ - { - "id": "historical", - "years": [ - 2005 - ] - }, - { - "id": "ssp126", - "years": [ - 2030, - 2040, - 2050 - ] - }, - { - "id": "ssp245", - "years": [ - 2030, - 2040, - 2050 - ] - }, - { - "id": "ssp585", - "years": [ - 2030, - 2040, - 2050 - ] - } - ], - "units": "degree days" - }, - { - "hazard_type": "Fire", - "group_id": "jupiter_osc", - "path": "fire/jupiter/v1/fire_probability_{scenario}_{year}", - "indicator_id": "fire_probability", - "indicator_model_id": null, - "indicator_model_gcm": "unknown", - "params": {}, - "display_name": "Fire probability (Jupiter)", - "display_groups": [], - "description": "\nThese data should not be used in any manner relating to emergency management or planning, public safety,\nphysical safety or property endangerment. For higher-resolution data based on up-to-date methods,\nsubject to greater validation, and suitable for bottom-up risk analysis please contact\n[Jupiter Intelligence](https://www.jupiterintel.com).\n\nThis fire model computes the maximum monthly probability per annum of a wildfire within 100 km of\na given location based on several parameters from multiple bias corrected and downscaled Global Climate Models (GCMs).\nFor example, if the probability of occurrence of a wildfire is 5% in July, 20% in August, 10% in September\nand 0% for other months, the hazard indicator value is 20%.\n ", - "map": { - "colormap": { - "min_index": 1, - "min_value": 0.0, - "max_index": 255, - "max_value": 0.7, - "name": "heating", - "nodata_index": 0, - "units": "" - }, - "path": "fire_probability_{scenario}_{year}_map", - "bounds": [ - [ - -180.0, - 85.0 - ], - [ - 180.0, - 85.0 - ], - [ - 180.0, - -85.0 - ], - [ - -180.0, - -85.0 - ] - ], - "index_values": null, - "source": "map_array" - }, - "scenarios": [ - { - "id": "ssp126", - "years": [ - 2020, - 2030, - 2040, - 2050, - 2075, - 2100 - ] - }, - { - "id": "ssp585", - "years": [ - 2020, - 2030, - 2040, - 2050, - 2075, - 2100 - ] - } - ], - "units": "" - }, - { - "hazard_type": "Drought", - "group_id": "jupiter_osc", - "path": "drought/jupiter/v1/months_spei3m_below_-2_{scenario}_{year}", - "indicator_id": "months/spei3m/below/-2", - "indicator_model_id": null, - "indicator_model_gcm": "unknown", - "params": {}, - "display_name": "Drought (Jupiter)", - "display_groups": [], - "description": "\nThese data should not be used in any manner relating to emergency management or planning, public safety,\nphysical safety or property endangerment. For higher-resolution data based on up-to-date methods,\nsubject to greater validation, and suitable for bottom-up risk analysis please contact\n[Jupiter Intelligence](https://www.jupiterintel.com).\n\nThis drought model is based on the Standardized Precipitation-Evapotranspiration Index (SPEI).\nThe SPEl is an extension of the Standardized Precipitation Index which also considers Potential Evapotranspiration (PET)\nin determining drought events.\nThe SPEl is calculated from a log-logistic probability distribution function of climatic water balance\n(precipitation minus evapotranspiration) over a given time scale.\nThe SPEI itself is a standardized variable with a mean value 0 and standard deviation 1.\nThis drought model computes the number of months per annum where the 3-month rolling average\nof SPEI is below -2 based on the mean values of several parameters from\nbias-corrected and downscaled multiple Global Climate Models (GCMs).\n ", - "map": { - "colormap": { - "min_index": 1, - "min_value": 0.0, - "max_index": 255, - "max_value": 12.0, - "name": "heating", - "nodata_index": 0, - "units": "months/year" - }, - "path": "months_spei3m_below_-2_{scenario}_{year}_map", - "bounds": [ - [ - -180.0, - 85.0 - ], - [ - 180.0, - 85.0 - ], - [ - 180.0, - -85.0 - ], - [ - -180.0, - -85.0 - ] - ], - "index_values": null, - "source": "map_array" - }, - "scenarios": [ - { - "id": "ssp126", - "years": [ - 2020, - 2030, - 2040, - 2050, - 2075, - 2100 - ] - }, - { - "id": "ssp585", - "years": [ - 2020, - 2030, - 2040, - 2050, - 2075, - 2100 - ] - } - ], - "units": "months/year" - }, - { - "hazard_type": "Precipitation", - "group_id": "jupiter_osc", - "path": "precipitation/jupiter/v1/max_daily_water_equivalent_{scenario}_{year}", - "indicator_id": "max/daily/water_equivalent", - "indicator_model_id": null, - "indicator_model_gcm": "unknown", - "params": {}, - "display_name": "Precipitation (Jupiter)", - "display_groups": [], - "description": "\nThese data should not be used in any manner relating to emergency management or planning, public safety,\nphysical safety or property endangerment. For higher-resolution data based on up-to-date methods,\nsubject to greater validation, and suitable for bottom-up risk analysis please contact\n[Jupiter Intelligence](https://www.jupiterintel.com).\n\nThis model computes the maximum daily water equivalent precipitation (in mm) measured at the 100 year\nreturn period based on the mean of the precipitation distribution from multiple bias corrected and\ndownscaled Global Climate Models (GCMs).\n ", - "map": { - "colormap": { - "min_index": 1, - "min_value": 0.0, - "max_index": 255, - "max_value": 1000.0, - "name": "heating", - "nodata_index": 0, - "units": "mm" - }, - "path": "max_daily_water_equivalent_{scenario}_{year}_map", - "bounds": [ - [ - -180.0, - 85.0 - ], - [ - 180.0, - 85.0 - ], - [ - 180.0, - -85.0 - ], - [ - -180.0, - -85.0 - ] - ], - "index_values": null, - "source": "map_array" - }, - "scenarios": [ - { - "id": "ssp126", - "years": [ - 2020, - 2030, - 2040, - 2050, - 2075, - 2100 - ] - }, - { - "id": "ssp585", - "years": [ - 2020, - 2030, - 2040, - 2050, - 2075, - 2100 - ] - } - ], - "units": "mm" - }, - { - "hazard_type": "Hail", - "group_id": "jupiter_osc", - "path": "hail/jupiter/v1/days_above_5cm_{scenario}_{year}", - "indicator_id": "days/above/5cm", - "indicator_model_id": null, - "indicator_model_gcm": "unknown", - "params": {}, - "display_name": "Large hail days per year (Jupiter)", - "display_groups": [], - "description": "\nThese data should not be used in any manner relating to emergency management or planning, public safety,\nphysical safety or property endangerment. For higher-resolution data based on up-to-date methods,\nsubject to greater validation, and suitable for bottom-up risk analysis please contact\n[Jupiter Intelligence](https://www.jupiterintel.com).\n\nThis hail model computes the number of days per annum where hail exceeding 5 cm diameter is possible\nbased on the mean distribution of several parameters\nacross multiple bias-corrected and downscaled Global Climate Models (GCMs).\n ", - "map": { - "colormap": { - "min_index": 1, - "min_value": 0.0, - "max_index": 255, - "max_value": 10.0, - "name": "heating", - "nodata_index": 0, - "units": "days/year" - }, - "path": "days_above_5cm_{scenario}_{year}_map", - "bounds": [ - [ - -180.0, - 85.0 - ], - [ - 180.0, - 85.0 - ], - [ - 180.0, - -85.0 - ], - [ - -180.0, - -85.0 - ] - ], - "index_values": null, - "source": "map_array" - }, - "scenarios": [ - { - "id": "ssp126", - "years": [ - 2020, - 2030, - 2040, - 2050, - 2075, - 2100 - ] - }, - { - "id": "ssp585", - "years": [ - 2020, - 2030, - 2040, - 2050, - 2075, - 2100 - ] - } - ], - "units": "days/year" - }, - { - "hazard_type": "ChronicHeat", - "group_id": "jupiter_osc", - "path": "chronic_heat/jupiter/v1/days_above_35c_{scenario}_{year}", - "indicator_id": "days/above/35c", - "indicator_model_id": null, - "indicator_model_gcm": "unknown", - "params": {}, - "display_name": "Days per year above 35\u00b0C (Jupiter)", - "display_groups": [], - "description": "\nThese data should not be used in any manner relating to emergency management or planning, public safety,\nphysical safety or property endangerment. For higher-resolution data based on up-to-date methods,\nsubject to greater validation, and suitable for bottom-up risk analysis please contact\n[Jupiter Intelligence](https://www.jupiterintel.com).\n\nThis heat model computes the number of days exceeding 35\u00b0C per annum based on the mean of distribution fits\nto the bias-corrected and downscaled high temperature distribution\nacross multiple Global Climate Models (GCMs).\n ", - "map": { - "colormap": { - "min_index": 1, - "min_value": 0.0, - "max_index": 255, - "max_value": 365.0, - "name": "heating", - "nodata_index": 0, - "units": "days/year" - }, - "path": "days_above_35c_{scenario}_{year}_map", - "bounds": [ - [ - -180.0, - 85.0 - ], - [ - 180.0, - 85.0 - ], - [ - 180.0, - -85.0 - ], - [ - -180.0, - -85.0 - ] - ], - "index_values": null, - "source": "map_array" - }, - "scenarios": [ - { - "id": "ssp126", - "years": [ - 2020, - 2030, - 2040, - 2050, - 2075, - 2100 - ] - }, - { - "id": "ssp585", - "years": [ - 2020, - 2030, - 2040, - 2050, - 2075, - 2100 - ] - } - ], - "units": "days/year" - }, - { - "hazard_type": "Wind", - "group_id": "jupiter_osc", - "path": "wind/jupiter/v1/max_1min_{scenario}_{year}", - "indicator_id": "max_speed", - "indicator_model_id": "1min", - "indicator_model_gcm": "unknown", - "params": {}, - "display_name": "Max 1 minute sustained wind speed (Jupiter)", - "display_groups": [], - "description": "\nThese data should not be used in any manner relating to emergency management or planning, public safety,\nphysical safety or property endangerment. For higher-resolution data based on up-to-date methods,\nsubject to greater validation, and suitable for bottom-up risk analysis please contact\n[Jupiter Intelligence](https://www.jupiterintel.com).\n\nThis wind speed model computes the maximum 1-minute sustained wind speed (in km/hr) experienced over a\n100 year return period based on mean wind speed distributions\nfrom multiple Global Climate Models (GCMs).\n ", - "map": { - "colormap": { - "min_index": 1, - "min_value": 0.0, - "max_index": 255, - "max_value": 120.0, - "name": "heating", - "nodata_index": 0, - "units": "km/hour" - }, - "path": "max_1min_{scenario}_{year}_map", - "bounds": [ - [ - -180.0, - 85.0 - ], - [ - 180.0, - 85.0 - ], - [ - 180.0, - -85.0 - ], - [ - -180.0, - -85.0 - ] - ], - "index_values": null, - "source": "map_array" - }, - "scenarios": [ - { - "id": "ssp126", - "years": [ - 2020, - 2030, - 2040, - 2050, - 2075, - 2100 - ] - }, - { - "id": "ssp585", - "years": [ - 2020, - 2030, - 2040, - 2050, - 2075, - 2100 - ] - } - ], - "units": "km/hour" - }, - { - "hazard_type": "CombinedInundation", - "group_id": "jupiter_osc", - "path": "combined_flood/jupiter/v1/fraction_{scenario}_{year}", - "indicator_id": "flooded_fraction", - "indicator_model_id": null, - "indicator_model_gcm": "unknown", - "params": {}, - "display_name": "Flooded fraction (Jupiter)", - "display_groups": [], - "description": "\nThese data should not be used in any manner relating to emergency management or planning, public safety,\nphysical safety or property endangerment. For higher-resolution data based on up-to-date methods,\nsubject to greater validation, and suitable for bottom-up risk analysis please contact\n[Jupiter Intelligence](https://www.jupiterintel.com).\n\nFlooded fraction provides the spatial fraction of land flooded in a defined grid.\nIt is derived from higher-resolution flood hazards, and computed directly as the fraction of\ncells within the 30-km cell that have non-zero flooding at that return period.\nThis model uses a 30-km grid that experiences flooding at the 200-year return period.\nOpen oceans are excluded.\n ", - "map": { - "colormap": { - "min_index": 1, - "min_value": 0.0, - "max_index": 255, - "max_value": 1.0, - "name": "heating", - "nodata_index": 0, - "units": "" - }, - "path": "fraction_{scenario}_{year}_map", - "bounds": [ - [ - -180.0, - 85.0 - ], - [ - 180.0, - 85.0 - ], - [ - 180.0, - -85.0 - ], - [ - -180.0, - -85.0 - ] - ], - "index_values": null, - "source": "map_array" - }, - "scenarios": [ - { - "id": "ssp126", - "years": [ - 2020, - 2030, - 2040, - 2050, - 2075, - 2100 - ] - }, - { - "id": "ssp585", - "years": [ - 2020, - 2030, - 2040, - 2050, - 2075, - 2100 - ] - } - ], - "units": "none" - }, - { - "hazard_type": "ChronicHeat", - "group_id": "", - "path": "chronic_heat/osc/v2/mean_work_loss_{intensity}_{gcm}_{scenario}_{year}", - "indicator_id": "mean_work_loss/{intensity}", - "indicator_model_id": null, - "indicator_model_gcm": "{gcm}", - "params": { - "intensity": [ - "low", - "medium", - "high" - ], - "gcm": [ - "ACCESS-CM2", - "CMCC-ESM2", - "CNRM-CM6-1", - "MPI-ESM1-2-LR", - "MIROC6", - "NorESM2-MM" - ] - }, - "display_name": "Mean work loss, {intensity} intensity/{gcm}", - "display_groups": [ - "Mean work loss" - ], - "description": "The mean work loss indicator is calculated from the 'Wet Bulb Globe Temperature' (WBGT) indicator:\n\n$$\nI^\\text{WBGT}_i = 0.567 \\times T^\\text{avg}_i + 0.393 \\times p^\\text{vapour}_i + 3.94\n$$\n\n$I^\\text{WBGT}_i$ is the WBGT indicator, $T^\\text{avg}_i$ is the average daily near-surface surface temperature (in degress Celsius) on day index, $i$, and $p^\\text{vapour}$\nis the water vapour partial pressure (in kPa). $p^\\text{vapour}$ is calculated from relative humidity $h_r$ via:\n\n$$\np^\\text{vapour}_i = \\frac{h_r}{100} \\times 6.105 \\times \\exp \\left( \\frac{17.27 \\times T^\\text{avg}_i}{237.7 + T^\\text{avg}_i} \\right)\n$$\n\nThe work ability indicator, $I^{\\text{WA}}$ is finally calculated via:\n\n$$\nI^{\\text{WA}}_i = 0.1 + 0.9 / \\left( 1 + (I^\\text{WBGT}_i / \\alpha_1)^{\\alpha_2} \\right)\n$$\n\nAn annual average work loss indicator, $I^{\\text{WL}}$ is calculated via:\n\n$$\nI^{\\text{WL}} = 1 - \\frac{1}{n_y} \\sum_{i = 1}^{n_y} I^{\\text{WA}}_i,\n$$\n\n$n_y$ being the number of days in the year. The OS-Climate-generated indicators are inferred from CMIP6 data, averaged over 6 models: ACCESS-CM2, CMCC-ESM2, CNRM-CM6-1, MPI-ESM1-2-LR, MIROC6 and NorESM2-MM.\nThe indicators are generated for periods: 'historical' (averaged over 1995-2014), 2030 (2021-2040), 2040 (2031-2050) and 2050 (2041-2060).\n", - "map": { - "colormap": { - "min_index": 1, - "min_value": 0.0, - "max_index": 255, - "max_value": 0.8, - "name": "heating", - "nodata_index": 0, - "units": "fractional loss" - }, - "path": "mean_work_loss_{intensity}_{gcm}_{scenario}_{year}_map", - "bounds": [ - [ - -180.0, - 85.0 - ], - [ - 180.0, - 85.0 - ], - [ - 180.0, - -60.0 - ], - [ - -180.0, - -60.0 - ] - ], - "index_values": null, - "source": "map_array" - }, - "scenarios": [ - { - "id": "historical", - "years": [ - 2005 - ] - }, - { - "id": "ssp126", - "years": [ - 2030, - 2040, - 2050 - ] - }, - { - "id": "ssp245", - "years": [ - 2030, - 2040, - 2050 - ] - }, - { - "id": "ssp585", - "years": [ - 2030, - 2040, - 2050 - ] - } - ], - "units": "fractional loss" - }, - { - "hazard_type": "ChronicHeat", - "group_id": "", - "path": "chronic_heat/osc/v2/days_tas_above_{temp_c}c_{gcm}_{scenario}_{year}", - "indicator_id": "days_tas/above/{temp_c}c", - "indicator_model_id": null, - "indicator_model_gcm": "{gcm}", - "params": { - "temp_c": [ - "25", - "30", - "35", - "40", - "45", - "50", - "55" - ], - "gcm": [ - "ACCESS-CM2", - "CMCC-ESM2", - "CNRM-CM6-1", - "MPI-ESM1-2-LR", - "MIROC6", - "NorESM2-MM" - ] - }, - "display_name": "Days with average temperature above {temp_c}\u00b0C/{gcm}", - "display_groups": [ - "Days with average temperature above" - ], - "description": "Days per year for which the average near-surface temperature 'tas' is above a threshold specified in \u00b0C.\n\n$$\nI = \\frac{365}{n_y} \\sum_{i = 1}^{n_y} \\boldsymbol{\\mathbb{1}}_{\\; \\, T^{avg}_i > T^\\text{ref}} \\nonumber\n$$\n\n$I$ is the indicator, $T^\\text{avg}_i$ is the daily average near-surface temperature for day index $i$ in \u00b0C, $n_y$ is the number of days in the year\nand $T^\\text{ref}$ is the reference temperature.\nThe OS-Climate-generated indicators are inferred from downscaled CMIP6 data. This is done for 6 Global Circulation Models: ACCESS-CM2, CMCC-ESM2, CNRM-CM6-1, MPI-ESM1-2-LR, MIROC6 and NorESM2-MM.\nThe downscaled data is sourced from the [NASA Earth Exchange Global Daily Downscaled Projections](https://www.nccs.nasa.gov/services/data-collections/land-based-products/nex-gddp-cmip6).\nIndicators are generated for periods: 'historical' (averaged over 1995-2014), 2030 (2021-2040), 2040 (2031-2050)\nand 2050 (2041-2060).\n", - "map": { - "colormap": { - "min_index": 1, - "min_value": 0.0, - "max_index": 255, - "max_value": 100.0, - "name": "heating", - "nodata_index": 0, - "units": "days/year" - }, - "path": "days_tas_above_{temp_c}c_{gcm}_{scenario}_{year}_map", - "bounds": [ - [ - -180.0, - 85.0 - ], - [ - 180.0, - 85.0 - ], - [ - 180.0, - -60.0 - ], - [ - -180.0, - -60.0 - ] - ], - "index_values": null, - "source": "map_array" - }, - "scenarios": [ - { - "id": "historical", - "years": [ - 2005 - ] - }, - { - "id": "ssp126", - "years": [ - 2030, - 2040, - 2050 - ] - }, - { - "id": "ssp245", - "years": [ - 2030, - 2040, - 2050 - ] - }, - { - "id": "ssp585", - "years": [ - 2030, - 2040, - 2050 - ] - } - ], - "units": "days/year" - }, - { - "hazard_type": "Wind", - "group_id": "iris_osc", - "path": "wind/iris/v1/max_speed_{scenario}_{year}", - "indicator_id": "max_speed", - "indicator_model_id": null, - "indicator_model_gcm": "combined", - "params": {}, - "display_name": "Max wind speed (IRIS)", - "display_groups": [], - "description": "Assessing tropical cyclone risk on a global scale given the infrequency of landfalling tropical cyclones and the short period of reliable observations remains a challenge. Synthetic tropical cyclone datasets can help overcome these problems. Here we present a new global dataset created by IRIS, the ImpeRIal college Storm Model. IRIS is novel because, unlike other synthetic TC models, it only simulates the decay from the point of lifetime maximum intensity. This minimises the bias in the dataset. It takes input from 42 years of observed tropical cyclones and creates a 10,000 year synthetic dataset which is then validated against the observations. IRIS captures important statistical characteristics of the observed data. The return periods of the landfall maximum wind speed (1 minute sustained in m/s) are realistic globally. Climate model projections are used to adjust the life-time maximum intensity.\nhttps://www.imperial.ac.uk/grantham/research/climate-science/modelling-tropical-cyclones/\n", - "map": { - "colormap": { - "min_index": 1, - "min_value": 0.0, - "max_index": 255, - "max_value": 120.0, - "name": "heating", - "nodata_index": 0, - "units": "m/s" - }, - "path": "wind/iris/v1/max_speed_{scenario}_{year}_map", - "bounds": [ - [ - -180.0, - 60.0 - ], - [ - 180.0, - 60.0 - ], - [ - 180.0, - -60.0 - ], - [ - -180.0, - -60.0 - ] - ], - "index_values": null, - "source": "map_array_pyramid" - }, - "scenarios": [ - { - "id": "historical", - "years": [ - 2010 - ] - }, - { - "id": "ssp119", - "years": [ - 2050 - ] - }, - { - "id": "ssp245", - "years": [ - 2050 - ] - }, - { - "id": "ssp585", - "years": [ - 2050 - ] - } - ], - "units": "m/s" - }, - { - "hazard_type": "ChronicHeat", - "group_id": "", - "path": "chronic_heat/osc/v2/mean_degree_days_above_index_{gcm}_{scenario}_{year}", - "indicator_id": "mean_degree_days/above/index", - "indicator_model_id": null, - "indicator_model_gcm": "{gcm}", - "params": { - "gcm": [ - "ACCESS-CM2", - "CMCC-ESM2", - "CNRM-CM6-1", - "MPI-ESM1-2-LR", - "MIROC6", - "NorESM2-MM" - ] - }, - "display_name": "Mean degree days above index value/{gcm}", - "display_groups": [ - "Mean degree days" - ], - "description": "Degree days indicators are calculated by integrating over time the absolute difference in temperature\nof the medium over a reference temperature. The exact method of calculation may vary;\nhere the daily maximum near-surface temperature 'tasmax' is used to calculate an annual indicator:\n\n$$\nI^\\text{dd} = \\frac{365}{n_y} \\sum_{i = 1}^{n_y} | T^\\text{max}_i - T^\\text{ref} | \\nonumber\n$$\n\n$I^\\text{dd}$ is the indicator, $T^\\text{max}$ is the daily maximum near-surface temperature, $n_y$ is the number of days in the year and $i$ is the day index.\nand $T^\\text{ref}$ is the reference temperature of 32\u00b0C. The OS-Climate-generated indicators are inferred\nfrom downscaled CMIP6 data, averaged over 6 models: ACCESS-CM2, CMCC-ESM2, CNRM-CM6-1, MPI-ESM1-2-LR, MIROC6 and NorESM2-MM.\nThe downscaled data is sourced from the [NASA Earth Exchange Global Daily Downscaled Projections](https://www.nccs.nasa.gov/services/data-collections/land-based-products/nex-gddp-cmip6).\nThe indicators are generated for periods: 'historical' (averaged over 1995-2014), 2030 (2021-2040), 2040 (2031-2050)\nand 2050 (2041-2060).\n", - "map": { - "colormap": { - "min_index": 1, - "min_value": 0.0, - "max_index": 255, - "max_value": 4000.0, - "name": "heating", - "nodata_index": 0, - "units": "degree days" - }, - "path": "mean_degree_days_above_index_{gcm}_{scenario}_{year}_map", - "bounds": [ - [ - -180.0, - 85.0 - ], - [ - 180.0, - 85.0 - ], - [ - 180.0, - -60.0 - ], - [ - -180.0, - -60.0 - ] - ], - "index_values": [ - 16, - 20, - 24 - ], - "source": "map_array" - }, - "scenarios": [ - { - "id": "historical", - "years": [ - 2005 - ] - }, - { - "id": "ssp126", - "years": [ - 2030, - 2040, - 2050 - ] - }, - { - "id": "ssp245", - "years": [ - 2030, - 2040, - 2050 - ] - }, - { - "id": "ssp585", - "years": [ - 2030, - 2040, - 2050 - ] - } - ], - "units": "degree days" - }, - { - "hazard_type": "ChronicHeat", - "group_id": "", - "path": "chronic_heat/osc/v2/mean_degree_days_below_index_{gcm}_{scenario}_{year}", - "indicator_id": "mean_degree_days/below/index", - "indicator_model_id": null, - "indicator_model_gcm": "{gcm}", - "params": { - "gcm": [ - "ACCESS-CM2", - "CMCC-ESM2", - "CNRM-CM6-1", - "MPI-ESM1-2-LR", - "MIROC6", - "NorESM2-MM" - ] - }, - "display_name": "Mean degree days below index value/{gcm}", - "display_groups": [ - "Mean degree days" - ], - "description": "Degree days indicators are calculated by integrating over time the absolute difference in temperature\nof the medium over a reference temperature. The exact method of calculation may vary;\nhere the daily maximum near-surface temperature 'tasmax' is used to calculate an annual indicator:\n\n$$\nI^\\text{dd} = \\frac{365}{n_y} \\sum_{i = 1}^{n_y} | T^\\text{max}_i - T^\\text{ref} | \\nonumber\n$$\n\n$I^\\text{dd}$ is the indicator, $T^\\text{max}$ is the daily maximum near-surface temperature, $n_y$ is the number of days in the year and $i$ is the day index.\nand $T^\\text{ref}$ is the reference temperature of 32\u00b0C. The OS-Climate-generated indicators are inferred\nfrom downscaled CMIP6 data, averaged over 6 models: ACCESS-CM2, CMCC-ESM2, CNRM-CM6-1, MPI-ESM1-2-LR, MIROC6 and NorESM2-MM.\nThe downscaled data is sourced from the [NASA Earth Exchange Global Daily Downscaled Projections](https://www.nccs.nasa.gov/services/data-collections/land-based-products/nex-gddp-cmip6).\nThe indicators are generated for periods: 'historical' (averaged over 1995-2014), 2030 (2021-2040), 2040 (2031-2050)\nand 2050 (2041-2060).\n", - "map": { - "colormap": { - "min_index": 1, - "min_value": 0.0, - "max_index": 255, - "max_value": 4000.0, - "name": "heating", - "nodata_index": 0, - "units": "degree days" - }, - "path": "mean_degree_days_below_index_{gcm}_{scenario}_{year}_map", - "bounds": [ - [ - -180.0, - 85.0 - ], - [ - 180.0, - 85.0 - ], - [ - 180.0, - -60.0 - ], - [ - -180.0, - -60.0 - ] - ], - "index_values": [ - 16, - 20, - 24 - ], - "source": "map_array" - }, - "scenarios": [ - { - "id": "historical", - "years": [ - 2005 - ] - }, - { - "id": "ssp126", - "years": [ - 2030, - 2040, - 2050 - ] - }, - { - "id": "ssp245", - "years": [ - 2030, - 2040, - 2050 - ] - }, - { - "id": "ssp585", - "years": [ - 2030, - 2040, - 2050 - ] - } - ], - "units": "degree days" - }, - { - "hazard_type": "ChronicHeat", - "group_id": "", - "path": "chronic_heat/nluu/v2/weeks_water_temp_above_{gcm}_{scenario}_{year}", - "indicator_id": "weeks_water_temp_above", - "indicator_model_id": null, - "indicator_model_gcm": "{gcm}", - "params": { - "gcm": [ - "GFDL", - "HadGEM", - "IPSL", - "MIROC", - "NorESM" - ] - }, - "display_name": "Weeks with average water temperature above threshold in \u00b0C/{gcm}", - "display_groups": [ - "Weeks with average water temperature above threshold in \u00b0C" - ], - "description": "Weeks per year for which the average water temperature is above a threshold specified in \u00b0C:\n\n$$\nI = \\frac{52}{n_y} \\sum_{i = 1}^{n_y} \\boldsymbol{\\mathbb{1}}_{\\; \\, T^{avg}_i > T^\\text{ref}} \\nonumber\n$$\n\n$I$ is the indicator, $T^\\text{avg}_i$ is the weekly average water temperature for week index $i$ in \u00b0C, $n_y$ is the number of weeks in the sample\nand $T^\\text{ref}$ is the reference temperature.\n\nThe OS-Climate-generated indicators are inferred from downscaled CMIP5 data. This is done for 5 Global Circulation Models: GFDL-ESM2M, HadGEM2-ES, ISPL-CM5A-LR, MIROC-ESM-CHEM and NorESM1-M.\nThe downscaled data is sourced from the [Futurestreams dataset](https://geo.public.data.uu.nl/vault-futurestreams/research-futurestreams%5B1633685642%5D/original/waterTemp/) on the data publication platform of Utrecht University.\nIndicators are generated for periods: 'historical' (averaged over 1976-2005), 2020 (2006-2030), 2030 (2021-2040), 2040 (2031-2050), 2050 (2041-2060), 2060 (2051-2070), 2070 (2061-2080), 2080 (2071-2090) and 2090 (2081-2100).\n", - "map": { - "colormap": { - "min_index": 1, - "min_value": 0.0, - "max_index": 255, - "max_value": 100.0, - "name": "heating", - "nodata_index": 0, - "units": "weeks/year" - }, - "path": "maps/chronic_heat/nluu/v2/weeks_water_temp_above_{gcm}_{scenario}_{year}_map", - "bounds": [ - [ - -180.0, - 85.0 - ], - [ - 180.0, - 85.0 - ], - [ - 180.0, - -85.0 - ], - [ - -180.0, - -85.0 - ] - ], - "index_values": [ - 5, - 7.5, - 10, - 12.5, - 15, - 17.5, - 20, - 22.5, - 25, - 27.5, - 30, - 32.5, - 35, - 37.5, - 40 - ], - "source": "map_array_pyramid" - }, - "scenarios": [ - { - "id": "historical", - "years": [ - 1991 - ] - }, - { - "id": "rcp2p6", - "years": [ - 2020, - 2030, - 2040, - 2050, - 2060, - 2070, - 2080, - 2090 - ] - }, - { - "id": "rcp4p5", - "years": [ - 2020, - 2030, - 2040, - 2050, - 2060, - 2070, - 2080, - 2090 - ] - }, - { - "id": "rcp6p0", - "years": [ - 2020, - 2030, - 2040, - 2050, - 2060, - 2070, - 2080, - 2090 - ] - }, - { - "id": "rcp8p5", - "years": [ - 2020, - 2030, - 2040, - 2050, - 2060, - 2070, - 2080, - 2090 - ] - } - ], - "units": "weeks/year" - }, - { - "hazard_type": "ChronicHeat", - "group_id": "", - "path": "chronic_heat/nluu/v2/weeks_water_temp_above_E2O_{scenario}_{year}", - "indicator_id": "weeks_water_temp_above", - "indicator_model_id": null, - "indicator_model_gcm": "E2O", - "params": {}, - "display_name": "Weeks with average water temperature above threshold in \u00b0C/E2O", - "display_groups": [ - "Weeks with average water temperature above threshold in \u00b0C" - ], - "description": "Weeks per year for which the average water temperature is above a threshold specified in \u00b0C:\n\n$$\nI = \\frac{52}{n_y} \\sum_{i = 1}^{n_y} \\boldsymbol{\\mathbb{1}}_{\\; \\, T^{avg}_i > T^\\text{ref}} \\nonumber\n$$\n\n$I$ is the indicator, $T^\\text{avg}_i$ is the weekly average water temperature for week index $i$ in \u00b0C, $n_y$ is the number of weeks in the sample\nand $T^\\text{ref}$ is the reference temperature.\n\nThe OS-Climate-generated indicators are inferred from downscaled CMIP5 data. This is done for 5 Global Circulation Models: GFDL-ESM2M, HadGEM2-ES, ISPL-CM5A-LR, MIROC-ESM-CHEM and NorESM1-M.\nThe downscaled data is sourced from the [Futurestreams dataset](https://geo.public.data.uu.nl/vault-futurestreams/research-futurestreams%5B1633685642%5D/original/waterTemp/) on the data publication platform of Utrecht University.\nIndicators are generated for periods: 'historical' (averaged over 1979-2005), 2020 (2006-2030), 2030 (2021-2040), 2040 (2031-2050), 2050 (2041-2060), 2060 (2051-2070), 2070 (2061-2080), 2080 (2071-2090) and 2090 (2081-2100).\n", - "map": { - "colormap": { - "min_index": 1, - "min_value": 0.0, - "max_index": 255, - "max_value": 100.0, - "name": "heating", - "nodata_index": 0, - "units": "weeks/year" - }, - "path": "maps/chronic_heat/nluu/v2/weeks_water_temp_above_E2O_{scenario}_{year}_map", - "bounds": [ - [ - -180.0, - 85.0 - ], - [ - 180.0, - 85.0 - ], - [ - 180.0, - -85.0 - ], - [ - -180.0, - -85.0 - ] - ], - "index_values": [ - 5, - 7.5, - 10, - 12.5, - 15, - 17.5, - 20, - 22.5, - 25, - 27.5, - 30, - 32.5, - 35, - 37.5, - 40 - ], - "source": "map_array_pyramid" - }, - "scenarios": [ - { - "id": "historical", - "years": [ - 1991 - ] - } - ], - "units": "weeks/year" - }, - { - "hazard_type": "ChronicHeat", - "group_id": "", - "path": "chronic_heat/osc/v2/days_wbgt_above_{gcm}_{scenario}_{year}", - "indicator_id": "days_wbgt_above", - "indicator_model_id": null, - "indicator_model_gcm": "{gcm}", - "params": { - "gcm": [ - "ACCESS-CM2", - "CMCC-ESM2", - "CNRM-CM6-1", - "MPI-ESM1-2-LR", - "MIROC6", - "NorESM2-MM" - ] - }, - "display_name": "Days with wet-bulb globe temperature above threshold in \u00b0C/{gcm}", - "display_groups": [ - "Days with wet-bulb globe temperature above threshold in \u00b0C" - ], - "description": "Days per year for which the 'Wet Bulb Globe Temperature' indicator is above a threshold specified in \u00b0C:\n\n$$\nI = \\frac{365}{n_y} \\sum_{i = 1}^{n_y} \\boldsymbol{\\mathbb{1}}_{\\; \\, T^\\text{WBGT}_i > T^\\text{ref}} \\nonumber\n$$\n\n$I$ is the indicator, $n_y$ is the number of days in the sample and $T^\\text{ref}$ is the reference temperature. \n\nThe 'Wet-Bulb Globe Temperature' (WBGT) indicator is calculated from both the average daily near-surface surface temperature in \u00b0C denoted $T^\\text{avg}$ and the water vapour partial pressure in kPa denoted $p^\\text{vapour}$:\n\n$$\nT^\\text{WBGT}_i = 0.567 \\times T^\\text{avg}_i + 0.393 \\times p^\\text{vapour}_i + 3.94\n$$\n\nThe water vapour partial pressure $p^\\text{vapour}$ is calculated from relative humidity $h^\\text{relative}$:\n\n$$\np^\\text{vapour}_i = \\frac{h^\\text{relative}_i}{100} \\times 6.105 \\times \\exp \\left( \\frac{17.27 \\times T^\\text{avg}_i}{237.7 + T^\\text{avg}_i} \\right)\n$$\n\nThe OS-Climate-generated indicators are inferred from downscaled CMIP6 data, averaged over for 6 Global Circulation Models: ACCESS-CM2, CMCC-ESM2, CNRM-CM6-1, MPI-ESM1-2-LR, MIROC6 and NorESM2-MM.\nThe downscaled data is sourced from the [NASA Earth Exchange Global Daily Downscaled Projections](https://www.nccs.nasa.gov/services/data-collections/land-based-products/nex-gddp-cmip6).\nIndicators are generated for periods: 'historical' (averaged over 1995-2014), 2030 (2021-2040), 2040 (2031-2050), 2050 (2041-2060), 2060 (2051-2070), 2070 (2061-2080), 2080 (2071-2090) and 2090 (2081-2100).\n", - "map": { - "colormap": { - "min_index": 1, - "min_value": 0.0, - "max_index": 255, - "max_value": 100.0, - "name": "heating", - "nodata_index": 0, - "units": "days/year" - }, - "path": "maps/chronic_heat/osc/v2/days_wbgt_above_{gcm}_{scenario}_{year}_map", - "bounds": [ - [ - -180.0, - 85.0 - ], - [ - 180.0, - 85.0 - ], - [ - 180.0, - -85.0 - ], - [ - -180.0, - -85.0 - ] - ], - "index_values": [ - 5, - 10, - 15, - 20, - 25, - 30, - 35, - 40, - 45, - 50, - 55, - 60 - ], - "source": "map_array_pyramid" - }, - "scenarios": [ - { - "id": "historical", - "years": [ - 2005 - ] - }, - { - "id": "ssp126", - "years": [ - 2030, - 2040, - 2050, - 2060, - 2070, - 2080, - 2090 - ] - }, - { - "id": "ssp245", - "years": [ - 2030, - 2040, - 2050, - 2060, - 2070, - 2080, - 2090 - ] - }, - { - "id": "ssp370", - "years": [ - 2030, - 2040, - 2050, - 2060, - 2070, - 2080, - 2090 - ] - }, - { - "id": "ssp585", - "years": [ - 2030, - 2040, - 2050, - 2060, - 2070, - 2080, - 2090 - ] - } - ], - "units": "days/year" - }, - { - "hazard_type": "WaterRisk", - "group_id": "", - "path": "water_risk/wri/v2/water_demand_{scenario}_{year}", - "indicator_id": "water_demand", - "indicator_model_id": null, - "indicator_model_gcm": "combined", - "params": {}, - "display_name": "Water demand in centimeters/year (Aqueduct 4.0)", - "display_groups": [ - "Water demand in centimeters/year (Aqueduct 4.0)" - ], - "description": "The World Resources Institute (WRI) [Aqueduct 4.0](https://www.wri.org/data/aqueduct-global-maps-40-data) is the latest iteration of [WRI\u2019s water risk framework](https://www.wri.org/data/aqueduct-water-risk-atlas) designed to translate complex \nhydrological data into intuitive indicators of water-related risk:\n\n* **Water demand**: gross demand is the maximum potential water required to meet sectoral demands. Sectoral water demand includes: domestic, industrial, irrigation, and livestock. Demand is displayed as a flux (centimeters/year).\n\n* **Water supply**: available blue water, the total amount of renewable freshwater available to a sub-basin with upstream consumption removed, includes surface flow, interflow, and groundwater recharge. Available blue water is displayed as a flux (centimeters/year).\n\n* **Water stress**: an indicator of competition for water resources defined informally as the ratio of demand for water by human society divided by available water. It can be classified into six categories: -1: Arid and low water use, 0: Low (<10%), 1: Low-medium (10-20%), 2: Medium-high (20-40%), 3: High (40-80%), 4: Extremely high (>80%).\n\n* **Water depletion**: the ratio of total water consumption to available renewable water supplies. Total water consumption includes domestic, industrial, irrigation, and livestock consumptive uses. Available renewable water supplies include the impact of upstream consumptive water users and large dams on downstream water availability. Higher values indicate larger impact on the local water supply and decreased water availability for downstream users. Water depletion is similar to water stress; however, instead of looking at total water demand, water depletion is calculated using consumptive withdrawal only. It can be classified into six categories: -1: Arid and low water use, 0 : Low (<5%), 1: Low-medium (5-25%), 2 : Medium-high (25-50%), 3: High (50-75%), 4 : Extremely high (>75%).\n\n[Aqueduct 4.0 FAQ](https://github.com/wri/Aqueduct40/blob/master/data_FAQ.md) explains why the water supply and demand values are measured as fluxes instead of volumes. Volumes (cubic meters) can vary significantly based on the size of each sub-basin, potentially misleading as they might primarily reflect a larger geographical area rather than indicating a higher rate of water flow. On the other hand, fluxes (centimeters/year), which measure the rate of water flow, offer a more direct and equitable means of comparing water availability between different sub-basins. Volume = Flux x Area.\n\nThe spatial resolution is 5 \u00d7 5 arc minutes which equates roughly to 10 kilometer (km) \u00d7 10 km pixels. \nThe future projections were created using CMIP6 climate forcings based on three future scenarios: optimistic (ssp126), business-as-usual (ssp370), and pessimistic (ssp585) available at [HYPFLOWSCI6](https://public.yoda.uu.nl/geo/UU01/YM7A5H.html). WRI's original data are presented at the HydroBASINS Level 6 scale. Indicators are available for periods: 'historical' (averaged over 1979-2019), 2030 (2015-2045), 2050 (2035-2065) and 2080 (2065-2095).", - "map": { - "colormap": { - "min_index": 1, - "min_value": 0.0, - "max_index": 255, - "max_value": 100.0, - "name": "heating", - "nodata_index": 0, - "units": "centimeters/year" - }, - "path": "maps/water_risk/wri/v2/water_demand_{scenario}_{year}_map", - "bounds": [ - [ - -180.0, - 85.0 - ], - [ - 180.0, - 85.0 - ], - [ - 180.0, - -85.0 - ], - [ - -180.0, - -85.0 - ] - ], - "index_values": null, - "source": "map_array_pyramid" - }, - "scenarios": [ - { - "id": "historical", - "years": [ - 1999 - ] - }, - { - "id": "ssp126", - "years": [ - 2030, - 2050, - 2080 - ] - }, - { - "id": "ssp370", - "years": [ - 2030, - 2050, - 2080 - ] - }, - { - "id": "ssp585", - "years": [ - 2030, - 2050, - 2080 - ] - } - ], - "units": "centimeters/year" - }, - { - "hazard_type": "WaterRisk", - "group_id": "", - "path": "water_risk/wri/v2/water_supply_{scenario}_{year}", - "indicator_id": "water_supply", - "indicator_model_id": null, - "indicator_model_gcm": "combined", - "params": {}, - "display_name": "Water supply in centimeters/year (Aqueduct 4.0)", - "display_groups": [ - "Water supply in centimeters/year (Aqueduct 4.0)" - ], - "description": "The World Resources Institute (WRI) [Aqueduct 4.0](https://www.wri.org/data/aqueduct-global-maps-40-data) is the latest iteration of [WRI\u2019s water risk framework](https://www.wri.org/data/aqueduct-water-risk-atlas) designed to translate complex \nhydrological data into intuitive indicators of water-related risk:\n\n* **Water demand**: gross demand is the maximum potential water required to meet sectoral demands. Sectoral water demand includes: domestic, industrial, irrigation, and livestock. Demand is displayed as a flux (centimeters/year).\n\n* **Water supply**: available blue water, the total amount of renewable freshwater available to a sub-basin with upstream consumption removed, includes surface flow, interflow, and groundwater recharge. Available blue water is displayed as a flux (centimeters/year).\n\n* **Water stress**: an indicator of competition for water resources defined informally as the ratio of demand for water by human society divided by available water. It can be classified into six categories: -1: Arid and low water use, 0: Low (<10%), 1: Low-medium (10-20%), 2: Medium-high (20-40%), 3: High (40-80%), 4: Extremely high (>80%).\n\n* **Water depletion**: the ratio of total water consumption to available renewable water supplies. Total water consumption includes domestic, industrial, irrigation, and livestock consumptive uses. Available renewable water supplies include the impact of upstream consumptive water users and large dams on downstream water availability. Higher values indicate larger impact on the local water supply and decreased water availability for downstream users. Water depletion is similar to water stress; however, instead of looking at total water demand, water depletion is calculated using consumptive withdrawal only. It can be classified into six categories: -1: Arid and low water use, 0 : Low (<5%), 1: Low-medium (5-25%), 2 : Medium-high (25-50%), 3: High (50-75%), 4 : Extremely high (>75%).\n\n[Aqueduct 4.0 FAQ](https://github.com/wri/Aqueduct40/blob/master/data_FAQ.md) explains why the water supply and demand values are measured as fluxes instead of volumes. Volumes (cubic meters) can vary significantly based on the size of each sub-basin, potentially misleading as they might primarily reflect a larger geographical area rather than indicating a higher rate of water flow. On the other hand, fluxes (centimeters/year), which measure the rate of water flow, offer a more direct and equitable means of comparing water availability between different sub-basins. Volume = Flux x Area.\n\nThe spatial resolution is 5 \u00d7 5 arc minutes which equates roughly to 10 kilometer (km) \u00d7 10 km pixels. \nThe future projections were created using CMIP6 climate forcings based on three future scenarios: optimistic (ssp126), business-as-usual (ssp370), and pessimistic (ssp585) available at [HYPFLOWSCI6](https://public.yoda.uu.nl/geo/UU01/YM7A5H.html). WRI's original data are presented at the HydroBASINS Level 6 scale. Indicators are available for periods: 'historical' (averaged over 1979-2019), 2030 (2015-2045), 2050 (2035-2065) and 2080 (2065-2095).", - "map": { - "colormap": { - "min_index": 1, - "min_value": 0.0, - "max_index": 255, - "max_value": 2000.0, - "name": "heating", - "nodata_index": 0, - "units": "centimeters/year" - }, - "path": "maps/water_risk/wri/v2/water_supply_{scenario}_{year}_map", - "bounds": [ - [ - -180.0, - 85.0 - ], - [ - 180.0, - 85.0 - ], - [ - 180.0, - -85.0 - ], - [ - -180.0, - -85.0 - ] - ], - "index_values": null, - "source": "map_array_pyramid" - }, - "scenarios": [ - { - "id": "historical", - "years": [ - 1999 - ] - }, - { - "id": "ssp126", - "years": [ - 2030, - 2050, - 2080 - ] - }, - { - "id": "ssp370", - "years": [ - 2030, - 2050, - 2080 - ] - }, - { - "id": "ssp585", - "years": [ - 2030, - 2050, - 2080 - ] - } - ], - "units": "centimeters/year" - }, - { - "hazard_type": "WaterRisk", - "group_id": "", - "path": "water_risk/wri/v2/water_stress_{scenario}_{year}", - "indicator_id": "water_stress", - "indicator_model_id": null, - "indicator_model_gcm": "combined", - "params": {}, - "display_name": "Water stress (Aqueduct 4.0)", - "display_groups": [ - "Water stress (Aqueduct 4.0)" - ], - "description": "The World Resources Institute (WRI) [Aqueduct 4.0](https://www.wri.org/data/aqueduct-global-maps-40-data) is the latest iteration of [WRI\u2019s water risk framework](https://www.wri.org/data/aqueduct-water-risk-atlas) designed to translate complex \nhydrological data into intuitive indicators of water-related risk:\n\n* **Water demand**: gross demand is the maximum potential water required to meet sectoral demands. Sectoral water demand includes: domestic, industrial, irrigation, and livestock. Demand is displayed as a flux (centimeters/year).\n\n* **Water supply**: available blue water, the total amount of renewable freshwater available to a sub-basin with upstream consumption removed, includes surface flow, interflow, and groundwater recharge. Available blue water is displayed as a flux (centimeters/year).\n\n* **Water stress**: an indicator of competition for water resources defined informally as the ratio of demand for water by human society divided by available water. It can be classified into six categories: -1: Arid and low water use, 0: Low (<10%), 1: Low-medium (10-20%), 2: Medium-high (20-40%), 3: High (40-80%), 4: Extremely high (>80%).\n\n* **Water depletion**: the ratio of total water consumption to available renewable water supplies. Total water consumption includes domestic, industrial, irrigation, and livestock consumptive uses. Available renewable water supplies include the impact of upstream consumptive water users and large dams on downstream water availability. Higher values indicate larger impact on the local water supply and decreased water availability for downstream users. Water depletion is similar to water stress; however, instead of looking at total water demand, water depletion is calculated using consumptive withdrawal only. It can be classified into six categories: -1: Arid and low water use, 0 : Low (<5%), 1: Low-medium (5-25%), 2 : Medium-high (25-50%), 3: High (50-75%), 4 : Extremely high (>75%).\n\n[Aqueduct 4.0 FAQ](https://github.com/wri/Aqueduct40/blob/master/data_FAQ.md) explains why the water supply and demand values are measured as fluxes instead of volumes. Volumes (cubic meters) can vary significantly based on the size of each sub-basin, potentially misleading as they might primarily reflect a larger geographical area rather than indicating a higher rate of water flow. On the other hand, fluxes (centimeters/year), which measure the rate of water flow, offer a more direct and equitable means of comparing water availability between different sub-basins. Volume = Flux x Area.\n\nThe spatial resolution is 5 \u00d7 5 arc minutes which equates roughly to 10 kilometer (km) \u00d7 10 km pixels. \nThe future projections were created using CMIP6 climate forcings based on three future scenarios: optimistic (ssp126), business-as-usual (ssp370), and pessimistic (ssp585) available at [HYPFLOWSCI6](https://public.yoda.uu.nl/geo/UU01/YM7A5H.html). WRI's original data are presented at the HydroBASINS Level 6 scale. Indicators are available for periods: 'historical' (averaged over 1979-2019), 2030 (2015-2045), 2050 (2035-2065) and 2080 (2065-2095).", - "map": { - "colormap": { - "min_index": 1, - "min_value": 0.0, - "max_index": 255, - "max_value": 2.0, - "name": "heating", - "nodata_index": 0, - "units": "" - }, - "path": "maps/water_risk/wri/v2/water_stress_{scenario}_{year}_map", - "bounds": [ - [ - -180.0, - 85.0 - ], - [ - 180.0, - 85.0 - ], - [ - 180.0, - -85.0 - ], - [ - -180.0, - -85.0 - ] - ], - "index_values": null, - "source": "map_array_pyramid" - }, - "scenarios": [ - { - "id": "historical", - "years": [ - 1999 - ] - }, - { - "id": "ssp126", - "years": [ - 2030, - 2050, - 2080 - ] - }, - { - "id": "ssp370", - "years": [ - 2030, - 2050, - 2080 - ] - }, - { - "id": "ssp585", - "years": [ - 2030, - 2050, - 2080 - ] - } - ], - "units": "" - }, - { - "hazard_type": "WaterRisk", - "group_id": "", - "path": "water_risk/wri/v2/water_depletion_{scenario}_{year}", - "indicator_id": "water_depletion", - "indicator_model_id": null, - "indicator_model_gcm": "combined", - "params": {}, - "display_name": "Water depletion (Aqueduct 4.0)", - "display_groups": [ - "Water depletion (Aqueduct 4.0)" - ], - "description": "The World Resources Institute (WRI) [Aqueduct 4.0](https://www.wri.org/data/aqueduct-global-maps-40-data) is the latest iteration of [WRI\u2019s water risk framework](https://www.wri.org/data/aqueduct-water-risk-atlas) designed to translate complex \nhydrological data into intuitive indicators of water-related risk:\n\n* **Water demand**: gross demand is the maximum potential water required to meet sectoral demands. Sectoral water demand includes: domestic, industrial, irrigation, and livestock. Demand is displayed as a flux (centimeters/year).\n\n* **Water supply**: available blue water, the total amount of renewable freshwater available to a sub-basin with upstream consumption removed, includes surface flow, interflow, and groundwater recharge. Available blue water is displayed as a flux (centimeters/year).\n\n* **Water stress**: an indicator of competition for water resources defined informally as the ratio of demand for water by human society divided by available water. It can be classified into six categories: -1: Arid and low water use, 0: Low (<10%), 1: Low-medium (10-20%), 2: Medium-high (20-40%), 3: High (40-80%), 4: Extremely high (>80%).\n\n* **Water depletion**: the ratio of total water consumption to available renewable water supplies. Total water consumption includes domestic, industrial, irrigation, and livestock consumptive uses. Available renewable water supplies include the impact of upstream consumptive water users and large dams on downstream water availability. Higher values indicate larger impact on the local water supply and decreased water availability for downstream users. Water depletion is similar to water stress; however, instead of looking at total water demand, water depletion is calculated using consumptive withdrawal only. It can be classified into six categories: -1: Arid and low water use, 0 : Low (<5%), 1: Low-medium (5-25%), 2 : Medium-high (25-50%), 3: High (50-75%), 4 : Extremely high (>75%).\n\n[Aqueduct 4.0 FAQ](https://github.com/wri/Aqueduct40/blob/master/data_FAQ.md) explains why the water supply and demand values are measured as fluxes instead of volumes. Volumes (cubic meters) can vary significantly based on the size of each sub-basin, potentially misleading as they might primarily reflect a larger geographical area rather than indicating a higher rate of water flow. On the other hand, fluxes (centimeters/year), which measure the rate of water flow, offer a more direct and equitable means of comparing water availability between different sub-basins. Volume = Flux x Area.\n\nThe spatial resolution is 5 \u00d7 5 arc minutes which equates roughly to 10 kilometer (km) \u00d7 10 km pixels. \nThe future projections were created using CMIP6 climate forcings based on three future scenarios: optimistic (ssp126), business-as-usual (ssp370), and pessimistic (ssp585) available at [HYPFLOWSCI6](https://public.yoda.uu.nl/geo/UU01/YM7A5H.html). WRI's original data are presented at the HydroBASINS Level 6 scale. Indicators are available for periods: 'historical' (averaged over 1979-2019), 2030 (2015-2045), 2050 (2035-2065) and 2080 (2065-2095).", - "map": { - "colormap": { - "min_index": 1, - "min_value": 0.0, - "max_index": 255, - "max_value": 2.0, - "name": "heating", - "nodata_index": 0, - "units": "" - }, - "path": "maps/water_risk/wri/v2/water_depletion_{scenario}_{year}_map", - "bounds": [ - [ - -180.0, - 85.0 - ], - [ - 180.0, - 85.0 - ], - [ - 180.0, - -85.0 - ], - [ - -180.0, - -85.0 - ] - ], - "index_values": null, - "source": "map_array_pyramid" - }, - "scenarios": [ - { - "id": "historical", - "years": [ - 1999 - ] - }, - { - "id": "ssp126", - "years": [ - 2030, - 2050, - 2080 - ] - }, - { - "id": "ssp370", - "years": [ - 2030, - 2050, - 2080 - ] - }, - { - "id": "ssp585", - "years": [ - 2030, - 2050, - 2080 - ] - } - ], - "units": "" - }, - { - "hazard_type": "WaterRisk", - "group_id": "", - "path": "water_risk/wri/v2/water_stress_category_{scenario}_{year}", - "indicator_id": "water_stress_category", - "indicator_model_id": null, - "indicator_model_gcm": "combined", - "params": {}, - "display_name": "Water stress category (Aqueduct 4.0)", - "display_groups": [ - "Water stress category (Aqueduct 4.0)" - ], - "description": "The World Resources Institute (WRI) [Aqueduct 4.0](https://www.wri.org/data/aqueduct-global-maps-40-data) is the latest iteration of [WRI\u2019s water risk framework](https://www.wri.org/data/aqueduct-water-risk-atlas) designed to translate complex \nhydrological data into intuitive indicators of water-related risk:\n\n* **Water demand**: gross demand is the maximum potential water required to meet sectoral demands. Sectoral water demand includes: domestic, industrial, irrigation, and livestock. Demand is displayed as a flux (centimeters/year).\n\n* **Water supply**: available blue water, the total amount of renewable freshwater available to a sub-basin with upstream consumption removed, includes surface flow, interflow, and groundwater recharge. Available blue water is displayed as a flux (centimeters/year).\n\n* **Water stress**: an indicator of competition for water resources defined informally as the ratio of demand for water by human society divided by available water. It can be classified into six categories: -1: Arid and low water use, 0: Low (<10%), 1: Low-medium (10-20%), 2: Medium-high (20-40%), 3: High (40-80%), 4: Extremely high (>80%).\n\n* **Water depletion**: the ratio of total water consumption to available renewable water supplies. Total water consumption includes domestic, industrial, irrigation, and livestock consumptive uses. Available renewable water supplies include the impact of upstream consumptive water users and large dams on downstream water availability. Higher values indicate larger impact on the local water supply and decreased water availability for downstream users. Water depletion is similar to water stress; however, instead of looking at total water demand, water depletion is calculated using consumptive withdrawal only. It can be classified into six categories: -1: Arid and low water use, 0 : Low (<5%), 1: Low-medium (5-25%), 2 : Medium-high (25-50%), 3: High (50-75%), 4 : Extremely high (>75%).\n\n[Aqueduct 4.0 FAQ](https://github.com/wri/Aqueduct40/blob/master/data_FAQ.md) explains why the water supply and demand values are measured as fluxes instead of volumes. Volumes (cubic meters) can vary significantly based on the size of each sub-basin, potentially misleading as they might primarily reflect a larger geographical area rather than indicating a higher rate of water flow. On the other hand, fluxes (centimeters/year), which measure the rate of water flow, offer a more direct and equitable means of comparing water availability between different sub-basins. Volume = Flux x Area.\n\nThe spatial resolution is 5 \u00d7 5 arc minutes which equates roughly to 10 kilometer (km) \u00d7 10 km pixels. \nThe future projections were created using CMIP6 climate forcings based on three future scenarios: optimistic (ssp126), business-as-usual (ssp370), and pessimistic (ssp585) available at [HYPFLOWSCI6](https://public.yoda.uu.nl/geo/UU01/YM7A5H.html). WRI's original data are presented at the HydroBASINS Level 6 scale. Indicators are available for periods: 'historical' (averaged over 1979-2019), 2030 (2015-2045), 2050 (2035-2065) and 2080 (2065-2095).", - "map": { - "colormap": { - "min_index": 1, - "min_value": -5.0, - "max_index": 255, - "max_value": 5.0, - "name": "heating", - "nodata_index": 0, - "units": "" - }, - "path": "maps/water_risk/wri/v2/water_stress_category_{scenario}_{year}_map", - "bounds": [ - [ - -180.0, - 85.0 - ], - [ - 180.0, - 85.0 - ], - [ - 180.0, - -85.0 - ], - [ - -180.0, - -85.0 - ] - ], - "index_values": null, - "source": "map_array_pyramid" - }, - "scenarios": [ - { - "id": "historical", - "years": [ - 1999 - ] - }, - { - "id": "ssp126", - "years": [ - 2030, - 2050, - 2080 - ] - }, - { - "id": "ssp370", - "years": [ - 2030, - 2050, - 2080 - ] - }, - { - "id": "ssp585", - "years": [ - 2030, - 2050, - 2080 - ] - } - ], - "units": "" - }, - { - "hazard_type": "WaterRisk", - "group_id": "", - "path": "water_risk/wri/v2/water_depletion_category_{scenario}_{year}", - "indicator_id": "water_depletion_category", - "indicator_model_id": null, - "indicator_model_gcm": "combined", - "params": {}, - "display_name": "Water depletion category (Aqueduct 4.0)", - "display_groups": [ - "Water depletion category (Aqueduct 4.0)" - ], - "description": "The World Resources Institute (WRI) [Aqueduct 4.0](https://www.wri.org/data/aqueduct-global-maps-40-data) is the latest iteration of [WRI\u2019s water risk framework](https://www.wri.org/data/aqueduct-water-risk-atlas) designed to translate complex \nhydrological data into intuitive indicators of water-related risk:\n\n* **Water demand**: gross demand is the maximum potential water required to meet sectoral demands. Sectoral water demand includes: domestic, industrial, irrigation, and livestock. Demand is displayed as a flux (centimeters/year).\n\n* **Water supply**: available blue water, the total amount of renewable freshwater available to a sub-basin with upstream consumption removed, includes surface flow, interflow, and groundwater recharge. Available blue water is displayed as a flux (centimeters/year).\n\n* **Water stress**: an indicator of competition for water resources defined informally as the ratio of demand for water by human society divided by available water. It can be classified into six categories: -1: Arid and low water use, 0: Low (<10%), 1: Low-medium (10-20%), 2: Medium-high (20-40%), 3: High (40-80%), 4: Extremely high (>80%).\n\n* **Water depletion**: the ratio of total water consumption to available renewable water supplies. Total water consumption includes domestic, industrial, irrigation, and livestock consumptive uses. Available renewable water supplies include the impact of upstream consumptive water users and large dams on downstream water availability. Higher values indicate larger impact on the local water supply and decreased water availability for downstream users. Water depletion is similar to water stress; however, instead of looking at total water demand, water depletion is calculated using consumptive withdrawal only. It can be classified into six categories: -1: Arid and low water use, 0 : Low (<5%), 1: Low-medium (5-25%), 2 : Medium-high (25-50%), 3: High (50-75%), 4 : Extremely high (>75%).\n\n[Aqueduct 4.0 FAQ](https://github.com/wri/Aqueduct40/blob/master/data_FAQ.md) explains why the water supply and demand values are measured as fluxes instead of volumes. Volumes (cubic meters) can vary significantly based on the size of each sub-basin, potentially misleading as they might primarily reflect a larger geographical area rather than indicating a higher rate of water flow. On the other hand, fluxes (centimeters/year), which measure the rate of water flow, offer a more direct and equitable means of comparing water availability between different sub-basins. Volume = Flux x Area.\n\nThe spatial resolution is 5 \u00d7 5 arc minutes which equates roughly to 10 kilometer (km) \u00d7 10 km pixels. \nThe future projections were created using CMIP6 climate forcings based on three future scenarios: optimistic (ssp126), business-as-usual (ssp370), and pessimistic (ssp585) available at [HYPFLOWSCI6](https://public.yoda.uu.nl/geo/UU01/YM7A5H.html). WRI's original data are presented at the HydroBASINS Level 6 scale. Indicators are available for periods: 'historical' (averaged over 1979-2019), 2030 (2015-2045), 2050 (2035-2065) and 2080 (2065-2095).", - "map": { - "colormap": { - "min_index": 1, - "min_value": -5.0, - "max_index": 255, - "max_value": 5.0, - "name": "heating", - "nodata_index": 0, - "units": "" - }, - "path": "maps/water_risk/wri/v2/water_depletion_category_{scenario}_{year}_map", - "bounds": [ - [ - -180.0, - 85.0 - ], - [ - 180.0, - 85.0 - ], - [ - 180.0, - -85.0 - ], - [ - -180.0, - -85.0 - ] - ], - "index_values": null, - "source": "map_array_pyramid" - }, - "scenarios": [ - { - "id": "historical", - "years": [ - 1999 - ] - }, - { - "id": "ssp126", - "years": [ - 2030, - 2050, - 2080 - ] - }, - { - "id": "ssp370", - "years": [ - 2030, - 2050, - 2080 - ] - }, - { - "id": "ssp585", - "years": [ - 2030, - 2050, - 2080 - ] - } - ], - "units": "" - }, - { - "hazard_type": "Drought", - "group_id": "", - "path": "drought/osc/v1/months_spei12m_below_index_{gcm}_{scenario}_{year}", - "indicator_id": "months/spei12m/below/index", - "indicator_model_id": null, - "indicator_model_gcm": "{gcm}", - "params": { - "gcm": [ - "MIROC6" - ] - }, - "display_name": "Drought SPEI index", - "display_groups": [ - "Drought SPEI index" - ], - "description": "", - "map": { - "colormap": { - "min_index": 1, - "min_value": 0.0, - "max_index": 255, - "max_value": 12.0, - "name": "heating", - "nodata_index": 0, - "units": "months/year" - }, - "path": "drought/osc/v1/months_spei12m_below_index_{gcm}_{scenario}_{year}_map", - "bounds": [ - [ - -180.0, - 85.0 - ], - [ - 180.0, - 85.0 - ], - [ - 180.0, - -60.0 - ], - [ - -180.0, - -60.0 - ] - ], - "index_values": [ - 0, - -1, - -1.5, - -2, - -2.5, - -3, - -3.6 - ], - "source": "map_array_pyramid" - }, - "scenarios": [ - { - "id": "ssp585", - "years": [ - 2005, - 2030, - 2040, - 2050, - 2080 - ] - } - ], - "units": "months/year" - } - ] -} \ No newline at end of file diff --git a/notebooks/launcher.ipynb b/notebooks/launcher.ipynb index 0205aca..6d654e7 100644 --- a/notebooks/launcher.ipynb +++ b/notebooks/launcher.ipynb @@ -45,10 +45,10 @@ "metadata": {}, "outputs": [], "source": [ - "import os, sys\n", + "import os, sys # noqa: E402\n", "\n", "sys.path.append(\"../src\")\n", - "import hazard.utilities.zarr_utilities as zarr_utilities\n", + "import hazard.utilities.zarr_utilities as zarr_utilities # noqa: E402\n", "\n", "os.environ[\"CREDENTIAL_DOTENV_DIR\"] = os.path.dirname(os.getcwd())\n", "zarr_utilities.set_credential_env_variables()" @@ -68,12 +68,12 @@ "metadata": {}, "outputs": [], "source": [ - "from dask.distributed import Client, LocalCluster\n", - "import logging\n", - "from hazard.docs_store import DocStore # type: ignore\n", - "from hazard.models.days_tas_above import DaysTasAboveIndicator\n", - "from hazard.sources.nex_gddp_cmip6 import NexGddpCmip6\n", - "from hazard.sources.osc_zarr import OscZarr\n", + "from dask.distributed import Client, LocalCluster # noqa: E402\n", + "import logging # noqa: E402\n", + "from hazard.docs_store import DocStore # type: ignore # noqa: E402\n", + "from hazard.models.days_tas_above import DaysTasAboveIndicator # noqa: E402\n", + "from hazard.sources.nex_gddp_cmip6 import NexGddpCmip6 # noqa: E402\n", + "from hazard.sources.osc_zarr import OscZarr # noqa: E402\n", "\n", "logging.basicConfig(\n", " level=logging.INFO,\n", @@ -93,9 +93,7 @@ "scenario = \"ssp585\"\n", "year = 2030\n", "source = NexGddpCmip6()\n", - "target = OscZarr(\n", - " prefix=\"hazard_test\"\n", - ") # test prefix is \"hazard_test\"; main one \"hazard\"\n", + "target = OscZarr(prefix=\"hazard_test\") # test prefix is \"hazard_test\"; main one \"hazard\"\n", "\n", "# as an alternative, we can create a local target:\n", "# test_output_dir = os.path.join(os.getcwd(), \"src/test/test_output\")\n", @@ -156,8 +154,8 @@ } ], "source": [ - "from hazard.sources.osc_zarr import OscZarr\n", - "import os, os.path\n", + "from hazard.sources.osc_zarr import OscZarr # noqa: E402\n", + "import os, os.path # noqa: E402\n", "\n", "target = OscZarr(prefix=\"hazard_test\")\n", "da = target.read(\"chronic_heat/osc/v2/days_tas_above_15c_NorESM2-MM_ssp585_2030\")\n", @@ -183,7 +181,7 @@ "metadata": {}, "outputs": [], "source": [ - "import s3fs\n", + "import s3fs # noqa: E402\n", "\n", "s3 = s3fs.S3FileSystem(\n", " anon=False,\n", @@ -212,7 +210,7 @@ "metadata": {}, "outputs": [], "source": [ - "import boto3\n", + "import boto3 # noqa: E402\n", "\n", "bucket_name = os.environ[\"OSC_S3_BUCKET\"]\n", "prefix = \"hazard_test/hazard.zarr/chronic_heat/osc/v2\"\n", @@ -254,9 +252,7 @@ " copy_source = {\"Bucket\": bucket_name, \"Key\": key}\n", " target_key = key.replace(\"hazard_test/hazard.zarr\", \"hazard/hazard.zarr\")\n", " print(f\"{key} to {target_key} for bucket {bucket_name}\")\n", - " s3_client.copy_object(\n", - " CopySource=copy_source, Bucket=target_bucket_name, Key=target_key\n", - " )" + " s3_client.copy_object(CopySource=copy_source, Bucket=target_bucket_name, Key=target_key)" ] } ], diff --git a/notebooks/onboarding/onboard_ESP_GOV_flood.ipynb b/notebooks/onboarding/onboard_ESP_GOV_flood.ipynb deleted file mode 100644 index c749209..0000000 --- a/notebooks/onboarding/onboard_ESP_GOV_flood.ipynb +++ /dev/null @@ -1,561 +0,0 @@ -{ - "cells": [ - { - "attachments": {}, - "cell_type": "markdown", - "id": "0537cf79", - "metadata": {}, - "source": [ - "## OS-C ECB Stress Test 2022 Issue\n", - "\n", - "[Investigate replication of ECB stress test methodology 2022](https://github.com/os-climate/physrisk/issues/126)" - ] - }, - { - "attachments": {}, - "cell_type": "markdown", - "id": "5d09fa53", - "metadata": { - "jupyter": { - "source_hidden": true - } - }, - "source": [ - "## Spanish flood data onboarding to S3\n", - "\n", - "The data is 1m resolution and for 10 year return period the file weight is 1000Gb (1Tb). Given that the resolution is extremely high we can downsize it to 100m. [Data source link](http://centrodedescargas.cnig.es/CentroDescargas/index.jsp#)\n", - "\n", - "On the other hand, the data is provided chunked by the Spanish gov and some pre-computing must be done to upload it to an unique raster file in s3. First of all, the raster shape and affine transformation for the s3 raster file must be guessed. Secondly, every file in spanish gov must be read in 100x100 window and inserted in the new raster file.\n", - "\n", - "From map provided by spanish gov we can discover shape and affine transformation of raster file.\n", - "\n", - "Coordinate system used is: [EPSG 25830](https://epsg.org/crs_25830/ETRS89-UTM-zone-30N.html?sessionkey=cedqtluqe0)\n", - "\n", - "left up corner: (-110000, 4914036) \n", - "right up corner: (1095561, 4914036) \n", - "left down corner: (-110000, 3900000) \n", - "right down corner: (1095561, 3900000) \n", - "\n", - "the range is approximate and can be narrowed\n", - "\n", - "width: 1095561 + 110000 = 1205561 \n", - "height: 4914036 - 3900000 = 1014036\n", - "\n", - "Affine transformation adding vector:= (-110000, 3900000): = left down corner.\n", - "\n", - "Canary Islands to be treated as a separated raster file." - ] - }, - { - "attachments": {}, - "cell_type": "markdown", - "id": "8f1bc2a8", - "metadata": {}, - "source": [ - "To guess the bound exactly instead of approximate we can use the Spanish bounds lat-lon coordinates for the peninsula and transform them to EPSG 25830. Then repeat for Canary Islands." - ] - }, - { - "attachments": {}, - "cell_type": "markdown", - "id": "f9e3d9d0", - "metadata": {}, - "source": [ - "## Create Zarr from shape and Affine transformation\n", - "\n", - "Note: the file must be located in /hazard/src/ for the dependencies to work" - ] - }, - { - "cell_type": "code", - "execution_count": 5, - "id": "c4e42591", - "metadata": {}, - "outputs": [], - "source": [ - "import sys\n", - "import os\n", - "import s3fs\n", - "import zarr\n", - "import numpy as np\n", - "import rasterio\n", - "import math\n", - "import xarray as xr\n", - "\n", - "from pyproj.crs import CRS\n", - "from affine import Affine" - ] - }, - { - "cell_type": "code", - "execution_count": 6, - "id": "0abc8b8f", - "metadata": {}, - "outputs": [], - "source": [ - "from hazard.sources.osc_zarr import OscZarr" - ] - }, - { - "cell_type": "code", - "execution_count": 7, - "id": "9ac9bc09", - "metadata": {}, - "outputs": [], - "source": [ - "# https://console-openshift-console.apps.odh-cl1.apps.os-climate.org/k8s/ns/sandbox/secrets/physrisk-s3-keys\n", - "default_staging_bucket = \"redhat-osc-physical-landing-647521352890\"\n", - "# OSC_S3_ACCESS_KEY, OSC_S3_SECRET_KEY\n", - "\n", - "# Hazard indicators bucket\n", - "# default_staging_bucket = 'physrisk-hazard-indicators'\n", - "prefix = \"hazard\"\n", - "\n", - "# Acess key and secret key are stored as env vars OSC_S3_HI_ACCESS_KEY and OSC_S3_HI_SECRET_KEY, resp.\n", - "s3 = s3fs.S3FileSystem(\n", - " anon=False,\n", - " key=os.environ[\"OSC_S3_ACCESS_KEY\"],\n", - " secret=os.environ[\"OSC_S3_SECRET_KEY\"],\n", - ")" - ] - }, - { - "cell_type": "code", - "execution_count": 19, - "id": "bff5b25d", - "metadata": {}, - "outputs": [], - "source": [ - "group_path = os.path.join(\n", - " default_staging_bucket, prefix, \"hazard_MV_prueba2.zarr\"\n", - ").replace(\"\\\\\", \"/\")\n", - "store = s3fs.S3Map(root=group_path, s3=s3, check=False)\n", - "root = zarr.group(store=store, overwrite=True)" - ] - }, - { - "cell_type": "code", - "execution_count": 4, - "id": "9839520d", - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "['redhat-osc-physical-landing-647521352890/hazard/hazard.zarr',\n", - " 'redhat-osc-physical-landing-647521352890/hazard/inventory.json',\n", - " 'redhat-osc-physical-landing-647521352890/hazard/wri']" - ] - }, - "execution_count": 4, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "s3.ls(\"redhat-osc-physical-landing-647521352890/hazard\")" - ] - }, - { - "cell_type": "code", - "execution_count": 41, - "id": "ac55a02e", - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "['redhat-osc-physical-landing-647521352890/hazard/hazard_MV_prueba2.zarr/.zgroup']" - ] - }, - "execution_count": 41, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "s3.ls(\"redhat-osc-physical-landing-647521352890/hazard/hazard_MV_prueba.zarr\")" - ] - }, - { - "cell_type": "code", - "execution_count": 31, - "id": "7cad50aa", - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "True" - ] - }, - "execution_count": 31, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "# Check the zarr file was created\n", - "group_path in s3.ls(\"redhat-osc-physical-landing-647521352890/hazard\")" - ] - }, - { - "cell_type": "code", - "execution_count": 6, - "id": "09781e94", - "metadata": {}, - "outputs": [], - "source": [ - "oscZ = OscZarr(bucket=default_staging_bucket, prefix=\"hazard\", s3=s3, store=store)" - ] - }, - { - "cell_type": "code", - "execution_count": 7, - "id": "17d36f0f", - "metadata": {}, - "outputs": [], - "source": [ - "# width: 1205561\n", - "# height: 1014036\n", - "\n", - "# adding vector:= (-110000, 3900000): = left down corner.\n", - "\n", - "meters_resolution = 100\n", - "x_adding = -110000\n", - "y_adding = 3900000\n", - "transform = Affine(meters_resolution, 0, 0, meters_resolution, x_adding, y_adding)\n", - "crs = CRS.from_epsg(25830)\n", - "width = math.ceil(1205561 / meters_resolution)\n", - "height = math.ceil(1014036 / meters_resolution)\n", - "shape = (width, height)\n", - "return_periods = [10]" - ] - }, - { - "cell_type": "code", - "execution_count": 8, - "id": "f439e73e", - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "" - ] - }, - "execution_count": 8, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "oscZ._zarr_create(\n", - " path=group_path,\n", - " shape=shape,\n", - " transform=transform,\n", - " crs=str(crs),\n", - " overwrite=True,\n", - " return_periods=return_periods,\n", - ")" - ] - }, - { - "cell_type": "code", - "execution_count": 42, - "id": "ea1a02aa", - "metadata": {}, - "outputs": [], - "source": [ - "# Create xr.DataArray from s3 stored zarr object\n", - "z = oscZ.root[group_path]\n", - "da = xr.DataArray(data=z)" - ] - }, - { - "cell_type": "code", - "execution_count": 11, - "id": "10222091", - "metadata": {}, - "outputs": [], - "source": [ - "# Read the file\n", - "# da = oscZ.read(path=group_path)\n", - "# da\n", - "\n", - "# Return RuntimeError because of coords when creating Datarray" - ] - }, - { - "attachments": {}, - "cell_type": "markdown", - "id": "df124dca", - "metadata": {}, - "source": [ - "## Steps to populate hazard_MV_prueba.zarr for 1m resolution\n", - "\n", - "### Step 1: Read ESP Government flood data\n", - "\n", - "Returns flood depth array, x and y coordinates array in 25830 EPSG" - ] - }, - { - "cell_type": "code", - "execution_count": 12, - "id": "87a8f27e", - "metadata": {}, - "outputs": [], - "source": [ - "def read_one_file(path_to_file):\n", - " \"\"\"\n", - " Read spanish gov data.\n", - "\n", - " Parameters:\n", - " path_to_file (str): full path to tif file.\n", - "\n", - " Returns:\n", - " fld_depth (numpy array): flood depth at (x1, y1) 25830 EPSG coordinates\n", - " x1 (numpy array)\n", - "\n", - " \"\"\"\n", - "\n", - " src = rasterio.open(path_to_file)\n", - " fld_depth = src.read()\n", - "\n", - " cols, rows = np.meshgrid(np.arange(src.width), np.arange(src.height))\n", - " x1, y1 = rasterio.transform.xy(src.transform, rows, cols)\n", - "\n", - " return fld_depth.flatten(), np.array(x1).flatten(), np.array(y1).flatten()" - ] - }, - { - "cell_type": "code", - "execution_count": 13, - "id": "ae654d8f", - "metadata": {}, - "outputs": [], - "source": [ - "path_to_file = r\"C:\\Users\\mvazquez\\Afirma Spain Dropbox\\Manuel Vazquez Gandullo\\Climate Risk\\Jupyter_Notebooks\\esp_gov_flood_data\\ESNZSNCZIMPFT010E77.tif\"\n", - "fld_depth, x1, y1 = read_one_file(path_to_file)" - ] - }, - { - "attachments": {}, - "cell_type": "markdown", - "id": "bf8fa338", - "metadata": {}, - "source": [ - "### Step 2: Use Affine inverse to translate (x1, x2) to store (x, y)\n", - "\n", - "Since the Affine transformation matrix is the meter_resolution * identy we just subtract the adding vector and divide by the meter_resolution.\n", - "\n", - "Finally, we have to choose the points nearest to the integer." - ] - }, - { - "cell_type": "code", - "execution_count": 14, - "id": "5ce1f7df", - "metadata": {}, - "outputs": [], - "source": [ - "x = (x1 - x_adding) / meters_resolution\n", - "y = (y1 - y_adding) / meters_resolution\n", - "\n", - "# Find closest x-axis coordinate\n", - "x_ = x - x.astype(int)\n", - "x_ = x_ == x_.min()\n", - "\n", - "# Find closest y-axis coordinate\n", - "y_ = y - y.astype(int)\n", - "y_ = y_ == y_.min()\n", - "\n", - "# Find common x-axis and y-axis coordinates\n", - "index_ = np.logical_and(x_, y_)\n", - "\n", - "# Filter by index\n", - "x_coord = x[index_].astype(int)\n", - "y_coord = y[index_].astype(int)" - ] - }, - { - "attachments": {}, - "cell_type": "markdown", - "id": "0d49d749", - "metadata": {}, - "source": [ - "### Step 3: Populate the raster file" - ] - }, - { - "cell_type": "code", - "execution_count": 26, - "id": "ac169636", - "metadata": {}, - "outputs": [], - "source": [ - "da.data[x_coord, y_coord] = fld_depth[index_]" - ] - }, - { - "cell_type": "code", - "execution_count": 27, - "id": "dcfc0ab0", - "metadata": {}, - "outputs": [], - "source": [ - "oscZ.write(path=group_path, da=da)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "a6043456", - "metadata": {}, - "outputs": [], - "source": [ - "# Example using root object. Better to use oscZ object\n", - "\n", - "\"\"\"\n", - "create_dataset(name, **kwargs) method of zarr.hierarchy.Group instance\n", - " Create an array.\n", - " \n", - " Arrays are known as \"datasets\" in HDF5 terminology. For compatibility\n", - " with h5py, Zarr groups also implement the require_dataset() method.\n", - " \n", - " Parameters\n", - " ----------\n", - " name : string\n", - " Array name.\n", - " data : array-like, optional\n", - " Initial data.\n", - " shape : int or tuple of ints\n", - " Array shape.\n", - " chunks : int or tuple of ints, optional\n", - " Chunk shape. If not provided, will be guessed from `shape` and\n", - " `dtype`.\n", - " dtype : string or dtype, optional\n", - " NumPy dtype.\n", - " compressor : Codec, optional\n", - " Primary compressor.\n", - " fill_value : object\n", - " Default value to use for uninitialized portions of the array.\n", - "\n", - "\n", - "\n", - "root.create_dataset(name='prueba',\n", - " data = np.array([[0,1], [1,6]]),\n", - " shape = (2,2),\n", - " chunks = (1000, 1000),\n", - " dtype = 'f4')\n", - "\n", - "trans_members = [\n", - " transform.a,\n", - " transform.b,\n", - " transform.c,\n", - " transform.d,\n", - " transform.e,\n", - " transform.f,\n", - "]\n", - "mat3x3 = [x * 1.0 for x in trans_members] + [0.0, 0.0, 1.0] # Why adding this ??\n", - "root.attrs[\"crs\"] = str(crs)\n", - "root.attrs[\"transform_mat3x3\"] = mat3x3 \n", - "if return_periods is not None:\n", - " root.attrs[\"index_values\"] = return_periods\n", - " root.attrs[\"index_name\"] = \"return period (years)\"\n", - "\n", - "# Read the file\n", - "root['prueba']\n", - "\"\"\"" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "08c4eac2", - "metadata": {}, - "outputs": [], - "source": [ - "# Code to remove a file inside a bucket\n", - "\n", - "\"\"\"\"\n", - "import boto3\n", - "boto_c = boto3.client('s3', aws_access_key_id=os.environ[\"OSC_S3_ACCESS_KEY\"], aws_secret_access_key=os.environ[\"OSC_S3_SECRET_KEY\"])\n", - "\n", - "to_remove = boto_c.list_objects_v2(Bucket=default_staging_bucket, Prefix='hazard/hazard_MV_prueba.zarr')['Contents']\n", - "\n", - "keys = [item['Key'] for item in to_remove]\n", - "\n", - "for key_ in keys:\n", - " boto_c.delete_object(Bucket=default_staging_bucket, Key=key_)\n", - "\"\"\"" - ] - }, - { - "cell_type": "code", - "execution_count": 21, - "id": "79230074", - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "['redhat-osc-physical-landing-647521352890/hazard/hazard.zarr/chronic_heat/osc/v1/mean_degree_days_above_18c_historical_1980/.zarray',\n", - " 'redhat-osc-physical-landing-647521352890/hazard/hazard.zarr/chronic_heat/osc/v1/mean_degree_days_above_18c_historical_1980/.zattrs',\n", - " 'redhat-osc-physical-landing-647521352890/hazard/hazard.zarr/chronic_heat/osc/v1/mean_degree_days_above_18c_historical_1980/0.0.0']" - ] - }, - "execution_count": 21, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "s3.ls(\n", - " \"redhat-osc-physical-landing-647521352890/hazard/hazard.zarr/chronic_heat/osc/v1/mean_degree_days_above_18c_historical_1980\"\n", - ")" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "'redhat-osc-physical-landing-647521352890/redhat-osc-physicalrisk-upload'\n", - " 'redhat-osc-physical-landing-647521352890/demo_test-0518145310',\n", - " 'redhat-osc-physical-landing-647521352890/demo_test-0518191846',\n", - " 'redhat-osc-physical-landing-647521352890/demo_test-0518201258'," - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "22b271b9", - "metadata": {}, - "outputs": [], - "source": [] - } - ], - "metadata": { - "kernelspec": { - "display_name": "Python 3 (ipykernel)", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.8.12" - } - }, - "nbformat": 4, - "nbformat_minor": 5 -} diff --git a/notebooks/onboarding/onboard_JRC_flood.ipynb b/notebooks/onboarding/onboard_JRC_flood.ipynb deleted file mode 100644 index 10e8edd..0000000 --- a/notebooks/onboarding/onboard_JRC_flood.ipynb +++ /dev/null @@ -1,426 +0,0 @@ -{ - "cells": [ - { - "attachments": {}, - "cell_type": "markdown", - "id": "1a758a2e", - "metadata": {}, - "source": [ - "## Onboard Joint Research Center (JRC) data to OS-C S3\n", - "\n", - "The data is flood depth historical return period data and can be found at [JRC data catalog](https://data.jrc.ec.europa.eu/dataset/1d128b6c-a4ee-4858-9e34-6210707f3c81). The methodology is detailed at [\"A new dataset of river flood hazard maps for Europe and the Mediterranean Basin\" by Francesco Dottori, Lorenzo Alfieri, Alessandra Bianchi, Jon Skoien, and Peter Salamon](https://essd.copernicus.org/articles/14/1549/2022/).\n", - "\n", - "The provide six different return periods: 10, 20, 50, 100, 200 and 500 years.\n", - "\n", - "The coordinates system of the map is EPSG:3035 (ETRS89-extended / LAEA Europe) and needs to be translated to Latitud-Longitud coordinate system. See EPSG official website for more information. " - ] - }, - { - "attachments": {}, - "cell_type": "markdown", - "id": "8f1bc2a8", - "metadata": {}, - "source": [ - "To guess the bound exactly instead of approximate we can use the Spanish bounds lat-lon coordinates for the peninsula and transform them to EPSG 25830. Then repeat for Canary Islands." - ] - }, - { - "attachments": {}, - "cell_type": "markdown", - "id": "f9e3d9d0", - "metadata": {}, - "source": [ - "## Create Zarr from shape and Affine transformation\n", - "\n", - "Note: the file must be located in /hazard/src/ for the dependencies to work" - ] - }, - { - "cell_type": "code", - "execution_count": 1, - "id": "c4e42591", - "metadata": {}, - "outputs": [ - { - "name": "stderr", - "output_type": "stream", - "text": [ - "c:\\ProgramData\\Anaconda3\\lib\\site-packages\\xarray\\backends\\cfgrib_.py:27: UserWarning: Failed to load cfgrib - most likely there is a problem accessing the ecCodes library. Try `import cfgrib` to get the full error message\n", - " warnings.warn(\n" - ] - } - ], - "source": [ - "import sys\n", - "import os\n", - "import s3fs\n", - "import zarr\n", - "import numpy as np\n", - "import rasterio\n", - "import math\n", - "import xarray as xr\n", - "\n", - "from pyproj.crs import CRS\n", - "from affine import Affine" - ] - }, - { - "cell_type": "code", - "execution_count": 2, - "id": "0abc8b8f", - "metadata": {}, - "outputs": [], - "source": [ - "from hazard.sources.osc_zarr import OscZarr" - ] - }, - { - "cell_type": "code", - "execution_count": 3, - "id": "9ac9bc09", - "metadata": {}, - "outputs": [], - "source": [ - "# https://console-openshift-console.apps.odh-cl1.apps.os-climate.org/k8s/ns/sandbox/secrets/physrisk-s3-keys\n", - "# default_staging_bucket = 'redhat-osc-physical-landing-647521352890'\n", - "# OSC_S3_ACCESS_KEY, OSC_S3_SECRET_KEY\n", - "\n", - "# Hazard indicators bucket\n", - "default_staging_bucket = \"physrisk-hazard-indicators\"\n", - "prefix = \"hazard\"\n", - "\n", - "# Acess key and secret key are stored as env vars OSC_S3_HI_ACCESS_KEY and OSC_S3_HI_SECRET_KEY, resp.\n", - "s3 = s3fs.S3FileSystem(\n", - " anon=False,\n", - " key=os.environ[\"OSC_S3_HI_ACCESS_KEY\"],\n", - " secret=os.environ[\"OSC_S3_HI_SECRET_KEY\"],\n", - ")" - ] - }, - { - "cell_type": "code", - "execution_count": 22, - "id": "bff5b25d", - "metadata": {}, - "outputs": [], - "source": [ - "group_path = os.path.join(\n", - " default_staging_bucket, prefix, \"riverflood_JRC_RP_hist.zarr\"\n", - ").replace(\"\\\\\", \"/\")\n", - "store = s3fs.S3Map(root=group_path, s3=s3, check=False)\n", - "root = zarr.group(store=store, overwrite=True)" - ] - }, - { - "cell_type": "code", - "execution_count": 23, - "id": "9839520d", - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "['physrisk-hazard-indicators/hazard/riverflood_JRC_RP010_hist.zarr',\n", - " 'physrisk-hazard-indicators/hazard/riverflood_JRC_RP_hist.zarr']" - ] - }, - "execution_count": 23, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "s3.ls(\"physrisk-hazard-indicators/hazard\")" - ] - }, - { - "cell_type": "code", - "execution_count": 24, - "id": "7cad50aa", - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "True" - ] - }, - "execution_count": 24, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "# Check the zarr file was created\n", - "group_path in s3.ls(\"physrisk-hazard-indicators/hazard\")" - ] - }, - { - "cell_type": "code", - "execution_count": 25, - "id": "09781e94", - "metadata": {}, - "outputs": [], - "source": [ - "oscZ = OscZarr(bucket=default_staging_bucket, prefix=\"hazard\", s3=s3, store=store)" - ] - }, - { - "cell_type": "code", - "execution_count": 26, - "id": "17d36f0f", - "metadata": {}, - "outputs": [], - "source": [ - "path_to_file = r\"E:/JRC_RP/floodMap_RP{}/floodmap_EFAS_RP{}_C.tif\".format(\n", - " return_period, return_period\n", - ")\n", - "src = rasterio.open(path_to_file)\n", - "\n", - "transform = src.transform\n", - "crs = CRS.from_epsg(3035)\n", - "width = src.width\n", - "height = src.height\n", - "shape = (width, height)\n", - "\n", - "return_periods_str = [\"010\", \"020\", \"050\", \"100\", \"200\", \"500\"]\n", - "return_periods = [int(rt) for rt in return_periods_str]\n", - "\n", - "src.close()" - ] - }, - { - "cell_type": "code", - "execution_count": 27, - "id": "f439e73e", - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "" - ] - }, - "execution_count": 27, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "oscZ._zarr_create(\n", - " path=group_path,\n", - " shape=shape,\n", - " transform=transform,\n", - " crs=str(crs),\n", - " overwrite=True,\n", - " return_periods=return_periods,\n", - ")" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "ea1a02aa", - "metadata": {}, - "outputs": [], - "source": [ - "# Create xr.DataArray from s3 stored zarr object\n", - "\n", - "# This will break arise memory error\n", - "z = oscZ.root[group_path]\n", - "da = xr.DataArray(data=z)" - ] - }, - { - "cell_type": "code", - "execution_count": 11, - "id": "10222091", - "metadata": {}, - "outputs": [], - "source": [ - "# Read the file\n", - "# da = oscZ.read(path=group_path)\n", - "# da\n", - "\n", - "# Return RuntimeError because of coords when creating Datarray" - ] - }, - { - "attachments": {}, - "cell_type": "markdown", - "id": "df124dca", - "metadata": {}, - "source": [ - "## Steps to populate riverflood_JRC_RP_hist.zarr for 100m resolution\n", - "\n", - "### Step 1: Read JRC flood data\n", - "\n", - "Returns flood depth" - ] - }, - { - "cell_type": "code", - "execution_count": 12, - "id": "87a8f27e", - "metadata": {}, - "outputs": [], - "source": [ - "def read_one_file(path_to_file):\n", - " \"\"\"\n", - " Read JRC data.\n", - "\n", - " Parameters:\n", - " path_to_file (str): full path to tif file.\n", - "\n", - " Returns:\n", - " fld_depth (numpy array): flood depth at (x1, y1) 3035 EPSG coordinates\n", - "\n", - " \"\"\"\n", - "\n", - " src = rasterio.open(path_to_file)\n", - " fld_depth = src.read()\n", - "\n", - " return fld_depth" - ] - }, - { - "attachments": {}, - "cell_type": "markdown", - "id": "0d49d749", - "metadata": {}, - "source": [ - "### Step 2: Populate the raster file for every return period" - ] - }, - { - "cell_type": "code", - "execution_count": 26, - "id": "ac169636", - "metadata": {}, - "outputs": [], - "source": [ - "for rt_i, rt in enumerate(return_periods_str):\n", - "\n", - " path_to_file = r\"E:/JRC_RP/floodMap_RP{}/floodmap_EFAS_RP{}_C.tif\".format(rt, rt)\n", - " fld_depth = read_one_file(path_to_file)\n", - "\n", - " da.data[rt_i, :, :] = fld_depth" - ] - }, - { - "cell_type": "code", - "execution_count": 27, - "id": "dcfc0ab0", - "metadata": {}, - "outputs": [], - "source": [ - "oscZ.write(path=group_path, da=da)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "a6043456", - "metadata": {}, - "outputs": [], - "source": [ - "# Example using root object. Better to use oscZ object\n", - "\n", - "\"\"\"\n", - "create_dataset(name, **kwargs) method of zarr.hierarchy.Group instance\n", - " Create an array.\n", - " \n", - " Arrays are known as \"datasets\" in HDF5 terminology. For compatibility\n", - " with h5py, Zarr groups also implement the require_dataset() method.\n", - " \n", - " Parameters\n", - " ----------\n", - " name : string\n", - " Array name.\n", - " data : array-like, optional\n", - " Initial data.\n", - " shape : int or tuple of ints\n", - " Array shape.\n", - " chunks : int or tuple of ints, optional\n", - " Chunk shape. If not provided, will be guessed from `shape` and\n", - " `dtype`.\n", - " dtype : string or dtype, optional\n", - " NumPy dtype.\n", - " compressor : Codec, optional\n", - " Primary compressor.\n", - " fill_value : object\n", - " Default value to use for uninitialized portions of the array.\n", - "\n", - "\n", - "\n", - "root.create_dataset(name='prueba',\n", - " data = np.array([[0,1], [1,6]]),\n", - " shape = (2,2),\n", - " chunks = (1000, 1000),\n", - " dtype = 'f4')\n", - "\n", - "trans_members = [\n", - " transform.a,\n", - " transform.b,\n", - " transform.c,\n", - " transform.d,\n", - " transform.e,\n", - " transform.f,\n", - "]\n", - "mat3x3 = [x * 1.0 for x in trans_members] + [0.0, 0.0, 1.0] # Why adding this ??\n", - "root.attrs[\"crs\"] = str(crs)\n", - "root.attrs[\"transform_mat3x3\"] = mat3x3 \n", - "if return_periods is not None:\n", - " root.attrs[\"index_values\"] = return_periods\n", - " root.attrs[\"index_name\"] = \"return period (years)\"\n", - "\n", - "# Read the file\n", - "root['prueba']\n", - "\"\"\"" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "08c4eac2", - "metadata": {}, - "outputs": [], - "source": [ - "# Code to remove a file inside a bucket\n", - "\n", - "\"\"\"\"\n", - "import boto3\n", - "boto_c = boto3.client('s3', aws_access_key_id=os.environ[\"OSC_S3_ACCESS_KEY\"], aws_secret_access_key=os.environ[\"OSC_S3_SECRET_KEY\"])\n", - "\n", - "to_remove = boto_c.list_objects_v2(Bucket=default_staging_bucket, Prefix='hazard/hazard_MV_prueba.zarr')['Contents']\n", - "\n", - "keys = [item['Key'] for item in to_remove]\n", - "\n", - "for key_ in keys:\n", - " boto_c.delete_object(Bucket=default_staging_bucket, Key=key_)\n", - "\"\"\"" - ] - } - ], - "metadata": { - "kernelspec": { - "display_name": "Python 3 (ipykernel)", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.8.12" - } - }, - "nbformat": 4, - "nbformat_minor": 5 -} diff --git a/pdm.lock b/pdm.lock index 3040f0d..480a588 100644 --- a/pdm.lock +++ b/pdm.lock @@ -5,7 +5,7 @@ groups = ["default", "black[jupyter]", "lint", "test"] strategy = ["cross_platform", "inherit_metadata"] lock_version = "4.4.1" -content_hash = "sha256:5c1cf4b6bb2136f6aafbba8fafe53e565b1c2039dea916cb4e1d7f287c3abaab" +content_hash = "sha256:00ee56430f0ebcadff56239f2bedb8a2fc630ac83061d31788a0234a696f441e" [[package]] name = "affine" @@ -323,17 +323,6 @@ files = [ {file = "cachecontrol-0.14.0.tar.gz", hash = "sha256:7db1195b41c81f8274a7bbd97c956f44e8348265a1bc7641c37dfebc39f0c938"}, ] -[[package]] -name = "cachetools" -version = "5.3.3" -requires_python = ">=3.7" -summary = "Extensible memoizing collections and decorators" -groups = ["lint"] -files = [ - {file = "cachetools-5.3.3-py3-none-any.whl", hash = "sha256:0abad1021d3f8325b2fc1d2e9c8b9c9d57b04c3932657a72465447332c24d945"}, - {file = "cachetools-5.3.3.tar.gz", hash = "sha256:ba29e2dfa0b8b556606f097407ed1aa62080ee108ab0dc5ec9d6a723a007d105"}, -] - [[package]] name = "certifi" version = "2024.2.2" @@ -440,17 +429,6 @@ files = [ {file = "cftime-1.6.3.tar.gz", hash = "sha256:d0a6b29f72a13f08e008b9becff247cc75c84acb213332ede18879c5b6aa4dfd"}, ] -[[package]] -name = "chardet" -version = "5.2.0" -requires_python = ">=3.7" -summary = "Universal encoding detector for Python 3" -groups = ["lint"] -files = [ - {file = "chardet-5.2.0-py3-none-any.whl", hash = "sha256:e1cf59446890a00105fe7b7912492ea04b6e6f06d4b742b2c788469e34c82970"}, - {file = "chardet-5.2.0.tar.gz", hash = "sha256:1b3b6ff479a8c414bc3fa2c0852995695c4a026dcd6d0633b2dd092ca39c1cf7"}, -] - [[package]] name = "charset-normalizer" version = "3.3.2" @@ -565,6 +543,7 @@ version = "0.4.6" requires_python = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,>=2.7" summary = "Cross-platform colored terminal text." groups = ["default", "lint", "test"] +marker = "platform_system == \"Windows\" or sys_platform == \"win32\"" files = [ {file = "colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6"}, {file = "colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44"}, @@ -945,6 +924,20 @@ files = [ {file = "flake8-5.0.4.tar.gz", hash = "sha256:6fbe320aad8d6b95cec8b8e47bc933004678dc63095be98528b7bdd2a9f510db"}, ] +[[package]] +name = "flake8-pyproject" +version = "1.2.3" +requires_python = ">= 3.6" +summary = "Flake8 plug-in loading the configuration from pyproject.toml" +groups = ["lint"] +dependencies = [ + "Flake8>=5", + "TOMLi; python_version < \"3.11\"", +] +files = [ + {file = "flake8_pyproject-1.2.3-py3-none-any.whl", hash = "sha256:6249fe53545205af5e76837644dc80b4c10037e73a0e5db87ff562d75fb5bd4a"}, +] + [[package]] name = "fonttools" version = "4.50.0" @@ -2044,13 +2037,14 @@ files = [ [[package]] name = "pdm" -version = "2.13.0" +version = "2.13.2" requires_python = ">=3.8" summary = "A modern Python package and dependency manager supporting the latest PEP standards" groups = ["test"] dependencies = [ "blinker", "dep-logic<1.0,>=0.2.0", + "filelock>=3.13", "findpython<1.0.0a0,>=0.6.0", "hishel<0.1.0,>=0.0.24", "httpx[socks]<1,>0.20", @@ -2073,25 +2067,25 @@ dependencies = [ "virtualenv>=20", ] files = [ - {file = "pdm-2.13.0-py3-none-any.whl", hash = "sha256:3c914dede380ddac6eb5e3570ab5d950031361b72c3128af33e0a0502ddace5b"}, - {file = "pdm-2.13.0.tar.gz", hash = "sha256:7ba25f1cae22038149582773404644eb3321e13d50549e9cb87bdb95fa5c0f1f"}, + {file = "pdm-2.13.2-py3-none-any.whl", hash = "sha256:27072cbc1d9f7db1d7698827991dbd21c16cd73e2c68dbd796421c17bf45ca33"}, + {file = "pdm-2.13.2.tar.gz", hash = "sha256:e282bf1caf0a083fc0fb5e89ad6f79d7c579ff52c7bb58ee8587ea3d5bb9e14a"}, ] [[package]] name = "pdm" -version = "2.13.0" +version = "2.13.2" extras = ["pytest"] requires_python = ">=3.8" summary = "A modern Python package and dependency manager supporting the latest PEP standards" groups = ["test"] dependencies = [ - "pdm==2.13.0", + "pdm==2.13.2", "pytest", "pytest-mock", ] files = [ - {file = "pdm-2.13.0-py3-none-any.whl", hash = "sha256:3c914dede380ddac6eb5e3570ab5d950031361b72c3128af33e0a0502ddace5b"}, - {file = "pdm-2.13.0.tar.gz", hash = "sha256:7ba25f1cae22038149582773404644eb3321e13d50549e9cb87bdb95fa5c0f1f"}, + {file = "pdm-2.13.2-py3-none-any.whl", hash = "sha256:27072cbc1d9f7db1d7698827991dbd21c16cd73e2c68dbd796421c17bf45ca33"}, + {file = "pdm-2.13.2.tar.gz", hash = "sha256:e282bf1caf0a083fc0fb5e89ad6f79d7c579ff52c7bb58ee8587ea3d5bb9e14a"}, ] [[package]] @@ -2176,7 +2170,7 @@ name = "pluggy" version = "1.4.0" requires_python = ">=3.8" summary = "plugin and hook calling mechanisms for python" -groups = ["lint", "test"] +groups = ["test"] files = [ {file = "pluggy-1.4.0-py3-none-any.whl", hash = "sha256:7db9f7b503d67d1c5b95f59773ebb58a8c1c288129a88665838012cfb07b8981"}, {file = "pluggy-1.4.0.tar.gz", hash = "sha256:8c85c2876142a764e5b7548e7d9a0e0ddb46f5185161049a79b7e974454223be"}, @@ -2419,35 +2413,6 @@ files = [ {file = "pyproj-3.5.0.tar.gz", hash = "sha256:9859d1591c1863414d875ae0759e72c2cffc01ab989dc64137fbac572cc81bf6"}, ] -[[package]] -name = "pyproject-api" -version = "1.6.1" -requires_python = ">=3.8" -summary = "API to interact with the python pyproject.toml based projects" -groups = ["lint"] -dependencies = [ - "packaging>=23.1", - "tomli>=2.0.1; python_version < \"3.11\"", -] -files = [ - {file = "pyproject_api-1.6.1-py3-none-any.whl", hash = "sha256:4c0116d60476b0786c88692cf4e325a9814965e2469c5998b830bba16b183675"}, - {file = "pyproject_api-1.6.1.tar.gz", hash = "sha256:1817dc018adc0d1ff9ca1ed8c60e1623d5aaca40814b953af14a9cf9a5cae538"}, -] - -[[package]] -name = "pyproject-flake8" -version = "5.0.4.post1" -summary = "pyproject-flake8 (`pflake8`), a monkey patching wrapper to connect flake8 with pyproject.toml configuration " -groups = ["lint"] -dependencies = [ - "flake8==5.0.4", - "tomli; python_version < \"3.11\"", -] -files = [ - {file = "pyproject-flake8-5.0.4.post1.tar.gz", hash = "sha256:c2dfdf1064f47efbb2e4faf1a32b0b6a6ea67dc4d1debb98d862b0cdee377941"}, - {file = "pyproject_flake8-5.0.4.post1-py2.py3-none-any.whl", hash = "sha256:457e52dde1b7a1f84b5230c70d61afa58ced64a44b81a609f19e972319fa68ed"}, -] - [[package]] name = "pyproject-hooks" version = "1.0.0" @@ -3041,29 +3006,6 @@ files = [ {file = "tornado-6.4.tar.gz", hash = "sha256:72291fa6e6bc84e626589f1c29d90a5a6d593ef5ae68052ee2ef000dfd273dee"}, ] -[[package]] -name = "tox" -version = "4.14.2" -requires_python = ">=3.8" -summary = "tox is a generic virtualenv management and test command line tool" -groups = ["lint"] -dependencies = [ - "cachetools>=5.3.2", - "chardet>=5.2", - "colorama>=0.4.6", - "filelock>=3.13.1", - "packaging>=23.2", - "platformdirs>=4.1", - "pluggy>=1.3", - "pyproject-api>=1.6.1", - "tomli>=2.0.1; python_version < \"3.11\"", - "virtualenv>=20.25", -] -files = [ - {file = "tox-4.14.2-py3-none-any.whl", hash = "sha256:2900c4eb7b716af4a928a7fdc2ed248ad6575294ed7cfae2ea41203937422847"}, - {file = "tox-4.14.2.tar.gz", hash = "sha256:0defb44f6dafd911b61788325741cc6b2e12ea71f987ac025ad4d649f1f1a104"}, -] - [[package]] name = "truststore" version = "0.8.0" diff --git a/pyproject.toml b/pyproject.toml index 18078e4..ec8a2b2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -32,7 +32,7 @@ classifiers = [ dependencies = [ "cftime", "dask[distributed]", - "fsspec", + "fsspec", "geopandas", "h5netcdf", "mapbox", @@ -93,11 +93,10 @@ test = [ lint = [ "isort", "black", - "pyproject-flake8", "flake8", + "Flake8-pyproject", "mypy", "pre-commit", - "tox" ] "black[jupyter]" = [] @@ -105,9 +104,14 @@ lint = [ pre_release = "scripts/dev-versioning.sh" release = "scripts/release-versioning.sh" test = "pytest" -tox = "tox" docs = { shell = "cd docs && mkdocs serve", help = "Start the dev server for doc preview" } lint = "pre-commit run --all-files" +isort = { cmd = "isort --check ." } +black = { cmd = "black --check ." } +flake8 = { cmd = "flake8 src" } +mypy = { cmd = "mypy --install-types --non-interactive src" } +all = {composite = ["pytest", "mypy", "isort", "black", "flake8"]} + complete = { call = "tasks.complete:main", help = "Create autocomplete files for bash and fish" } [tool.pytest.ini_options] @@ -155,4 +159,6 @@ exclude = ''' max-line-length = "120" extend-ignore = [ "E501", + "E203", # Allow spacing before colon (to favor Black). ] + diff --git a/src/hazard/models/wet_bulb_globe_temp.md b/src/hazard/models/wet_bulb_globe_temp.md index 32b1c87..788f519 100644 --- a/src/hazard/models/wet_bulb_globe_temp.md +++ b/src/hazard/models/wet_bulb_globe_temp.md @@ -4,7 +4,7 @@ $$ I = \frac{365}{n_y} \sum_{i = 1}^{n_y} \boldsymbol{\mathbb{1}}_{\; \, T^\text{WBGT}_i > T^\text{ref}} \nonumber $$ -$I$ is the indicator, $n_y$ is the number of days in the sample and $T^\text{ref}$ is the reference temperature. +$I$ is the indicator, $n_y$ is the number of days in the sample and $T^\text{ref}$ is the reference temperature. The 'Wet-Bulb Globe Temperature' (WBGT) indicator is calculated from both the average daily near-surface surface temperature in °C denoted $T^\text{avg}$ and the water vapour partial pressure in kPa denoted $p^\text{vapour}$: diff --git a/src/hazard/onboard/wri_aqueduct_water_risk.md b/src/hazard/onboard/wri_aqueduct_water_risk.md index 09b21dd..6195e07 100644 --- a/src/hazard/onboard/wri_aqueduct_water_risk.md +++ b/src/hazard/onboard/wri_aqueduct_water_risk.md @@ -1,4 +1,4 @@ -The World Resources Institute (WRI) [Aqueduct 4.0](https://www.wri.org/data/aqueduct-global-maps-40-data) is the latest iteration of [WRI’s water risk framework](https://www.wri.org/data/aqueduct-water-risk-atlas) designed to translate complex +The World Resources Institute (WRI) [Aqueduct 4.0](https://www.wri.org/data/aqueduct-global-maps-40-data) is the latest iteration of [WRI’s water risk framework](https://www.wri.org/data/aqueduct-water-risk-atlas) designed to translate complex hydrological data into intuitive indicators of water-related risk: * **Water demand**: gross demand is the maximum potential water required to meet sectoral demands. Sectoral water demand includes: domestic, industrial, irrigation, and livestock. Demand is displayed as a flux (centimeters/year). @@ -11,5 +11,5 @@ hydrological data into intuitive indicators of water-related risk: [Aqueduct 4.0 FAQ](https://github.com/wri/Aqueduct40/blob/master/data_FAQ.md) explains why the water supply and demand values are measured as fluxes instead of volumes. Volumes (cubic meters) can vary significantly based on the size of each sub-basin, potentially misleading as they might primarily reflect a larger geographical area rather than indicating a higher rate of water flow. On the other hand, fluxes (centimeters/year), which measure the rate of water flow, offer a more direct and equitable means of comparing water availability between different sub-basins. Volume = Flux x Area. -The spatial resolution is 5 × 5 arc minutes which equates roughly to 10 kilometer (km) × 10 km pixels. -The future projections were created using CMIP6 climate forcings based on three future scenarios: optimistic (ssp126), business-as-usual (ssp370), and pessimistic (ssp585) available at [HYPFLOWSCI6](https://public.yoda.uu.nl/geo/UU01/YM7A5H.html). WRI's original data are presented at the HydroBASINS Level 6 scale. Indicators are available for periods: 'historical' (averaged over 1979-2019), 2030 (2015-2045), 2050 (2035-2065) and 2080 (2065-2095). \ No newline at end of file +The spatial resolution is 5 × 5 arc minutes which equates roughly to 10 kilometer (km) × 10 km pixels. +The future projections were created using CMIP6 climate forcings based on three future scenarios: optimistic (ssp126), business-as-usual (ssp370), and pessimistic (ssp585) available at [HYPFLOWSCI6](https://public.yoda.uu.nl/geo/UU01/YM7A5H.html). WRI's original data are presented at the HydroBASINS Level 6 scale. Indicators are available for periods: 'historical' (averaged over 1979-2019), 2030 (2015-2045), 2050 (2035-2065) and 2080 (2065-2095). diff --git a/src/hazard/utilities/zarr_utilities.py b/src/hazard/utilities/zarr_utilities.py index 25567ea..bbc9ec4 100644 --- a/src/hazard/utilities/zarr_utilities.py +++ b/src/hazard/utilities/zarr_utilities.py @@ -11,12 +11,12 @@ from dotenv import load_dotenv -def add_logging_output_to_stdout(LOG): +def add_logging_output_to_stdout(log): handler = logging.StreamHandler(sys.stdout) handler.setLevel(logging.DEBUG) formatter = logging.Formatter("%(asctime)s - %(name)s - %(levelname)s - %(message)s") handler.setFormatter(formatter) - LOG.addHandler(handler) + log.addHandler(handler) def get_coordinates(longitudes, latitudes, transform): diff --git a/src/inventories/hazard/inventory.json b/src/inventories/hazard/inventory.json index 0a2028d..120e031 100644 --- a/src/inventories/hazard/inventory.json +++ b/src/inventories/hazard/inventory.json @@ -976,7 +976,7 @@ "params": {}, "display_name": "Fire probability (Jupiter)", "display_groups": [], - "description": "\nThese data should not be used in any manner relating to emergency management or planning, public safety, physical safety or property endangerment.\nFor higher-resolution data based on up-to-date methods, subject to greater validation, and suitable for bottom-up risk analysis please contact\n[Jupiter Intelligence](https://www.jupiterintel.com).\n\nThis fire model computes the maximum monthly probability per annum of a wildfire within 100 km of a given location based on several parameters from multiple bias corrected\nand downscaled Global Climate Models (GCMs).\nFor example, if the probability of occurrence of a wildfire is 5% in July, 20% in August, 10% in September and 0% for other months, the hazard indicator value is 20%.\n ", + "description": "\nThese data should not be used in any manner relating to emergency management or planning, public safety,\nphysical safety or property endangerment. For higher-resolution data based on up-to-date methods,\nsubject to greater validation, and suitable for bottom-up risk analysis please contact\n[Jupiter Intelligence](https://www.jupiterintel.com).\n\nThis fire model computes the maximum monthly probability per annum of a wildfire within 100 km of\na given location based on several parameters from multiple bias corrected and downscaled Global Climate Models (GCMs).\nFor example, if the probability of occurrence of a wildfire is 5% in July, 20% in August, 10% in September\nand 0% for other months, the hazard indicator value is 20%.\n ", "map": { "colormap": { "min_index": 1, @@ -1045,7 +1045,7 @@ "params": {}, "display_name": "Drought (Jupiter)", "display_groups": [], - "description": "\nThese data should not be used in any manner relating to emergency management or planning, public safety, physical safety or property endangerment.\nFor higher-resolution data based on up-to-date methods, subject to greater validation, and suitable for bottom-up risk analysis please contact\n[Jupiter Intelligence](https://www.jupiterintel.com).\n\nThis drought model is based on the Standardized Precipitation-Evapotranspiration Index (SPEI).\nThe SPEl is an extension of the Standardized Precipitation Index which also considers Potential Evapotranspiration (PET) in determining drought events.\nThe SPEl is calculated from a log-logistic probability distribution function of climatic water balance (precipitation minus evapotranspiration) over a given time scale.\nThe SPEI itself is a standardized variable with a mean value 0 and standard deviation 1.\nThis drought model computes the number of months per annum where the 3-month rolling average of SPEI is below -2 based on the mean values of several parameters from\nbias-corrected and downscaled multiple Global Climate Models (GCMs).\n ", + "description": "\nThese data should not be used in any manner relating to emergency management or planning, public safety,\nphysical safety or property endangerment. For higher-resolution data based on up-to-date methods,\nsubject to greater validation, and suitable for bottom-up risk analysis please contact\n[Jupiter Intelligence](https://www.jupiterintel.com).\n\nThis drought model is based on the Standardized Precipitation-Evapotranspiration Index (SPEI).\nThe SPEl is an extension of the Standardized Precipitation Index which also considers Potential Evapotranspiration (PET)\nin determining drought events.\nThe SPEl is calculated from a log-logistic probability distribution function of climatic water balance\n(precipitation minus evapotranspiration) over a given time scale.\nThe SPEI itself is a standardized variable with a mean value 0 and standard deviation 1.\nThis drought model computes the number of months per annum where the 3-month rolling average\nof SPEI is below -2 based on the mean values of several parameters from\nbias-corrected and downscaled multiple Global Climate Models (GCMs).\n ", "map": { "colormap": { "min_index": 1, @@ -1114,7 +1114,7 @@ "params": {}, "display_name": "Precipitation (Jupiter)", "display_groups": [], - "description": "\nThese data should not be used in any manner relating to emergency management or planning, public safety, physical safety or property endangerment.\nFor higher-resolution data based on up-to-date methods, subject to greater validation, and suitable for bottom-up risk analysis please contact\n[Jupiter Intelligence](https://www.jupiterintel.com).\n\nThis model computes the maximum daily water equivalent precipitation (in mm) measured at the 100 year return period based on the mean of the precipitation distribution\nfrom multiple bias corrected and downscaled Global Climate Models (GCMs).\n ", + "description": "\nThese data should not be used in any manner relating to emergency management or planning, public safety,\nphysical safety or property endangerment. For higher-resolution data based on up-to-date methods,\nsubject to greater validation, and suitable for bottom-up risk analysis please contact\n[Jupiter Intelligence](https://www.jupiterintel.com).\n\nThis model computes the maximum daily water equivalent precipitation (in mm) measured at the 100 year\nreturn period based on the mean of the precipitation distribution from multiple bias corrected and\ndownscaled Global Climate Models (GCMs).\n ", "map": { "colormap": { "min_index": 1, @@ -1183,7 +1183,7 @@ "params": {}, "display_name": "Large hail days per year (Jupiter)", "display_groups": [], - "description": "\nThese data should not be used in any manner relating to emergency management or planning, public safety, physical safety or property endangerment.\nFor higher-resolution data based on up-to-date methods, subject to greater validation, and suitable for bottom-up risk analysis please contact\n[Jupiter Intelligence](https://www.jupiterintel.com).\n\nThis hail model computes the number of days per annum where hail exceeding 5 cm diameter is possible based on the mean distribution of several parameters\nacross multiple bias-corrected and downscaled Global Climate Models (GCMs).\n ", + "description": "\nThese data should not be used in any manner relating to emergency management or planning, public safety,\nphysical safety or property endangerment. For higher-resolution data based on up-to-date methods,\nsubject to greater validation, and suitable for bottom-up risk analysis please contact\n[Jupiter Intelligence](https://www.jupiterintel.com).\n\nThis hail model computes the number of days per annum where hail exceeding 5 cm diameter is possible\nbased on the mean distribution of several parameters\nacross multiple bias-corrected and downscaled Global Climate Models (GCMs).\n ", "map": { "colormap": { "min_index": 1, @@ -1252,7 +1252,7 @@ "params": {}, "display_name": "Days per year above 35\u00b0C (Jupiter)", "display_groups": [], - "description": "\nThese data should not be used in any manner relating to emergency management or planning, public safety, physical safety or property endangerment.\nFor higher-resolution data based on up-to-date methods, subject to greater validation, and suitable for bottom-up risk analysis please contact\n[Jupiter Intelligence](https://www.jupiterintel.com).\n\nThis heat model computes the number of days exceeding 35\u00b0C per annum based on the mean of distribution fits to the bias-corrected and downscaled high temperature distribution\nacross multiple Global Climate Models (GCMs).\n ", + "description": "\nThese data should not be used in any manner relating to emergency management or planning, public safety,\nphysical safety or property endangerment. For higher-resolution data based on up-to-date methods,\nsubject to greater validation, and suitable for bottom-up risk analysis please contact\n[Jupiter Intelligence](https://www.jupiterintel.com).\n\nThis heat model computes the number of days exceeding 35\u00b0C per annum based on the mean of distribution fits\nto the bias-corrected and downscaled high temperature distribution\nacross multiple Global Climate Models (GCMs).\n ", "map": { "colormap": { "min_index": 1, @@ -1321,7 +1321,7 @@ "params": {}, "display_name": "Max 1 minute sustained wind speed (Jupiter)", "display_groups": [], - "description": "\nThese data should not be used in any manner relating to emergency management or planning, public safety, physical safety or property endangerment.\nFor higher-resolution data based on up-to-date methods, subject to greater validation, and suitable for bottom-up risk analysis please contact\n[Jupiter Intelligence](https://www.jupiterintel.com).\n\nThis wind speed model computes the maximum 1-minute sustained wind speed (in km/hr) experienced over a 100 year return period based on mean wind speed distributions\nfrom multiple Global Climate Models (GCMs).\n ", + "description": "\nThese data should not be used in any manner relating to emergency management or planning, public safety,\nphysical safety or property endangerment. For higher-resolution data based on up-to-date methods,\nsubject to greater validation, and suitable for bottom-up risk analysis please contact\n[Jupiter Intelligence](https://www.jupiterintel.com).\n\nThis wind speed model computes the maximum 1-minute sustained wind speed (in km/hr) experienced over a\n100 year return period based on mean wind speed distributions\nfrom multiple Global Climate Models (GCMs).\n ", "map": { "colormap": { "min_index": 1, @@ -1390,7 +1390,7 @@ "params": {}, "display_name": "Flooded fraction (Jupiter)", "display_groups": [], - "description": "\nThese data should not be used in any manner relating to emergency management or planning, public safety, physical safety or property endangerment.\nFor higher-resolution data based on up-to-date methods, subject to greater validation, and suitable for bottom-up risk analysis please contact\n[Jupiter Intelligence](https://www.jupiterintel.com).\n\nFlooded fraction provides the spatial fraction of land flooded in a defined grid.\nIt is derived from higher-resolution flood hazards, and computed directly as the fraction of cells within the 30-km cell that have non-zero flooding at that return period.\nThis model uses a 30-km grid that experiences flooding at the 200-year return period.\nOpen oceans are excluded.\n ", + "description": "\nThese data should not be used in any manner relating to emergency management or planning, public safety,\nphysical safety or property endangerment. For higher-resolution data based on up-to-date methods,\nsubject to greater validation, and suitable for bottom-up risk analysis please contact\n[Jupiter Intelligence](https://www.jupiterintel.com).\n\nFlooded fraction provides the spatial fraction of land flooded in a defined grid.\nIt is derived from higher-resolution flood hazards, and computed directly as the fraction of\ncells within the 30-km cell that have non-zero flooding at that return period.\nThis model uses a 30-km grid that experiences flooding at the 200-year return period.\nOpen oceans are excluded.\n ", "map": { "colormap": { "min_index": 1, @@ -2117,7 +2117,7 @@ "display_groups": [ "Days with wet-bulb globe temperature above threshold in \u00b0C" ], - "description": "Days per year for which the 'Wet Bulb Globe Temperature' indicator is above a threshold specified in \u00b0C:\n\n$$\nI = \\frac{365}{n_y} \\sum_{i = 1}^{n_y} \\boldsymbol{\\mathbb{1}}_{\\; \\, T^\\text{WBGT}_i > T^\\text{ref}} \\nonumber\n$$\n\n$I$ is the indicator, $n_y$ is the number of days in the sample and $T^\\text{ref}$ is the reference temperature. \n\nThe 'Wet-Bulb Globe Temperature' (WBGT) indicator is calculated from both the average daily near-surface surface temperature in \u00b0C denoted $T^\\text{avg}$ and the water vapour partial pressure in kPa denoted $p^\\text{vapour}$:\n\n$$\nT^\\text{WBGT}_i = 0.567 \\times T^\\text{avg}_i + 0.393 \\times p^\\text{vapour}_i + 3.94\n$$\n\nThe water vapour partial pressure $p^\\text{vapour}$ is calculated from relative humidity $h^\\text{relative}$:\n\n$$\np^\\text{vapour}_i = \\frac{h^\\text{relative}_i}{100} \\times 6.105 \\times \\exp \\left( \\frac{17.27 \\times T^\\text{avg}_i}{237.7 + T^\\text{avg}_i} \\right)\n$$\n\nThe OS-Climate-generated indicators are inferred from downscaled CMIP6 data, averaged over for 6 Global Circulation Models: ACCESS-CM2, CMCC-ESM2, CNRM-CM6-1, MPI-ESM1-2-LR, MIROC6 and NorESM2-MM.\nThe downscaled data is sourced from the [NASA Earth Exchange Global Daily Downscaled Projections](https://www.nccs.nasa.gov/services/data-collections/land-based-products/nex-gddp-cmip6).\nIndicators are generated for periods: 'historical' (averaged over 1995-2014), 2030 (2021-2040), 2040 (2031-2050), 2050 (2041-2060), 2060 (2051-2070), 2070 (2061-2080), 2080 (2071-2090) and 2090 (2081-2100).\n", + "description": "Days per year for which the 'Wet Bulb Globe Temperature' indicator is above a threshold specified in \u00b0C:\n\n$$\nI = \\frac{365}{n_y} \\sum_{i = 1}^{n_y} \\boldsymbol{\\mathbb{1}}_{\\; \\, T^\\text{WBGT}_i > T^\\text{ref}} \\nonumber\n$$\n\n$I$ is the indicator, $n_y$ is the number of days in the sample and $T^\\text{ref}$ is the reference temperature.\n\nThe 'Wet-Bulb Globe Temperature' (WBGT) indicator is calculated from both the average daily near-surface surface temperature in \u00b0C denoted $T^\\text{avg}$ and the water vapour partial pressure in kPa denoted $p^\\text{vapour}$:\n\n$$\nT^\\text{WBGT}_i = 0.567 \\times T^\\text{avg}_i + 0.393 \\times p^\\text{vapour}_i + 3.94\n$$\n\nThe water vapour partial pressure $p^\\text{vapour}$ is calculated from relative humidity $h^\\text{relative}$:\n\n$$\np^\\text{vapour}_i = \\frac{h^\\text{relative}_i}{100} \\times 6.105 \\times \\exp \\left( \\frac{17.27 \\times T^\\text{avg}_i}{237.7 + T^\\text{avg}_i} \\right)\n$$\n\nThe OS-Climate-generated indicators are inferred from downscaled CMIP6 data, averaged over for 6 Global Circulation Models: ACCESS-CM2, CMCC-ESM2, CNRM-CM6-1, MPI-ESM1-2-LR, MIROC6 and NorESM2-MM.\nThe downscaled data is sourced from the [NASA Earth Exchange Global Daily Downscaled Projections](https://www.nccs.nasa.gov/services/data-collections/land-based-products/nex-gddp-cmip6).\nIndicators are generated for periods: 'historical' (averaged over 1995-2014), 2030 (2021-2040), 2040 (2031-2050), 2050 (2041-2060), 2060 (2051-2070), 2070 (2061-2080), 2080 (2071-2090) and 2090 (2081-2100).\n", "map": { "colormap": { "min_index": 1, @@ -2233,7 +2233,7 @@ "display_groups": [ "Water demand in centimeters/year (Aqueduct 4.0)" ], - "description": "The World Resources Institute (WRI) [Aqueduct 4.0](https://www.wri.org/data/aqueduct-global-maps-40-data) is the latest iteration of [WRI\u2019s water risk framework](https://www.wri.org/data/aqueduct-water-risk-atlas) designed to translate complex \nhydrological data into intuitive indicators of water-related risk:\n\n* **Water demand**: gross demand is the maximum potential water required to meet sectoral demands. Sectoral water demand includes: domestic, industrial, irrigation, and livestock. Demand is displayed as a flux (centimeters/year).\n\n* **Water supply**: available blue water, the total amount of renewable freshwater available to a sub-basin with upstream consumption removed, includes surface flow, interflow, and groundwater recharge. Available blue water is displayed as a flux (centimeters/year).\n\n* **Water stress**: an indicator of competition for water resources defined informally as the ratio of demand for water by human society divided by available water. It can be classified into six categories: -1: Arid and low water use, 0: Low (<10%), 1: Low-medium (10-20%), 2: Medium-high (20-40%), 3: High (40-80%), 4: Extremely high (>80%).\n\n* **Water depletion**: the ratio of total water consumption to available renewable water supplies. Total water consumption includes domestic, industrial, irrigation, and livestock consumptive uses. Available renewable water supplies include the impact of upstream consumptive water users and large dams on downstream water availability. Higher values indicate larger impact on the local water supply and decreased water availability for downstream users. Water depletion is similar to water stress; however, instead of looking at total water demand, water depletion is calculated using consumptive withdrawal only. It can be classified into six categories: -1: Arid and low water use, 0 : Low (<5%), 1: Low-medium (5-25%), 2 : Medium-high (25-50%), 3: High (50-75%), 4 : Extremely high (>75%).\n\n[Aqueduct 4.0 FAQ](https://github.com/wri/Aqueduct40/blob/master/data_FAQ.md) explains why the water supply and demand values are measured as fluxes instead of volumes. Volumes (cubic meters) can vary significantly based on the size of each sub-basin, potentially misleading as they might primarily reflect a larger geographical area rather than indicating a higher rate of water flow. On the other hand, fluxes (centimeters/year), which measure the rate of water flow, offer a more direct and equitable means of comparing water availability between different sub-basins. Volume = Flux x Area.\n\nThe spatial resolution is 5 \u00d7 5 arc minutes which equates roughly to 10 kilometer (km) \u00d7 10 km pixels. \nThe future projections were created using CMIP6 climate forcings based on three future scenarios: optimistic (ssp126), business-as-usual (ssp370), and pessimistic (ssp585) available at [HYPFLOWSCI6](https://public.yoda.uu.nl/geo/UU01/YM7A5H.html). WRI's original data are presented at the HydroBASINS Level 6 scale. Indicators are available for periods: 'historical' (averaged over 1979-2019), 2030 (2015-2045), 2050 (2035-2065) and 2080 (2065-2095).", + "description": "The World Resources Institute (WRI) [Aqueduct 4.0](https://www.wri.org/data/aqueduct-global-maps-40-data) is the latest iteration of [WRI\u2019s water risk framework](https://www.wri.org/data/aqueduct-water-risk-atlas) designed to translate complex\nhydrological data into intuitive indicators of water-related risk:\n\n* **Water demand**: gross demand is the maximum potential water required to meet sectoral demands. Sectoral water demand includes: domestic, industrial, irrigation, and livestock. Demand is displayed as a flux (centimeters/year).\n\n* **Water supply**: available blue water, the total amount of renewable freshwater available to a sub-basin with upstream consumption removed, includes surface flow, interflow, and groundwater recharge. Available blue water is displayed as a flux (centimeters/year).\n\n* **Water stress**: an indicator of competition for water resources defined informally as the ratio of demand for water by human society divided by available water. It can be classified into six categories: -1: Arid and low water use, 0: Low (<10%), 1: Low-medium (10-20%), 2: Medium-high (20-40%), 3: High (40-80%), 4: Extremely high (>80%).\n\n* **Water depletion**: the ratio of total water consumption to available renewable water supplies. Total water consumption includes domestic, industrial, irrigation, and livestock consumptive uses. Available renewable water supplies include the impact of upstream consumptive water users and large dams on downstream water availability. Higher values indicate larger impact on the local water supply and decreased water availability for downstream users. Water depletion is similar to water stress; however, instead of looking at total water demand, water depletion is calculated using consumptive withdrawal only. It can be classified into six categories: -1: Arid and low water use, 0 : Low (<5%), 1: Low-medium (5-25%), 2 : Medium-high (25-50%), 3: High (50-75%), 4 : Extremely high (>75%).\n\n[Aqueduct 4.0 FAQ](https://github.com/wri/Aqueduct40/blob/master/data_FAQ.md) explains why the water supply and demand values are measured as fluxes instead of volumes. Volumes (cubic meters) can vary significantly based on the size of each sub-basin, potentially misleading as they might primarily reflect a larger geographical area rather than indicating a higher rate of water flow. On the other hand, fluxes (centimeters/year), which measure the rate of water flow, offer a more direct and equitable means of comparing water availability between different sub-basins. Volume = Flux x Area.\n\nThe spatial resolution is 5 \u00d7 5 arc minutes which equates roughly to 10 kilometer (km) \u00d7 10 km pixels.\nThe future projections were created using CMIP6 climate forcings based on three future scenarios: optimistic (ssp126), business-as-usual (ssp370), and pessimistic (ssp585) available at [HYPFLOWSCI6](https://public.yoda.uu.nl/geo/UU01/YM7A5H.html). WRI's original data are presented at the HydroBASINS Level 6 scale. Indicators are available for periods: 'historical' (averaged over 1979-2019), 2030 (2015-2045), 2050 (2035-2065) and 2080 (2065-2095).\n", "map": { "colormap": { "min_index": 1, @@ -2312,7 +2312,7 @@ "display_groups": [ "Water supply in centimeters/year (Aqueduct 4.0)" ], - "description": "The World Resources Institute (WRI) [Aqueduct 4.0](https://www.wri.org/data/aqueduct-global-maps-40-data) is the latest iteration of [WRI\u2019s water risk framework](https://www.wri.org/data/aqueduct-water-risk-atlas) designed to translate complex \nhydrological data into intuitive indicators of water-related risk:\n\n* **Water demand**: gross demand is the maximum potential water required to meet sectoral demands. Sectoral water demand includes: domestic, industrial, irrigation, and livestock. Demand is displayed as a flux (centimeters/year).\n\n* **Water supply**: available blue water, the total amount of renewable freshwater available to a sub-basin with upstream consumption removed, includes surface flow, interflow, and groundwater recharge. Available blue water is displayed as a flux (centimeters/year).\n\n* **Water stress**: an indicator of competition for water resources defined informally as the ratio of demand for water by human society divided by available water. It can be classified into six categories: -1: Arid and low water use, 0: Low (<10%), 1: Low-medium (10-20%), 2: Medium-high (20-40%), 3: High (40-80%), 4: Extremely high (>80%).\n\n* **Water depletion**: the ratio of total water consumption to available renewable water supplies. Total water consumption includes domestic, industrial, irrigation, and livestock consumptive uses. Available renewable water supplies include the impact of upstream consumptive water users and large dams on downstream water availability. Higher values indicate larger impact on the local water supply and decreased water availability for downstream users. Water depletion is similar to water stress; however, instead of looking at total water demand, water depletion is calculated using consumptive withdrawal only. It can be classified into six categories: -1: Arid and low water use, 0 : Low (<5%), 1: Low-medium (5-25%), 2 : Medium-high (25-50%), 3: High (50-75%), 4 : Extremely high (>75%).\n\n[Aqueduct 4.0 FAQ](https://github.com/wri/Aqueduct40/blob/master/data_FAQ.md) explains why the water supply and demand values are measured as fluxes instead of volumes. Volumes (cubic meters) can vary significantly based on the size of each sub-basin, potentially misleading as they might primarily reflect a larger geographical area rather than indicating a higher rate of water flow. On the other hand, fluxes (centimeters/year), which measure the rate of water flow, offer a more direct and equitable means of comparing water availability between different sub-basins. Volume = Flux x Area.\n\nThe spatial resolution is 5 \u00d7 5 arc minutes which equates roughly to 10 kilometer (km) \u00d7 10 km pixels. \nThe future projections were created using CMIP6 climate forcings based on three future scenarios: optimistic (ssp126), business-as-usual (ssp370), and pessimistic (ssp585) available at [HYPFLOWSCI6](https://public.yoda.uu.nl/geo/UU01/YM7A5H.html). WRI's original data are presented at the HydroBASINS Level 6 scale. Indicators are available for periods: 'historical' (averaged over 1979-2019), 2030 (2015-2045), 2050 (2035-2065) and 2080 (2065-2095).", + "description": "The World Resources Institute (WRI) [Aqueduct 4.0](https://www.wri.org/data/aqueduct-global-maps-40-data) is the latest iteration of [WRI\u2019s water risk framework](https://www.wri.org/data/aqueduct-water-risk-atlas) designed to translate complex\nhydrological data into intuitive indicators of water-related risk:\n\n* **Water demand**: gross demand is the maximum potential water required to meet sectoral demands. Sectoral water demand includes: domestic, industrial, irrigation, and livestock. Demand is displayed as a flux (centimeters/year).\n\n* **Water supply**: available blue water, the total amount of renewable freshwater available to a sub-basin with upstream consumption removed, includes surface flow, interflow, and groundwater recharge. Available blue water is displayed as a flux (centimeters/year).\n\n* **Water stress**: an indicator of competition for water resources defined informally as the ratio of demand for water by human society divided by available water. It can be classified into six categories: -1: Arid and low water use, 0: Low (<10%), 1: Low-medium (10-20%), 2: Medium-high (20-40%), 3: High (40-80%), 4: Extremely high (>80%).\n\n* **Water depletion**: the ratio of total water consumption to available renewable water supplies. Total water consumption includes domestic, industrial, irrigation, and livestock consumptive uses. Available renewable water supplies include the impact of upstream consumptive water users and large dams on downstream water availability. Higher values indicate larger impact on the local water supply and decreased water availability for downstream users. Water depletion is similar to water stress; however, instead of looking at total water demand, water depletion is calculated using consumptive withdrawal only. It can be classified into six categories: -1: Arid and low water use, 0 : Low (<5%), 1: Low-medium (5-25%), 2 : Medium-high (25-50%), 3: High (50-75%), 4 : Extremely high (>75%).\n\n[Aqueduct 4.0 FAQ](https://github.com/wri/Aqueduct40/blob/master/data_FAQ.md) explains why the water supply and demand values are measured as fluxes instead of volumes. Volumes (cubic meters) can vary significantly based on the size of each sub-basin, potentially misleading as they might primarily reflect a larger geographical area rather than indicating a higher rate of water flow. On the other hand, fluxes (centimeters/year), which measure the rate of water flow, offer a more direct and equitable means of comparing water availability between different sub-basins. Volume = Flux x Area.\n\nThe spatial resolution is 5 \u00d7 5 arc minutes which equates roughly to 10 kilometer (km) \u00d7 10 km pixels.\nThe future projections were created using CMIP6 climate forcings based on three future scenarios: optimistic (ssp126), business-as-usual (ssp370), and pessimistic (ssp585) available at [HYPFLOWSCI6](https://public.yoda.uu.nl/geo/UU01/YM7A5H.html). WRI's original data are presented at the HydroBASINS Level 6 scale. Indicators are available for periods: 'historical' (averaged over 1979-2019), 2030 (2015-2045), 2050 (2035-2065) and 2080 (2065-2095).\n", "map": { "colormap": { "min_index": 1, @@ -2391,7 +2391,7 @@ "display_groups": [ "Water stress (Aqueduct 4.0)" ], - "description": "The World Resources Institute (WRI) [Aqueduct 4.0](https://www.wri.org/data/aqueduct-global-maps-40-data) is the latest iteration of [WRI\u2019s water risk framework](https://www.wri.org/data/aqueduct-water-risk-atlas) designed to translate complex \nhydrological data into intuitive indicators of water-related risk:\n\n* **Water demand**: gross demand is the maximum potential water required to meet sectoral demands. Sectoral water demand includes: domestic, industrial, irrigation, and livestock. Demand is displayed as a flux (centimeters/year).\n\n* **Water supply**: available blue water, the total amount of renewable freshwater available to a sub-basin with upstream consumption removed, includes surface flow, interflow, and groundwater recharge. Available blue water is displayed as a flux (centimeters/year).\n\n* **Water stress**: an indicator of competition for water resources defined informally as the ratio of demand for water by human society divided by available water. It can be classified into six categories: -1: Arid and low water use, 0: Low (<10%), 1: Low-medium (10-20%), 2: Medium-high (20-40%), 3: High (40-80%), 4: Extremely high (>80%).\n\n* **Water depletion**: the ratio of total water consumption to available renewable water supplies. Total water consumption includes domestic, industrial, irrigation, and livestock consumptive uses. Available renewable water supplies include the impact of upstream consumptive water users and large dams on downstream water availability. Higher values indicate larger impact on the local water supply and decreased water availability for downstream users. Water depletion is similar to water stress; however, instead of looking at total water demand, water depletion is calculated using consumptive withdrawal only. It can be classified into six categories: -1: Arid and low water use, 0 : Low (<5%), 1: Low-medium (5-25%), 2 : Medium-high (25-50%), 3: High (50-75%), 4 : Extremely high (>75%).\n\n[Aqueduct 4.0 FAQ](https://github.com/wri/Aqueduct40/blob/master/data_FAQ.md) explains why the water supply and demand values are measured as fluxes instead of volumes. Volumes (cubic meters) can vary significantly based on the size of each sub-basin, potentially misleading as they might primarily reflect a larger geographical area rather than indicating a higher rate of water flow. On the other hand, fluxes (centimeters/year), which measure the rate of water flow, offer a more direct and equitable means of comparing water availability between different sub-basins. Volume = Flux x Area.\n\nThe spatial resolution is 5 \u00d7 5 arc minutes which equates roughly to 10 kilometer (km) \u00d7 10 km pixels. \nThe future projections were created using CMIP6 climate forcings based on three future scenarios: optimistic (ssp126), business-as-usual (ssp370), and pessimistic (ssp585) available at [HYPFLOWSCI6](https://public.yoda.uu.nl/geo/UU01/YM7A5H.html). WRI's original data are presented at the HydroBASINS Level 6 scale. Indicators are available for periods: 'historical' (averaged over 1979-2019), 2030 (2015-2045), 2050 (2035-2065) and 2080 (2065-2095).", + "description": "The World Resources Institute (WRI) [Aqueduct 4.0](https://www.wri.org/data/aqueduct-global-maps-40-data) is the latest iteration of [WRI\u2019s water risk framework](https://www.wri.org/data/aqueduct-water-risk-atlas) designed to translate complex\nhydrological data into intuitive indicators of water-related risk:\n\n* **Water demand**: gross demand is the maximum potential water required to meet sectoral demands. Sectoral water demand includes: domestic, industrial, irrigation, and livestock. Demand is displayed as a flux (centimeters/year).\n\n* **Water supply**: available blue water, the total amount of renewable freshwater available to a sub-basin with upstream consumption removed, includes surface flow, interflow, and groundwater recharge. Available blue water is displayed as a flux (centimeters/year).\n\n* **Water stress**: an indicator of competition for water resources defined informally as the ratio of demand for water by human society divided by available water. It can be classified into six categories: -1: Arid and low water use, 0: Low (<10%), 1: Low-medium (10-20%), 2: Medium-high (20-40%), 3: High (40-80%), 4: Extremely high (>80%).\n\n* **Water depletion**: the ratio of total water consumption to available renewable water supplies. Total water consumption includes domestic, industrial, irrigation, and livestock consumptive uses. Available renewable water supplies include the impact of upstream consumptive water users and large dams on downstream water availability. Higher values indicate larger impact on the local water supply and decreased water availability for downstream users. Water depletion is similar to water stress; however, instead of looking at total water demand, water depletion is calculated using consumptive withdrawal only. It can be classified into six categories: -1: Arid and low water use, 0 : Low (<5%), 1: Low-medium (5-25%), 2 : Medium-high (25-50%), 3: High (50-75%), 4 : Extremely high (>75%).\n\n[Aqueduct 4.0 FAQ](https://github.com/wri/Aqueduct40/blob/master/data_FAQ.md) explains why the water supply and demand values are measured as fluxes instead of volumes. Volumes (cubic meters) can vary significantly based on the size of each sub-basin, potentially misleading as they might primarily reflect a larger geographical area rather than indicating a higher rate of water flow. On the other hand, fluxes (centimeters/year), which measure the rate of water flow, offer a more direct and equitable means of comparing water availability between different sub-basins. Volume = Flux x Area.\n\nThe spatial resolution is 5 \u00d7 5 arc minutes which equates roughly to 10 kilometer (km) \u00d7 10 km pixels.\nThe future projections were created using CMIP6 climate forcings based on three future scenarios: optimistic (ssp126), business-as-usual (ssp370), and pessimistic (ssp585) available at [HYPFLOWSCI6](https://public.yoda.uu.nl/geo/UU01/YM7A5H.html). WRI's original data are presented at the HydroBASINS Level 6 scale. Indicators are available for periods: 'historical' (averaged over 1979-2019), 2030 (2015-2045), 2050 (2035-2065) and 2080 (2065-2095).\n", "map": { "colormap": { "min_index": 1, @@ -2470,7 +2470,7 @@ "display_groups": [ "Water depletion (Aqueduct 4.0)" ], - "description": "The World Resources Institute (WRI) [Aqueduct 4.0](https://www.wri.org/data/aqueduct-global-maps-40-data) is the latest iteration of [WRI\u2019s water risk framework](https://www.wri.org/data/aqueduct-water-risk-atlas) designed to translate complex \nhydrological data into intuitive indicators of water-related risk:\n\n* **Water demand**: gross demand is the maximum potential water required to meet sectoral demands. Sectoral water demand includes: domestic, industrial, irrigation, and livestock. Demand is displayed as a flux (centimeters/year).\n\n* **Water supply**: available blue water, the total amount of renewable freshwater available to a sub-basin with upstream consumption removed, includes surface flow, interflow, and groundwater recharge. Available blue water is displayed as a flux (centimeters/year).\n\n* **Water stress**: an indicator of competition for water resources defined informally as the ratio of demand for water by human society divided by available water. It can be classified into six categories: -1: Arid and low water use, 0: Low (<10%), 1: Low-medium (10-20%), 2: Medium-high (20-40%), 3: High (40-80%), 4: Extremely high (>80%).\n\n* **Water depletion**: the ratio of total water consumption to available renewable water supplies. Total water consumption includes domestic, industrial, irrigation, and livestock consumptive uses. Available renewable water supplies include the impact of upstream consumptive water users and large dams on downstream water availability. Higher values indicate larger impact on the local water supply and decreased water availability for downstream users. Water depletion is similar to water stress; however, instead of looking at total water demand, water depletion is calculated using consumptive withdrawal only. It can be classified into six categories: -1: Arid and low water use, 0 : Low (<5%), 1: Low-medium (5-25%), 2 : Medium-high (25-50%), 3: High (50-75%), 4 : Extremely high (>75%).\n\n[Aqueduct 4.0 FAQ](https://github.com/wri/Aqueduct40/blob/master/data_FAQ.md) explains why the water supply and demand values are measured as fluxes instead of volumes. Volumes (cubic meters) can vary significantly based on the size of each sub-basin, potentially misleading as they might primarily reflect a larger geographical area rather than indicating a higher rate of water flow. On the other hand, fluxes (centimeters/year), which measure the rate of water flow, offer a more direct and equitable means of comparing water availability between different sub-basins. Volume = Flux x Area.\n\nThe spatial resolution is 5 \u00d7 5 arc minutes which equates roughly to 10 kilometer (km) \u00d7 10 km pixels. \nThe future projections were created using CMIP6 climate forcings based on three future scenarios: optimistic (ssp126), business-as-usual (ssp370), and pessimistic (ssp585) available at [HYPFLOWSCI6](https://public.yoda.uu.nl/geo/UU01/YM7A5H.html). WRI's original data are presented at the HydroBASINS Level 6 scale. Indicators are available for periods: 'historical' (averaged over 1979-2019), 2030 (2015-2045), 2050 (2035-2065) and 2080 (2065-2095).", + "description": "The World Resources Institute (WRI) [Aqueduct 4.0](https://www.wri.org/data/aqueduct-global-maps-40-data) is the latest iteration of [WRI\u2019s water risk framework](https://www.wri.org/data/aqueduct-water-risk-atlas) designed to translate complex\nhydrological data into intuitive indicators of water-related risk:\n\n* **Water demand**: gross demand is the maximum potential water required to meet sectoral demands. Sectoral water demand includes: domestic, industrial, irrigation, and livestock. Demand is displayed as a flux (centimeters/year).\n\n* **Water supply**: available blue water, the total amount of renewable freshwater available to a sub-basin with upstream consumption removed, includes surface flow, interflow, and groundwater recharge. Available blue water is displayed as a flux (centimeters/year).\n\n* **Water stress**: an indicator of competition for water resources defined informally as the ratio of demand for water by human society divided by available water. It can be classified into six categories: -1: Arid and low water use, 0: Low (<10%), 1: Low-medium (10-20%), 2: Medium-high (20-40%), 3: High (40-80%), 4: Extremely high (>80%).\n\n* **Water depletion**: the ratio of total water consumption to available renewable water supplies. Total water consumption includes domestic, industrial, irrigation, and livestock consumptive uses. Available renewable water supplies include the impact of upstream consumptive water users and large dams on downstream water availability. Higher values indicate larger impact on the local water supply and decreased water availability for downstream users. Water depletion is similar to water stress; however, instead of looking at total water demand, water depletion is calculated using consumptive withdrawal only. It can be classified into six categories: -1: Arid and low water use, 0 : Low (<5%), 1: Low-medium (5-25%), 2 : Medium-high (25-50%), 3: High (50-75%), 4 : Extremely high (>75%).\n\n[Aqueduct 4.0 FAQ](https://github.com/wri/Aqueduct40/blob/master/data_FAQ.md) explains why the water supply and demand values are measured as fluxes instead of volumes. Volumes (cubic meters) can vary significantly based on the size of each sub-basin, potentially misleading as they might primarily reflect a larger geographical area rather than indicating a higher rate of water flow. On the other hand, fluxes (centimeters/year), which measure the rate of water flow, offer a more direct and equitable means of comparing water availability between different sub-basins. Volume = Flux x Area.\n\nThe spatial resolution is 5 \u00d7 5 arc minutes which equates roughly to 10 kilometer (km) \u00d7 10 km pixels.\nThe future projections were created using CMIP6 climate forcings based on three future scenarios: optimistic (ssp126), business-as-usual (ssp370), and pessimistic (ssp585) available at [HYPFLOWSCI6](https://public.yoda.uu.nl/geo/UU01/YM7A5H.html). WRI's original data are presented at the HydroBASINS Level 6 scale. Indicators are available for periods: 'historical' (averaged over 1979-2019), 2030 (2015-2045), 2050 (2035-2065) and 2080 (2065-2095).\n", "map": { "colormap": { "min_index": 1, @@ -2549,7 +2549,7 @@ "display_groups": [ "Water stress category (Aqueduct 4.0)" ], - "description": "The World Resources Institute (WRI) [Aqueduct 4.0](https://www.wri.org/data/aqueduct-global-maps-40-data) is the latest iteration of [WRI\u2019s water risk framework](https://www.wri.org/data/aqueduct-water-risk-atlas) designed to translate complex \nhydrological data into intuitive indicators of water-related risk:\n\n* **Water demand**: gross demand is the maximum potential water required to meet sectoral demands. Sectoral water demand includes: domestic, industrial, irrigation, and livestock. Demand is displayed as a flux (centimeters/year).\n\n* **Water supply**: available blue water, the total amount of renewable freshwater available to a sub-basin with upstream consumption removed, includes surface flow, interflow, and groundwater recharge. Available blue water is displayed as a flux (centimeters/year).\n\n* **Water stress**: an indicator of competition for water resources defined informally as the ratio of demand for water by human society divided by available water. It can be classified into six categories: -1: Arid and low water use, 0: Low (<10%), 1: Low-medium (10-20%), 2: Medium-high (20-40%), 3: High (40-80%), 4: Extremely high (>80%).\n\n* **Water depletion**: the ratio of total water consumption to available renewable water supplies. Total water consumption includes domestic, industrial, irrigation, and livestock consumptive uses. Available renewable water supplies include the impact of upstream consumptive water users and large dams on downstream water availability. Higher values indicate larger impact on the local water supply and decreased water availability for downstream users. Water depletion is similar to water stress; however, instead of looking at total water demand, water depletion is calculated using consumptive withdrawal only. It can be classified into six categories: -1: Arid and low water use, 0 : Low (<5%), 1: Low-medium (5-25%), 2 : Medium-high (25-50%), 3: High (50-75%), 4 : Extremely high (>75%).\n\n[Aqueduct 4.0 FAQ](https://github.com/wri/Aqueduct40/blob/master/data_FAQ.md) explains why the water supply and demand values are measured as fluxes instead of volumes. Volumes (cubic meters) can vary significantly based on the size of each sub-basin, potentially misleading as they might primarily reflect a larger geographical area rather than indicating a higher rate of water flow. On the other hand, fluxes (centimeters/year), which measure the rate of water flow, offer a more direct and equitable means of comparing water availability between different sub-basins. Volume = Flux x Area.\n\nThe spatial resolution is 5 \u00d7 5 arc minutes which equates roughly to 10 kilometer (km) \u00d7 10 km pixels. \nThe future projections were created using CMIP6 climate forcings based on three future scenarios: optimistic (ssp126), business-as-usual (ssp370), and pessimistic (ssp585) available at [HYPFLOWSCI6](https://public.yoda.uu.nl/geo/UU01/YM7A5H.html). WRI's original data are presented at the HydroBASINS Level 6 scale. Indicators are available for periods: 'historical' (averaged over 1979-2019), 2030 (2015-2045), 2050 (2035-2065) and 2080 (2065-2095).", + "description": "The World Resources Institute (WRI) [Aqueduct 4.0](https://www.wri.org/data/aqueduct-global-maps-40-data) is the latest iteration of [WRI\u2019s water risk framework](https://www.wri.org/data/aqueduct-water-risk-atlas) designed to translate complex\nhydrological data into intuitive indicators of water-related risk:\n\n* **Water demand**: gross demand is the maximum potential water required to meet sectoral demands. Sectoral water demand includes: domestic, industrial, irrigation, and livestock. Demand is displayed as a flux (centimeters/year).\n\n* **Water supply**: available blue water, the total amount of renewable freshwater available to a sub-basin with upstream consumption removed, includes surface flow, interflow, and groundwater recharge. Available blue water is displayed as a flux (centimeters/year).\n\n* **Water stress**: an indicator of competition for water resources defined informally as the ratio of demand for water by human society divided by available water. It can be classified into six categories: -1: Arid and low water use, 0: Low (<10%), 1: Low-medium (10-20%), 2: Medium-high (20-40%), 3: High (40-80%), 4: Extremely high (>80%).\n\n* **Water depletion**: the ratio of total water consumption to available renewable water supplies. Total water consumption includes domestic, industrial, irrigation, and livestock consumptive uses. Available renewable water supplies include the impact of upstream consumptive water users and large dams on downstream water availability. Higher values indicate larger impact on the local water supply and decreased water availability for downstream users. Water depletion is similar to water stress; however, instead of looking at total water demand, water depletion is calculated using consumptive withdrawal only. It can be classified into six categories: -1: Arid and low water use, 0 : Low (<5%), 1: Low-medium (5-25%), 2 : Medium-high (25-50%), 3: High (50-75%), 4 : Extremely high (>75%).\n\n[Aqueduct 4.0 FAQ](https://github.com/wri/Aqueduct40/blob/master/data_FAQ.md) explains why the water supply and demand values are measured as fluxes instead of volumes. Volumes (cubic meters) can vary significantly based on the size of each sub-basin, potentially misleading as they might primarily reflect a larger geographical area rather than indicating a higher rate of water flow. On the other hand, fluxes (centimeters/year), which measure the rate of water flow, offer a more direct and equitable means of comparing water availability between different sub-basins. Volume = Flux x Area.\n\nThe spatial resolution is 5 \u00d7 5 arc minutes which equates roughly to 10 kilometer (km) \u00d7 10 km pixels.\nThe future projections were created using CMIP6 climate forcings based on three future scenarios: optimistic (ssp126), business-as-usual (ssp370), and pessimistic (ssp585) available at [HYPFLOWSCI6](https://public.yoda.uu.nl/geo/UU01/YM7A5H.html). WRI's original data are presented at the HydroBASINS Level 6 scale. Indicators are available for periods: 'historical' (averaged over 1979-2019), 2030 (2015-2045), 2050 (2035-2065) and 2080 (2065-2095).\n", "map": { "colormap": { "min_index": 1, @@ -2628,7 +2628,7 @@ "display_groups": [ "Water depletion category (Aqueduct 4.0)" ], - "description": "The World Resources Institute (WRI) [Aqueduct 4.0](https://www.wri.org/data/aqueduct-global-maps-40-data) is the latest iteration of [WRI\u2019s water risk framework](https://www.wri.org/data/aqueduct-water-risk-atlas) designed to translate complex \nhydrological data into intuitive indicators of water-related risk:\n\n* **Water demand**: gross demand is the maximum potential water required to meet sectoral demands. Sectoral water demand includes: domestic, industrial, irrigation, and livestock. Demand is displayed as a flux (centimeters/year).\n\n* **Water supply**: available blue water, the total amount of renewable freshwater available to a sub-basin with upstream consumption removed, includes surface flow, interflow, and groundwater recharge. Available blue water is displayed as a flux (centimeters/year).\n\n* **Water stress**: an indicator of competition for water resources defined informally as the ratio of demand for water by human society divided by available water. It can be classified into six categories: -1: Arid and low water use, 0: Low (<10%), 1: Low-medium (10-20%), 2: Medium-high (20-40%), 3: High (40-80%), 4: Extremely high (>80%).\n\n* **Water depletion**: the ratio of total water consumption to available renewable water supplies. Total water consumption includes domestic, industrial, irrigation, and livestock consumptive uses. Available renewable water supplies include the impact of upstream consumptive water users and large dams on downstream water availability. Higher values indicate larger impact on the local water supply and decreased water availability for downstream users. Water depletion is similar to water stress; however, instead of looking at total water demand, water depletion is calculated using consumptive withdrawal only. It can be classified into six categories: -1: Arid and low water use, 0 : Low (<5%), 1: Low-medium (5-25%), 2 : Medium-high (25-50%), 3: High (50-75%), 4 : Extremely high (>75%).\n\n[Aqueduct 4.0 FAQ](https://github.com/wri/Aqueduct40/blob/master/data_FAQ.md) explains why the water supply and demand values are measured as fluxes instead of volumes. Volumes (cubic meters) can vary significantly based on the size of each sub-basin, potentially misleading as they might primarily reflect a larger geographical area rather than indicating a higher rate of water flow. On the other hand, fluxes (centimeters/year), which measure the rate of water flow, offer a more direct and equitable means of comparing water availability between different sub-basins. Volume = Flux x Area.\n\nThe spatial resolution is 5 \u00d7 5 arc minutes which equates roughly to 10 kilometer (km) \u00d7 10 km pixels. \nThe future projections were created using CMIP6 climate forcings based on three future scenarios: optimistic (ssp126), business-as-usual (ssp370), and pessimistic (ssp585) available at [HYPFLOWSCI6](https://public.yoda.uu.nl/geo/UU01/YM7A5H.html). WRI's original data are presented at the HydroBASINS Level 6 scale. Indicators are available for periods: 'historical' (averaged over 1979-2019), 2030 (2015-2045), 2050 (2035-2065) and 2080 (2065-2095).", + "description": "The World Resources Institute (WRI) [Aqueduct 4.0](https://www.wri.org/data/aqueduct-global-maps-40-data) is the latest iteration of [WRI\u2019s water risk framework](https://www.wri.org/data/aqueduct-water-risk-atlas) designed to translate complex\nhydrological data into intuitive indicators of water-related risk:\n\n* **Water demand**: gross demand is the maximum potential water required to meet sectoral demands. Sectoral water demand includes: domestic, industrial, irrigation, and livestock. Demand is displayed as a flux (centimeters/year).\n\n* **Water supply**: available blue water, the total amount of renewable freshwater available to a sub-basin with upstream consumption removed, includes surface flow, interflow, and groundwater recharge. Available blue water is displayed as a flux (centimeters/year).\n\n* **Water stress**: an indicator of competition for water resources defined informally as the ratio of demand for water by human society divided by available water. It can be classified into six categories: -1: Arid and low water use, 0: Low (<10%), 1: Low-medium (10-20%), 2: Medium-high (20-40%), 3: High (40-80%), 4: Extremely high (>80%).\n\n* **Water depletion**: the ratio of total water consumption to available renewable water supplies. Total water consumption includes domestic, industrial, irrigation, and livestock consumptive uses. Available renewable water supplies include the impact of upstream consumptive water users and large dams on downstream water availability. Higher values indicate larger impact on the local water supply and decreased water availability for downstream users. Water depletion is similar to water stress; however, instead of looking at total water demand, water depletion is calculated using consumptive withdrawal only. It can be classified into six categories: -1: Arid and low water use, 0 : Low (<5%), 1: Low-medium (5-25%), 2 : Medium-high (25-50%), 3: High (50-75%), 4 : Extremely high (>75%).\n\n[Aqueduct 4.0 FAQ](https://github.com/wri/Aqueduct40/blob/master/data_FAQ.md) explains why the water supply and demand values are measured as fluxes instead of volumes. Volumes (cubic meters) can vary significantly based on the size of each sub-basin, potentially misleading as they might primarily reflect a larger geographical area rather than indicating a higher rate of water flow. On the other hand, fluxes (centimeters/year), which measure the rate of water flow, offer a more direct and equitable means of comparing water availability between different sub-basins. Volume = Flux x Area.\n\nThe spatial resolution is 5 \u00d7 5 arc minutes which equates roughly to 10 kilometer (km) \u00d7 10 km pixels.\nThe future projections were created using CMIP6 climate forcings based on three future scenarios: optimistic (ssp126), business-as-usual (ssp370), and pessimistic (ssp585) available at [HYPFLOWSCI6](https://public.yoda.uu.nl/geo/UU01/YM7A5H.html). WRI's original data are presented at the HydroBASINS Level 6 scale. Indicators are available for periods: 'historical' (averaged over 1979-2019), 2030 (2015-2045), 2050 (2035-2065) and 2080 (2065-2095).\n", "map": { "colormap": { "min_index": 1, diff --git a/tests/utilities.py b/tests/conftest.py similarity index 100% rename from tests/utilities.py rename to tests/conftest.py diff --git a/tests/drought_indicators_test.py b/tests/drought_indicators_test.py index 275986c..0cfae46 100644 --- a/tests/drought_indicators_test.py +++ b/tests/drought_indicators_test.py @@ -1,22 +1,16 @@ import json import os from datetime import datetime, timedelta -from os import path import dask.array as da -import fsspec.implementations.local as local # type: ignore import numpy as np import pytest -import s3fs # type: ignore import xarray as xr import zarr # type: ignore from hazard.docs_store import DocStore from hazard.models.drought_index import DroughtIndicator, LocalZarrWorkingStore, ProgressStore, S3ZarrWorkingStore -from hazard.sources.osc_zarr import OscZarr -from hazard.utilities.tiles import create_tiles_for_resource - -from .utilities import TestTarget, s3_credentials, test_output_dir +from tests.conftest import TestTarget @pytest.mark.skip(reason="incomplete") @@ -28,7 +22,7 @@ def test_spei_indicator(test_output_dir, s3_credentials): working_store = LocalZarrWorkingStore(test_output_dir) model = DroughtIndicator(working_store) model.calculate_spei(gcm, scenario, progress_store=ProgressStore(test_output_dir, "spei_prog_store")) - target = TestTarget() + # target = TestTarget() data_chunks = model.get_datachunks() test_chunk = data_chunks["Chunk_0255"] lat_min, lat_max = test_chunk["lat_min"], test_chunk["lat_max"] @@ -44,9 +38,9 @@ def test_spei_indicator(test_output_dir, s3_credentials): ) ds_tas_local = ds_tas.compute() series_tas = ds_tas_local["tas"][0, 0, :].values - ds_pr = model.read_quantity_from_s3_store(gcm, scenario, "pr", lat_min, lat_max, lon_min, lon_max).chunk( - {"time": 100000} - ) + # ds_pr = model.read_quantity_from_s3_store(gcm, scenario, "pr", lat_min, lat_max, lon_min, lon_max).chunk( + # {"time": 100000} + # ) series_pr = ds_tas_local["tas"][0, 0, :].values with open(os.path.join(test_output_dir, "drought", "data.json")) as f: @@ -74,7 +68,7 @@ def test_partial_write_zarr(test_output_dir): ).chunk(chunks={"lat": 40, "lon": 40, "time": 100000}) ds_spei = da_spei.to_dataset(name="spei") ds_spei.to_zarr(store=zarr_store, mode="w", compute=False) - # see https://docs.xarray.dev/en/stable/user-guide/io.html?appending-to-existing-zarr-stores=#appending-to-existing-zarr-stores + # see https://docs.xarray.dev/en/stable/user-guide/io.html?appending-to-existing-zarr-stores=#appending-to-existing-zarr-stores # noqa: E501 sliced = ds_spei.sel(lat=slice(10, 20), lon=slice(30, 40)) lat_indexes = np.where(np.logical_and(ds_spei["lat"].values >= 10, ds_spei["lat"].values <= 20))[0] lon_indexes = np.where(np.logical_and(ds_spei["lon"].values >= 30, ds_spei["lon"].values <= 40))[0] diff --git a/tests/heat_indicators_test.py b/tests/heat_indicators_test.py index d1dc466..52c31c8 100644 --- a/tests/heat_indicators_test.py +++ b/tests/heat_indicators_test.py @@ -19,9 +19,9 @@ from hazard.protocols import OpenDataset, WriteDataset from hazard.sources.nex_gddp_cmip6 import NexGddpCmip6 from hazard.sources.osc_zarr import OscZarr -from tests.utilities import TestSource, TestTarget, _create_test_dataset_averaged, _create_test_datasets_tas +from tests.conftest import TestSource, TestTarget, _create_test_dataset_averaged, _create_test_datasets_tas -from .utilities import _create_test_datasets_hurs, test_output_dir +from .conftest import _create_test_datasets_hurs, test_output_dir # noqa: F401; pylint: disable=unused-variable def test_degree_days_mocked(): @@ -84,7 +84,7 @@ def test_work_loss_mocked(): ) -def test_zarr_read_write(test_output_dir): +def test_zarr_read_write(test_output_dir): # noqa: F811 """Test that an xarray can be stored in xarray's native zarr format and then read from the zarr array alone using attributes and ignoring coordinates. """ @@ -98,7 +98,7 @@ def test_zarr_read_write(test_output_dir): @pytest.mark.skip(reason="inputs large and downloading slow") -def test_degree_days(test_output_dir): +def test_degree_days(test_output_dir): # noqa: F811 """Cut-down but still *slow* test that performs downloading of real datasets.""" gcm = "NorESM2-MM" scenario = "ssp585" @@ -131,7 +131,7 @@ def test_degree_days(test_output_dir): @pytest.mark.skip(reason="inputs large and downloading slow") -def test_work_loss(test_output_dir): +def test_work_loss(test_output_dir): # noqa: F811 """Cut-down but still *slow* test that performs downloading of real datasets.""" gcm = "NorESM2-MM" scenario = "ssp585" @@ -145,9 +145,9 @@ def test_work_loss(test_output_dir): target = OscZarr(store=store) # cut down the model and run model = WorkLossIndicator(window_years=3, gcms=[gcm], scenarios=[scenario], central_years=[years[1]]) - resources = list(model.inventory()) - models = HazardResources(resources=resources) - json_str = json.dumps(models.dict(), indent=4) # pretty print + # resources = list(model.inventory()) + # models = HazardResources(resources=resources) + # json_str = json.dumps(models.dict(), indent=4) # pretty print local_fs = local.LocalFileSystem() docs_store = DocStore(bucket=test_output_dir, fs=local_fs, prefix="hazard_test") @@ -161,7 +161,7 @@ def test_example_run_degree_days(): zarr_utilities.set_credential_env_variables() docs_store = DocStore(prefix="hazard_test") - json = docs_store.read_inventory_json() + # json = docs_store.read_inventory_json() cluster = LocalCluster(processes=False) client = Client(cluster) @@ -181,7 +181,7 @@ def test_example_run_degree_days(): assert True -def download_test_datasets(test_output_dir, gcm, scenario, years, indicators=["tasmax"]): +def download_test_datasets(test_output_dir, gcm, scenario, years, indicators=["tasmax"]): # noqa: F811 store = NexGddpCmip6() s3 = s3fs.S3FileSystem(anon=True) for year in years: @@ -193,7 +193,7 @@ def download_test_datasets(test_output_dir, gcm, scenario, years, indicators=["t @pytest.mark.skip(reason="just example") -def test_load_dataset(test_output_dir): +def test_load_dataset(test_output_dir): # noqa: F811 fs = local.LocalFileSystem() store = NexGddpCmip6(root=os.path.join(test_output_dir, "nex-gddp-cmip6"), fs=fs) with store.open_dataset_year("NorESM2-MM", "ssp585", "tasmax", 2029) as ds: diff --git a/tests/inventory_test.py b/tests/inventory_test.py index 3ba7da4..12609a1 100644 --- a/tests/inventory_test.py +++ b/tests/inventory_test.py @@ -16,17 +16,17 @@ from hazard.onboard.wri_aqueduct_water_risk import WRIAqueductWaterRisk from hazard.utilities import zarr_utilities # type: ignore -from .utilities import test_output_dir +from .conftest import test_output_dir -def test_create_inventory(test_output_dir): +def test_create_inventory(test_output_dir): # noqa: F811 """Create inventory for all indicators and write into this repo.""" zarr_utilities.set_credential_env_variables() local_fs = local.LocalFileSystem() from pathlib import Path - path = os.path.join(Path(__file__).parents[1], "inventories") + path = os.path.join(Path(__file__).parents[1], "src", "inventories") # path = os.path.join(test_output_dir) @@ -54,7 +54,7 @@ def test_create_inventory(test_output_dir): @pytest.mark.skip(reason="just example") -def test_check_inventory(test_output_dir): +def test_check_inventory(test_output_dir): # noqa: F811 zarr_utilities.set_credential_env_variables() prefix = "hazard" docs_store = DocStore(prefix=prefix) diff --git a/tests/onboarding_test.py b/tests/onboarding_test.py index b1831e3..bb1e144 100644 --- a/tests/onboarding_test.py +++ b/tests/onboarding_test.py @@ -55,7 +55,7 @@ def test_wri_aqueduct(test_output_dir, s3_credentials, log_to_stdout): model = WRIAqueductFlood() items = model.batch_items() print(items) - source = WRIAqueductSource() + # source = WRIAqueductSource() target = OscZarr() # target = OscZarr(store=zarr.DirectoryStore(os.path.join(test_output_dir, 'hazard', 'hazard.zarr'))) s3 = s3fs.S3FileSystem( @@ -78,7 +78,8 @@ def test_iris(test_output_dir, s3_credentials): # copy_iris_files(s3_credentials) # promote_iris(s3_credentials) model = IRISIndicator(test_output_dir) - # s3 = s3fs.S3FileSystem(anon=False, key=os.environ["OSC_S3_ACCESS_KEY_DEV"], secret=os.environ["OSC_S3_SECRET_KEY_DEV"]) + # s3 = s3fs.S3FileSystem(anon=False, key=os.environ["OSC_S3_ACCESS_KEY_DEV"], + # secret=os.environ["OSC_S3_SECRET_KEY_DEV"]) target = OscZarr(store=zarr.DirectoryStore(os.path.join(test_output_dir, "hazard", "hazard.zarr"))) # save locally # target = OscZarr() # default dev bucket for item in model.batch_items(): @@ -150,7 +151,7 @@ def test_check_result(test_output_dir): "v1", ) check = s3.ls(path) - assert True + assert check is not None @pytest.mark.skip(reason="on-boarding script") diff --git a/tests/temperature_indicators_test.py b/tests/temperature_indicators_test.py index 5df0cbe..e3ad474 100644 --- a/tests/temperature_indicators_test.py +++ b/tests/temperature_indicators_test.py @@ -13,7 +13,7 @@ from hazard.sources.nex_gddp_cmip6 import NexGddpCmip6 from hazard.sources.osc_zarr import OscZarr # type: ignore -from .utilities import TestSource, TestTarget, _create_test_datasets_hurs, _create_test_datasets_tas, test_output_dir +from .conftest import TestSource, TestTarget, _create_test_datasets_hurs, _create_test_datasets_tas, test_output_dir def test_days_tas_above_mocked(): @@ -86,7 +86,7 @@ def test_days_wbgt_above_mocked(): @pytest.mark.skip(reason="inputs large and downloading slow") -def test_days_tas_above(test_output_dir): +def test_days_tas_above(test_output_dir): # noqa: F811 """Test an air temperature indicator that provides days over $x$ degrees.""" gcm = "NorESM2-MM" scenario = "ssp585" @@ -109,7 +109,7 @@ def test_days_tas_above(test_output_dir): model.run_all(source, target) -def download_test_datasets(test_output_dir, gcm, scenario, years, indicators=["tas"]): +def download_test_datasets(test_output_dir, gcm, scenario, years, indicators=["tas"]): # noqa: F811 store = NexGddpCmip6() s3 = s3fs.S3FileSystem(anon=True) for year in years: diff --git a/tests/tile_creation_test.py b/tests/tile_creation_test.py index 89c292c..932efd4 100644 --- a/tests/tile_creation_test.py +++ b/tests/tile_creation_test.py @@ -18,26 +18,26 @@ from hazard.utilities import zarr_utilities from hazard.utilities.tiles import create_tile_set, create_tiles_for_resource -from .utilities import test_output_dir +from .conftest import test_output_dir # noqa: F401 @pytest.mark.skip(reason="Example not test") -def test_xarray_writing(test_output_dir): - lat = np.arange(90, -90, -0.01) - lon = np.arange(-180, 180, 0.01) - - x = xr.Dataset( - coords={ - "lat": (["lat"], lat), - "lon": (["lon"], lon), - }, - data_vars={ - "dsm": ( - ["lat", "lon"], - dask.array.empty((lat.size, lon.size), chunks=(1024, 1024), dtype="uint8"), - ) - }, - ) +def test_xarray_writing(test_output_dir): # noqa: F811 + # lat = np.arange(90, -90, -0.01) + # lon = np.arange(-180, 180, 0.01) + + # x = xr.Dataset( + # coords={ + # "lat": (["lat"], lat), + # "lon": (["lon"], lon), + # }, + # data_vars={ + # "dsm": ( + # ["lat", "lon"], + # dask.array.empty((lat.size, lon.size), chunks=(1024, 1024), dtype="uint8"), + # ) + # }, + # ) store = zarr.DirectoryStore(os.path.join(test_output_dir, "hazard_test/test")) y = xr.open_zarr(store) y.dsm[0:256, 0:256] = np.random.randn(256, 256) @@ -45,7 +45,7 @@ def test_xarray_writing(test_output_dir): @pytest.mark.skip(reason="Example not test") -def test_map_tiles_from_model(test_output_dir): +def test_map_tiles_from_model(test_output_dir): # noqa: F811 local_store = zarr.DirectoryStore(os.path.join(test_output_dir, "hazard_test", "hazard.zarr")) source = OscZarr(store=local_store) target = source @@ -67,7 +67,7 @@ def test_map_tiles_from_model(test_output_dir): @pytest.mark.skip(reason="Requires mocking") -def test_convert_tiles(test_output_dir): +def test_convert_tiles(test_output_dir): # noqa: F811 """We are combining useful logic from a few sources. rio_tiler and titiler are very useful and also: https://github.com/mapbox/rio-mbtiles @@ -94,7 +94,7 @@ def test_convert_tiles(test_output_dir): create_tile_set(source, path, target, map_path) -def copy_zarr_local(test_output_dir, path): +def copy_zarr_local(test_output_dir, path): # noqa: F811 local_store = zarr.DirectoryStore(os.path.join(test_output_dir, "hazard_test", "hazard.zarr")) dest = zarr.open_group(store=local_store, mode="r+") if path not in dest: diff --git a/tests/utilities_test.py b/tests/utilities_test.py index 871c76b..3638ef8 100644 --- a/tests/utilities_test.py +++ b/tests/utilities_test.py @@ -8,10 +8,10 @@ from hazard.sources.osc_zarr import OscZarr from hazard.utilities.xarray_utilities import data_array, empty_data_array, global_crs_transform -from .utilities import test_output_dir +from .conftest import test_output_dir -def test_xarray_write_small(test_output_dir): +def test_xarray_write_small(test_output_dir): # noqa: F811 _, affine = global_crs_transform(3600, 1800) da = empty_data_array(3600, 1800, affine) x = np.linspace(0, 1, 3600) diff --git a/tests/water_temp_indicators_test.py b/tests/water_temp_indicators_test.py index 8e9dab3..e881862 100644 --- a/tests/water_temp_indicators_test.py +++ b/tests/water_temp_indicators_test.py @@ -4,7 +4,7 @@ from hazard.models.water_temp import FutureStreamsSource, WaterTemperatureAboveIndicator -from .utilities import TestSource, TestTarget, _create_test_datasets_tas +from .conftest import TestSource, TestTarget, _create_test_datasets_tas def test_future_streams_source(): diff --git a/tests/wind_onboarding_test.py b/tests/wind_onboarding_test.py index 500bf36..d10ddaf 100644 --- a/tests/wind_onboarding_test.py +++ b/tests/wind_onboarding_test.py @@ -7,11 +7,11 @@ from hazard.onboard.storm_wind import BatchItem, STORMIndicator # type: ignore from hazard.sources.osc_zarr import OscZarr -from .utilities import test_output_dir +from .conftest import test_output_dir @pytest.mark.skip(reason="on-boarding script") -def test_wind_onboarding(test_output_dir): +def test_wind_onboarding(test_output_dir): # noqa: F811 target = OscZarr(store=zarr.DirectoryStore(os.path.join(test_output_dir, "hazard", "hazard.zarr"))) model = STORMIndicator(os.path.join(test_output_dir, "wind")) model.run_single(BatchItem(gcm="HADGEM3-GC31-HM", model=""), None, target, None) diff --git a/tox.ini b/tox.ini deleted file mode 100644 index 9ccadae..0000000 --- a/tox.ini +++ /dev/null @@ -1,35 +0,0 @@ -[tox] -envlist = py38, static - -[testenv] -deps = - pytest -commands = pytest {posargs} - -[testenv:static] -deps = - mypy - isort - black - flake8 -commands = - mypy --install-types --non-interactive src - isort --check . - black --check . - flake8 src - -[testenv:cov] -usedevelop = True -deps = - pytest-cov -commands = pytest --cov-report=html {posargs} - -[flake8] -count = True -max-line-length = 120 -max-complexity = 10 -# Allow __init__ files to have unused imports. -per-file-ignores = __init__.py:F401 -extend-ignore = - # Allow spacing before colon (to favor Black). - E203