Skip to content

Commit

Permalink
deploy: 25e44bd
Browse files Browse the repository at this point in the history
  • Loading branch information
matamadio committed Oct 13, 2023
1 parent 00fe3ee commit 78e21b6
Show file tree
Hide file tree
Showing 32 changed files with 168 additions and 158 deletions.
9 changes: 2 additions & 7 deletions _sources/docs/EAI.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,10 @@ align: center

- The exposure and impact estimates are then summarised for the chosen administrative boundary (ADM) level using `zonal statistic`. The expected annual impact (EAI) is computed by multiplying the impact value with its exceedence frequency depending on the scenario. The `exceedance frequency curve (EFC)` is plotted. These outputs represent the core of the disaster risk historical baseline. The output is exported in form of tables, statistics, charts (excel format) and maps (geopackage).

## DATA MANAGEMENT

- Download country boundaries for multiple administrative levels sourced from [HDX](https://data.humdata.org/dataset) or [Geoboundaries](https://www.geoboundaries.org). Note that oftern there are several versions for the same country, so be sure to use the most updated from official agencies (eg. United Nations). Verify that shapes, names and codes are consistent across different levels.
- Download [exposure data](global-exposure.md).
- Download probabilistic [hazard data](global-hazard.md), consisting of multiple RP scenarios.

## SETUP THE NOTEBOOK

- Create environment and folder structure as explained in [tool setup](tool-setup.md)
As explained in [tool setup](tool-setup.md):
- Create environment and folder structure
- Move verified input data into the tools folders
- Use the interface to select the settings and start the processing

Expand Down
75 changes: 42 additions & 33 deletions _sources/docs/tool-setup.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Tools setup
# TOOLS SETUP

The analytical scripts can be downloaded as:

Expand All @@ -7,24 +7,39 @@ Read more about [**Jupyter Notebooks**](https://jupyter-notebook.readthedocs.io/
- [**Python code**](https://github.com/GFDRR/CCDR-tools/tree/main/Top-down/parallelization): give the user more control, and has overall better performances making use of parallel processing.

These can be downloaded and exectuted on any windows or linux machine.
In both cases, the script expects input data to be provided according to some rules.
In both cases, the script requires proper environment setup and input data to be provided according to the instructions below.

### Expected directories and input format
## Python environment

The script expects input data folders to be structured as:
- Python 3 needs to be installed on your system. We suggest the latest [Anaconda](https://www.anaconda.com/download) distribution. Mamba is also encouraged.
- Create new `CCDR-tools` environment according to your operating system: win.yml or linux.yml.
In Anaconda cmd prompt:

```
Work dir/
- Hazard.ipynb
- common.py
- Data/
- ADM Administrative unit layer for each country
- HZD Hazard layers
- EXP Exposure layers - Population (count), Built-up (ratio or binary), Agriculture (ratio or binary)
- RSK Output directory
```
`conda create --name CCDR --file <dir/win_env.yml>`

`activate CCDR`

## Input data management

- Download the latest version of the notebooks or the the parallel code.
- Create folder structure as:

```
Work dir/
- Hazard.ipynb Place the notebooks and related files in the main work directory
- common.py
- Parallel/ Place the parallel processing script in a sub-folder
- ...
- Data/
- ADM Administrative unit layer for each country
- HZD Hazard layers
- EXP Exposure layers - Population (count), Built-up (ratio or binary), Agriculture (ratio or binary)
- RSK Output directory
```

- **ADMINISTRATIVE** boundaries are provided as geopackage files named as `ISO`_ADM.gpkg (e.g. `NPL`_ADM.gpkg) made of multiple layers represening different administrative boundary levels.
- Download **country boundaries** for multiple administrative levels (national, sub-national) sourced from [HDX](https://data.humdata.org/dataset) or [Geoboundaries](https://www.geoboundaries.org). Note that oftern there are several versions for the same country, so be sure to use the most updated from official agencies (eg. United Nations). Verify that shapes, names and codes are consistent across different levels.

Boundaries must be provided as a geopackage files named as `ISO`_ADM.gpkg (e.g. `NPL`_ADM.gpkg) containing multiple layers, each one represening a different administrative boundary levels:

```
- ISO_ADM
Expand All @@ -42,7 +57,7 @@ align: center
Example of sub-national administrative boundaries for Senegal.
```

Each ADM layer should include relative ADMi_CODE and ADMi_NAME across levels to facilitate the summary of results:
Each layer should include relative ADMi_CODE and ADMi_NAME across levels to facilitate the summary of results:

- **ADM0**

Expand All @@ -68,34 +83,28 @@ Each ADM layer should include relative ADMi_CODE and ADMi_NAME across levels to
|---|---|---|---|---|---|---|---|
| Integer | String (20) | Integer | String(20) | Integer | String(20) | Integer | String(20) |

- **HAZARD** layers are expected as raster files (`.tif`) named as `ISO`_`HZD`_RPi.tif (exampe for Nepal flood, RP100: `NPL_FL_RP100.tif`). Any resolution should work, but using resolution below 90m over large countries could cause very long processing and memory cap issues.

- **EXPOSURE** are expected as raster files (`.tif`) named as `ISO`_`EXP`.tif. The same suggestion about resolution applies here.
- Download probabilistic [**hazard data**](global-hazard.md), consisting of multiple RP scenarios. Each scenario is expected as a raster file (`.tif`) named as `ISO`_`HZD`_RPi.tif (exampe for Nepal flood, RP100: `NPL_FL_RP100.tif`). Any resolution should work, but using resolution below 90m over large countries could cause very long processing and memory cap issues.

- Population from GHSL, 90 m: `ISO`_POP.tif
- Built-up from World Settlement Footprint or equivalent, 90 m: `ISO`_BU.tif
- Agriculture from land cover map, ESA land cover or equivalent, 90 m: `ISO`_AGR.tif
- Download [**exposure data**](global-exposure.md) for population, built-up and agricolture. Layers are expected as raster files (`.tif`) named as `ISO`_`EXP`.tif.
- **`ISO`_POP.tif**: Population, as from [Global Human Settlement Layer](https://ghsl.jrc.ec.europa.eu/download.php?ds=pop) or [Worldpop](https://hub.worldpop.org/geodata/listing?id=79)
- **`ISO`_BU.tif**: Built-up from [Global Human Settlement Layer](https://ghsl.jrc.ec.europa.eu/download.php?ds=bu) or [World Settlement Footprint](https://download.geoservice.dlr.de/WSF2019/)
- **`ISO`_AGR.tif**: Agriculture from land cover map, [ESA land cover](https://esa-worldcover.org/en) or equivalent

```{caution}
When resampling exposure layers to a lower resolution, it is **strongly recommended** to align the resampled grid to exactly match the hazard grid, or viceversa.
```

<img width=600 src="https://user-images.githubusercontent.com/44863827/157419284-64e16285-6284-45ba-bc9c-01eab713c2f1.png">

```{caution}
All spatial data must use the same CRS, suggested: `EPSG 4326` (WGS 84)
```
- Move verified input data into the proper folders
```{caution}
All spatial data must use the same CRS, suggested: `EPSG 4326` (WGS 84)
```
- Use the interface to select the settings and start the processing

<hr>

## Environment and libraries
- The script requires python3 - conda or mamba are encouraged
- Create a new environment named CCDR based on win_env.yml o linux_env.yml depending on your operating system.
In Anaconda cmd prompt:

`conda create --name CCDR --file <dir/win_env.yml>`

`activate CCDR`
## Settings

Edit the `.env` file inside the notebook directories to specify the working directory:

Expand Down
4 changes: 2 additions & 2 deletions docs/EAE.html
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ <h1 class="site-logo" id="site-title">Climate & Disaster Risk Screening Tools</h
<ul class="nav bd-sidenav">
<li class="toctree-l1">
<a class="reference internal" href="tool-setup.html">
Tools setup
TOOLS SETUP
</a>
</li>
<li class="toctree-l1">
Expand Down Expand Up @@ -767,7 +767,7 @@ <h3>Present results<a class="headerlink" href="#present-results" title="Permalin

By M. Amadio (GFDRR)<br/>

Last updated on Oct 04, 2023.<br/>
Last updated on Oct 13, 2023.<br/>
<div class="extra_footer">
<div>
<b>All content (unless otherwise specified) is subject to the <a href="https://raw.githubusercontent.com/worldbank/template/main/LICENSE">World Bank Master Community License Agreement.</a></b>
Expand Down
25 changes: 4 additions & 21 deletions docs/EAI.html
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ <h1 class="site-logo" id="site-title">Climate & Disaster Risk Screening Tools</h
<ul class="nav bd-sidenav">
<li class="toctree-l1">
<a class="reference internal" href="tool-setup.html">
Tools setup
TOOLS SETUP
</a>
</li>
<li class="toctree-l1">
Expand Down Expand Up @@ -471,11 +471,6 @@ <h1 class="site-logo" id="site-title">Climate & Disaster Risk Screening Tools</h
SCRIPT OVERVIEW
</a>
</li>
<li class="toc-h2 nav-item toc-entry">
<a class="reference internal nav-link" href="#data-management">
DATA MANAGEMENT
</a>
</li>
<li class="toc-h2 nav-item toc-entry">
<a class="reference internal nav-link" href="#setup-the-notebook">
SETUP THE NOTEBOOK
Expand Down Expand Up @@ -527,11 +522,6 @@ <h2> Contents </h2>
SCRIPT OVERVIEW
</a>
</li>
<li class="toc-h2 nav-item toc-entry">
<a class="reference internal nav-link" href="#data-management">
DATA MANAGEMENT
</a>
</li>
<li class="toc-h2 nav-item toc-entry">
<a class="reference internal nav-link" href="#setup-the-notebook">
SETUP THE NOTEBOOK
Expand Down Expand Up @@ -599,18 +589,11 @@ <h2>SCRIPT OVERVIEW<a class="headerlink" href="#script-overview" title="Permalin
<li><p>The exposure and impact estimates are then summarised for the chosen administrative boundary (ADM) level using <code class="docutils literal notranslate"><span class="pre">zonal</span> <span class="pre">statistic</span></code>. The expected annual impact (EAI) is computed by multiplying the impact value with its exceedence frequency depending on the scenario. The <code class="docutils literal notranslate"><span class="pre">exceedance</span> <span class="pre">frequency</span> <span class="pre">curve</span> <span class="pre">(EFC)</span></code> is plotted. These outputs represent the core of the disaster risk historical baseline. The output is exported in form of tables, statistics, charts (excel format) and maps (geopackage).</p></li>
</ul>
</section>
<section id="data-management">
<h2>DATA MANAGEMENT<a class="headerlink" href="#data-management" title="Permalink to this headline">#</a></h2>
<ul class="simple">
<li><p>Download country boundaries for multiple administrative levels sourced from <a class="reference external" href="https://data.humdata.org/dataset">HDX</a> or <a class="reference external" href="https://www.geoboundaries.org">Geoboundaries</a>. Note that oftern there are several versions for the same country, so be sure to use the most updated from official agencies (eg. United Nations). Verify that shapes, names and codes are consistent across different levels.</p></li>
<li><p>Download <a class="reference internal" href="global-exposure.html"><span class="doc std std-doc">exposure data</span></a>.</p></li>
<li><p>Download probabilistic <a class="reference internal" href="global-hazard.html"><span class="doc std std-doc">hazard data</span></a>, consisting of multiple RP scenarios.</p></li>
</ul>
</section>
<section id="setup-the-notebook">
<h2>SETUP THE NOTEBOOK<a class="headerlink" href="#setup-the-notebook" title="Permalink to this headline">#</a></h2>
<p>As explained in <a class="reference internal" href="tool-setup.html"><span class="doc std std-doc">tool setup</span></a>:</p>
<ul class="simple">
<li><p>Create environment and folder structure as explained in <a class="reference internal" href="tool-setup.html"><span class="doc std std-doc">tool setup</span></a></p></li>
<li><p>Create environment and folder structure</p></li>
<li><p>Move verified input data into the tools folders</p></li>
<li><p>Use the interface to select the settings and start the processing</p></li>
</ul>
Expand Down Expand Up @@ -744,7 +727,7 @@ <h3>Present results<a class="headerlink" href="#present-results" title="Permalin

By M. Amadio (GFDRR)<br/>

Last updated on Oct 04, 2023.<br/>
Last updated on Oct 13, 2023.<br/>
<div class="extra_footer">
<div>
<b>All content (unless otherwise specified) is subject to the <a href="https://raw.githubusercontent.com/worldbank/template/main/LICENSE">World Bank Master Community License Agreement.</a></b>
Expand Down
4 changes: 2 additions & 2 deletions docs/climate-indices.html
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ <h1 class="site-logo" id="site-title">Climate & Disaster Risk Screening Tools</h
<ul class="nav bd-sidenav">
<li class="toctree-l1">
<a class="reference internal" href="tool-setup.html">
Tools setup
TOOLS SETUP
</a>
</li>
<li class="toctree-l1">
Expand Down Expand Up @@ -794,7 +794,7 @@ <h3>Output presentation<a class="headerlink" href="#output-presentation" title="

By M. Amadio (GFDRR)<br/>

Last updated on Oct 04, 2023.<br/>
Last updated on Oct 13, 2023.<br/>
<div class="extra_footer">
<div>
<b>All content (unless otherwise specified) is subject to the <a href="https://raw.githubusercontent.com/worldbank/template/main/LICENSE">World Bank Master Community License Agreement.</a></b>
Expand Down
4 changes: 2 additions & 2 deletions docs/climate-risk.html
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ <h1 class="site-logo" id="site-title">Climate & Disaster Risk Screening Tools</h
<ul class="nav bd-sidenav">
<li class="toctree-l1">
<a class="reference internal" href="tool-setup.html">
Tools setup
TOOLS SETUP
</a>
</li>
<li class="toctree-l1">
Expand Down Expand Up @@ -595,7 +595,7 @@ <h1>Climate outlook<a class="headerlink" href="#climate-outlook" title="Permalin

By M. Amadio (GFDRR)<br/>

Last updated on Oct 04, 2023.<br/>
Last updated on Oct 13, 2023.<br/>
<div class="extra_footer">
<div>
<b>All content (unless otherwise specified) is subject to the <a href="https://raw.githubusercontent.com/worldbank/template/main/LICENSE">World Bank Master Community License Agreement.</a></b>
Expand Down
4 changes: 2 additions & 2 deletions docs/disaster-data.html
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ <h1 class="site-logo" id="site-title">Climate & Disaster Risk Screening Tools</h
<ul class="nav bd-sidenav">
<li class="toctree-l1">
<a class="reference internal" href="tool-setup.html">
Tools setup
TOOLS SETUP
</a>
</li>
<li class="toctree-l1">
Expand Down Expand Up @@ -582,7 +582,7 @@ <h1>Disaster records<a class="headerlink" href="#disaster-records" title="Permal

By M. Amadio (GFDRR)<br/>

Last updated on Oct 04, 2023.<br/>
Last updated on Oct 13, 2023.<br/>
<div class="extra_footer">
<div>
<b>All content (unless otherwise specified) is subject to the <a href="https://raw.githubusercontent.com/worldbank/template/main/LICENSE">World Bank Master Community License Agreement.</a></b>
Expand Down
4 changes: 2 additions & 2 deletions docs/external-data.html
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ <h1 class="site-logo" id="site-title">Climate & Disaster Risk Screening Tools</h
<ul class="nav bd-sidenav">
<li class="toctree-l1">
<a class="reference internal" href="tool-setup.html">
Tools setup
TOOLS SETUP
</a>
</li>
<li class="toctree-l1">
Expand Down Expand Up @@ -563,7 +563,7 @@ <h1>Additional data sources<a class="headerlink" href="#additional-data-sources"

By M. Amadio (GFDRR)<br/>

Last updated on Oct 04, 2023.<br/>
Last updated on Oct 13, 2023.<br/>
<div class="extra_footer">
<div>
<b>All content (unless otherwise specified) is subject to the <a href="https://raw.githubusercontent.com/worldbank/template/main/LICENSE">World Bank Master Community License Agreement.</a></b>
Expand Down
4 changes: 2 additions & 2 deletions docs/external-tools.html
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ <h1 class="site-logo" id="site-title">Climate & Disaster Risk Screening Tools</h
<ul class="nav bd-sidenav">
<li class="toctree-l1">
<a class="reference internal" href="tool-setup.html">
Tools setup
TOOLS SETUP
</a>
</li>
<li class="toctree-l1">
Expand Down Expand Up @@ -546,7 +546,7 @@ <h1>External tools<a class="headerlink" href="#external-tools" title="Permalink

By M. Amadio (GFDRR)<br/>

Last updated on Oct 04, 2023.<br/>
Last updated on Oct 13, 2023.<br/>
<div class="extra_footer">
<div>
<b>All content (unless otherwise specified) is subject to the <a href="https://raw.githubusercontent.com/worldbank/template/main/LICENSE">World Bank Master Community License Agreement.</a></b>
Expand Down
4 changes: 2 additions & 2 deletions docs/global-exposure.html
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ <h1 class="site-logo" id="site-title">Climate & Disaster Risk Screening Tools</h
<ul class="nav bd-sidenav">
<li class="toctree-l1">
<a class="reference internal" href="tool-setup.html">
Tools setup
TOOLS SETUP
</a>
</li>
<li class="toctree-l1">
Expand Down Expand Up @@ -685,7 +685,7 @@ <h2>Additional datasets<a class="headerlink" href="#additional-datasets" title="

By M. Amadio (GFDRR)<br/>

Last updated on Oct 04, 2023.<br/>
Last updated on Oct 13, 2023.<br/>
<div class="extra_footer">
<div>
<b>All content (unless otherwise specified) is subject to the <a href="https://raw.githubusercontent.com/worldbank/template/main/LICENSE">World Bank Master Community License Agreement.</a></b>
Expand Down
4 changes: 2 additions & 2 deletions docs/global-hazard.html
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ <h1 class="site-logo" id="site-title">Climate & Disaster Risk Screening Tools</h
<ul class="nav bd-sidenav">
<li class="toctree-l1">
<a class="reference internal" href="tool-setup.html">
Tools setup
TOOLS SETUP
</a>
</li>
<li class="toctree-l1">
Expand Down Expand Up @@ -570,7 +570,7 @@ <h1>Hazard datasets<a class="headerlink" href="#hazard-datasets" title="Permalin

By M. Amadio (GFDRR)<br/>

Last updated on Oct 04, 2023.<br/>
Last updated on Oct 13, 2023.<br/>
<div class="extra_footer">
<div>
<b>All content (unless otherwise specified) is subject to the <a href="https://raw.githubusercontent.com/worldbank/template/main/LICENSE">World Bank Master Community License Agreement.</a></b>
Expand Down
4 changes: 2 additions & 2 deletions docs/global-vulnerability.html
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ <h1 class="site-logo" id="site-title">Climate & Disaster Risk Screening Tools</h
<ul class="nav bd-sidenav">
<li class="toctree-l1">
<a class="reference internal" href="tool-setup.html">
Tools setup
TOOLS SETUP
</a>
</li>
<li class="toctree-l1">
Expand Down Expand Up @@ -752,7 +752,7 @@ <h1>Additional datasets<a class="headerlink" href="#additional-datasets" title="

By M. Amadio (GFDRR)<br/>

Last updated on Oct 04, 2023.<br/>
Last updated on Oct 13, 2023.<br/>
<div class="extra_footer">
<div>
<b>All content (unless otherwise specified) is subject to the <a href="https://raw.githubusercontent.com/worldbank/template/main/LICENSE">World Bank Master Community License Agreement.</a></b>
Expand Down
4 changes: 2 additions & 2 deletions docs/hzd_env-data.html
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ <h1 class="site-logo" id="site-title">Climate & Disaster Risk Screening Tools</h
<ul class="nav bd-sidenav">
<li class="toctree-l1">
<a class="reference internal" href="tool-setup.html">
Tools setup
TOOLS SETUP
</a>
</li>
<li class="toctree-l1">
Expand Down Expand Up @@ -603,7 +603,7 @@ <h2>Air pollution<a class="headerlink" href="#air-pollution" title="Permalink to

By M. Amadio (GFDRR)<br/>

Last updated on Oct 04, 2023.<br/>
Last updated on Oct 13, 2023.<br/>
<div class="extra_footer">
<div>
<b>All content (unless otherwise specified) is subject to the <a href="https://raw.githubusercontent.com/worldbank/template/main/LICENSE">World Bank Master Community License Agreement.</a></b>
Expand Down
4 changes: 2 additions & 2 deletions docs/hzd_gp-data.html
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ <h1 class="site-logo" id="site-title">Climate & Disaster Risk Screening Tools</h
<ul class="nav bd-sidenav">
<li class="toctree-l1">
<a class="reference internal" href="tool-setup.html">
Tools setup
TOOLS SETUP
</a>
</li>
<li class="toctree-l1">
Expand Down Expand Up @@ -635,7 +635,7 @@ <h2>Volcanic activity<a class="headerlink" href="#volcanic-activity" title="Perm

By M. Amadio (GFDRR)<br/>

Last updated on Oct 04, 2023.<br/>
Last updated on Oct 13, 2023.<br/>
<div class="extra_footer">
<div>
<b>All content (unless otherwise specified) is subject to the <a href="https://raw.githubusercontent.com/worldbank/template/main/LICENSE">World Bank Master Community License Agreement.</a></b>
Expand Down
Loading

0 comments on commit 78e21b6

Please sign in to comment.