Skip to content

Commit

Permalink
deploy: f1b3d74
Browse files Browse the repository at this point in the history
  • Loading branch information
matamadio committed Feb 8, 2024
1 parent d0ee79e commit 63928d8
Show file tree
Hide file tree
Showing 34 changed files with 2,526 additions and 35 deletions.
11 changes: 11 additions & 0 deletions _sources/docs/utility.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Utilities

Additional tools to help collect, view and process risk data.

## Merge tiles

Large raster datasets often comes as a collection of regular tiles.
In order to run the raster analysis offered in our tools, they often need to be merged into one file.
To do that, a simple python script is provided as jupyter notebook.

[TILE MERGE](utility/merge_tiles/Merge_tiles.ipynb)
62 changes: 62 additions & 0 deletions _sources/utility/merge_tiles/Merge_tiles.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{
"cells": [
{
"cell_type": "markdown",
"id": "b8bf67f8",
"metadata": {},
"source": [
"# TILE MERGE SCRIPT\n",
"\n",
"The python script below looks into subfolders of specified directory and merge together all tiff files found, naming the resulting tiff as the folder from which they are generated.\n",
"\n",
"- The function for merging and exporting is found in merge_utils.py\n",
"- GDAL library must be installed in your python environment\n",
"- Output is exported in the same format of the original tiles\n",
"- The scripts makes use of parallel processing for quicker results"
]
},
{
"cell_type": "code",
"execution_count": 26,
"id": "e3904d3e",
"metadata": {},
"outputs": [],
"source": [
"import os\n",
"import concurrent.futures\n",
"from merge_utils import merge_tifs\n",
"\n",
"# Specify the directory to search for .tif files\n",
"directory = 'C:/YourWorkDirectory/Fathom3/PL/2020/'\n",
"\n",
"# Iterate through each subdirectory\n",
"subdirs = [os.path.join(directory, subdir) for subdir in os.listdir(directory) if os.path.isdir(os.path.join(directory, subdir))]\n",
"\n",
"# Process subdirectories in parallel\n",
"with concurrent.futures.ProcessPoolExecutor() as executor:\n",
" executor.map(merge_tifs, subdirs)\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.10.2"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
20 changes: 19 additions & 1 deletion docs/EAE.html
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,13 @@
</li>


<li class="nav-item">
<a class="nav-link nav-internal" href="utility.html">
Utilities
</a>
</li>


<li class="nav-item">
<a class="nav-link nav-internal" href="external-tools.html">
External tools
Expand Down Expand Up @@ -494,6 +501,13 @@
</li>


<li class="nav-item">
<a class="nav-link nav-internal" href="utility.html">
Utilities
</a>
</li>


<li class="nav-item">
<a class="nav-link nav-internal" href="external-tools.html">
External tools
Expand Down Expand Up @@ -617,6 +631,10 @@
<ul class="nav bd-sidenav">
<li class="toctree-l1"><a class="reference internal" href="tool-setup.html">TOOLS SETUP</a></li>
<li class="toctree-l1"><a class="reference internal" href="run-baseline.html">Baseline risk</a></li>
<li class="toctree-l1 has-children"><a class="reference internal" href="utility.html">Utilities</a><input class="toctree-checkbox" id="toctree-checkbox-2" name="toctree-checkbox-2" type="checkbox"/><label class="toctree-toggle" for="toctree-checkbox-2"><i class="fa-solid fa-chevron-down"></i></label><ul>
<li class="toctree-l2"><a class="reference internal" href="../utility/merge_tiles/Merge_tiles.html">TILE MERGE SCRIPT</a></li>
</ul>
</li>
</ul>
<p aria-level="2" class="caption" role="heading"><span class="caption-text">External resources</span></p>
<ul class="nav bd-sidenav">
Expand Down Expand Up @@ -1111,7 +1129,7 @@ <h3>Present results<a class="headerlink" href="#present-results" title="Permalin

<div class="footer-item">
<p class="last-updated">
Last updated on Feb 05, 2024.<br>
Last updated on Feb 08, 2024.<br>
</p>
</div>

Expand Down
20 changes: 19 additions & 1 deletion docs/EAI.html
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,13 @@
</li>


<li class="nav-item">
<a class="nav-link nav-internal" href="utility.html">
Utilities
</a>
</li>


<li class="nav-item">
<a class="nav-link nav-internal" href="external-tools.html">
External tools
Expand Down Expand Up @@ -494,6 +501,13 @@
</li>


<li class="nav-item">
<a class="nav-link nav-internal" href="utility.html">
Utilities
</a>
</li>


<li class="nav-item">
<a class="nav-link nav-internal" href="external-tools.html">
External tools
Expand Down Expand Up @@ -617,6 +631,10 @@
<ul class="nav bd-sidenav">
<li class="toctree-l1"><a class="reference internal" href="tool-setup.html">TOOLS SETUP</a></li>
<li class="toctree-l1"><a class="reference internal" href="run-baseline.html">Baseline risk</a></li>
<li class="toctree-l1 has-children"><a class="reference internal" href="utility.html">Utilities</a><input class="toctree-checkbox" id="toctree-checkbox-2" name="toctree-checkbox-2" type="checkbox"/><label class="toctree-toggle" for="toctree-checkbox-2"><i class="fa-solid fa-chevron-down"></i></label><ul>
<li class="toctree-l2"><a class="reference internal" href="../utility/merge_tiles/Merge_tiles.html">TILE MERGE SCRIPT</a></li>
</ul>
</li>
</ul>
<p aria-level="2" class="caption" role="heading"><span class="caption-text">External resources</span></p>
<ul class="nav bd-sidenav">
Expand Down Expand Up @@ -1071,7 +1089,7 @@ <h3>Present results<a class="headerlink" href="#present-results" title="Permalin

<div class="footer-item">
<p class="last-updated">
Last updated on Feb 05, 2024.<br>
Last updated on Feb 08, 2024.<br>
</p>
</div>

Expand Down
20 changes: 19 additions & 1 deletion docs/climate-indices.html
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,13 @@
</li>


<li class="nav-item">
<a class="nav-link nav-internal" href="utility.html">
Utilities
</a>
</li>


<li class="nav-item">
<a class="nav-link nav-internal" href="external-tools.html">
External tools
Expand Down Expand Up @@ -494,6 +501,13 @@
</li>


<li class="nav-item">
<a class="nav-link nav-internal" href="utility.html">
Utilities
</a>
</li>


<li class="nav-item">
<a class="nav-link nav-internal" href="external-tools.html">
External tools
Expand Down Expand Up @@ -617,6 +631,10 @@
<ul class="nav bd-sidenav">
<li class="toctree-l1"><a class="reference internal" href="tool-setup.html">TOOLS SETUP</a></li>
<li class="toctree-l1"><a class="reference internal" href="run-baseline.html">Baseline risk</a></li>
<li class="toctree-l1 has-children"><a class="reference internal" href="utility.html">Utilities</a><input class="toctree-checkbox" id="toctree-checkbox-2" name="toctree-checkbox-2" type="checkbox"/><label class="toctree-toggle" for="toctree-checkbox-2"><i class="fa-solid fa-chevron-down"></i></label><ul>
<li class="toctree-l2"><a class="reference internal" href="../utility/merge_tiles/Merge_tiles.html">TILE MERGE SCRIPT</a></li>
</ul>
</li>
</ul>
<p aria-level="2" class="caption" role="heading"><span class="caption-text">External resources</span></p>
<ul class="nav bd-sidenav">
Expand Down Expand Up @@ -1138,7 +1156,7 @@ <h3>Output presentation<a class="headerlink" href="#output-presentation" title="

<div class="footer-item">
<p class="last-updated">
Last updated on Feb 05, 2024.<br>
Last updated on Feb 08, 2024.<br>
</p>
</div>

Expand Down
20 changes: 19 additions & 1 deletion docs/climate-risk.html
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,13 @@
</li>


<li class="nav-item">
<a class="nav-link nav-internal" href="utility.html">
Utilities
</a>
</li>


<li class="nav-item">
<a class="nav-link nav-internal" href="external-tools.html">
External tools
Expand Down Expand Up @@ -490,6 +497,13 @@
</li>


<li class="nav-item">
<a class="nav-link nav-internal" href="utility.html">
Utilities
</a>
</li>


<li class="nav-item">
<a class="nav-link nav-internal" href="external-tools.html">
External tools
Expand Down Expand Up @@ -613,6 +627,10 @@
<ul class="nav bd-sidenav">
<li class="toctree-l1"><a class="reference internal" href="tool-setup.html">TOOLS SETUP</a></li>
<li class="toctree-l1"><a class="reference internal" href="run-baseline.html">Baseline risk</a></li>
<li class="toctree-l1 has-children"><a class="reference internal" href="utility.html">Utilities</a><input class="toctree-checkbox" id="toctree-checkbox-2" name="toctree-checkbox-2" type="checkbox"/><label class="toctree-toggle" for="toctree-checkbox-2"><i class="fa-solid fa-chevron-down"></i></label><ul>
<li class="toctree-l2"><a class="reference internal" href="../utility/merge_tiles/Merge_tiles.html">TILE MERGE SCRIPT</a></li>
</ul>
</li>
</ul>
<p aria-level="2" class="caption" role="heading"><span class="caption-text">External resources</span></p>
<ul class="nav bd-sidenav">
Expand Down Expand Up @@ -936,7 +954,7 @@ <h1>Climate outlook<a class="headerlink" href="#climate-outlook" title="Permalin

<div class="footer-item">
<p class="last-updated">
Last updated on Feb 05, 2024.<br>
Last updated on Feb 08, 2024.<br>
</p>
</div>

Expand Down
20 changes: 19 additions & 1 deletion docs/disaster-data.html
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,13 @@
</li>


<li class="nav-item">
<a class="nav-link nav-internal" href="utility.html">
Utilities
</a>
</li>


<li class="nav-item">
<a class="nav-link nav-internal" href="external-tools.html">
External tools
Expand Down Expand Up @@ -490,6 +497,13 @@
</li>


<li class="nav-item">
<a class="nav-link nav-internal" href="utility.html">
Utilities
</a>
</li>


<li class="nav-item">
<a class="nav-link nav-internal" href="external-tools.html">
External tools
Expand Down Expand Up @@ -613,6 +627,10 @@
<ul class="nav bd-sidenav">
<li class="toctree-l1"><a class="reference internal" href="tool-setup.html">TOOLS SETUP</a></li>
<li class="toctree-l1"><a class="reference internal" href="run-baseline.html">Baseline risk</a></li>
<li class="toctree-l1 has-children"><a class="reference internal" href="utility.html">Utilities</a><input class="toctree-checkbox" id="toctree-checkbox-2" name="toctree-checkbox-2" type="checkbox"/><label class="toctree-toggle" for="toctree-checkbox-2"><i class="fa-solid fa-chevron-down"></i></label><ul>
<li class="toctree-l2"><a class="reference internal" href="../utility/merge_tiles/Merge_tiles.html">TILE MERGE SCRIPT</a></li>
</ul>
</li>
</ul>
<p aria-level="2" class="caption" role="heading"><span class="caption-text">External resources</span></p>
<ul class="nav bd-sidenav">
Expand Down Expand Up @@ -923,7 +941,7 @@ <h1>Disaster records<a class="headerlink" href="#disaster-records" title="Permal

<div class="footer-item">
<p class="last-updated">
Last updated on Feb 05, 2024.<br>
Last updated on Feb 08, 2024.<br>
</p>
</div>

Expand Down
20 changes: 19 additions & 1 deletion docs/external-data.html
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,13 @@
</li>


<li class="nav-item">
<a class="nav-link nav-internal" href="utility.html">
Utilities
</a>
</li>


<li class="nav-item">
<a class="nav-link nav-internal" href="external-tools.html">
External tools
Expand Down Expand Up @@ -490,6 +497,13 @@
</li>


<li class="nav-item">
<a class="nav-link nav-internal" href="utility.html">
Utilities
</a>
</li>


<li class="nav-item">
<a class="nav-link nav-internal" href="external-tools.html">
External tools
Expand Down Expand Up @@ -613,6 +627,10 @@
<ul class="nav bd-sidenav">
<li class="toctree-l1"><a class="reference internal" href="tool-setup.html">TOOLS SETUP</a></li>
<li class="toctree-l1"><a class="reference internal" href="run-baseline.html">Baseline risk</a></li>
<li class="toctree-l1 has-children"><a class="reference internal" href="utility.html">Utilities</a><input class="toctree-checkbox" id="toctree-checkbox-2" name="toctree-checkbox-2" type="checkbox"/><label class="toctree-toggle" for="toctree-checkbox-2"><i class="fa-solid fa-chevron-down"></i></label><ul>
<li class="toctree-l2"><a class="reference internal" href="../utility/merge_tiles/Merge_tiles.html">TILE MERGE SCRIPT</a></li>
</ul>
</li>
</ul>
<p aria-level="2" class="caption" role="heading"><span class="caption-text">External resources</span></p>
<ul class="current nav bd-sidenav">
Expand Down Expand Up @@ -904,7 +922,7 @@ <h1>Additional data sources<a class="headerlink" href="#additional-data-sources"

<div class="footer-item">
<p class="last-updated">
Last updated on Feb 05, 2024.<br>
Last updated on Feb 08, 2024.<br>
</p>
</div>

Expand Down
Loading

0 comments on commit 63928d8

Please sign in to comment.