Skip to content

Commit

Permalink
Adding 'All steps' tutorial
Browse files Browse the repository at this point in the history
  • Loading branch information
ghislainv committed Jun 20, 2022
1 parent 806a16f commit 1be9583
Show file tree
Hide file tree
Showing 36 changed files with 1,656 additions and 133 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ notes.org
docsrc/notebooks/data
docsrc/notebooks/outputs_makemap
docsrc/notebooks/outputs_MDG
docsrc/notebooks/outputs_steps

# Byte-compiled / optimized / DLL files
__pycache__/
Expand Down
Binary file modified docs/_images/fcc123.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/_images/fcc1231.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/_images/perc_dist1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/_images/plot_dist.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/_images/pred_obs.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/_images/riskmap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/_images/riskmap_ws5_ei.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions docs/_modules/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ <h3>Navigation</h3>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../index.html">Home</a></li>
<li class="toctree-l1"><a class="reference internal" href="../notebooks/get_started.html">Get Started</a></li>
<li class="toctree-l1"><a class="reference internal" href="../articles.html">Articles</a></li>
<li class="toctree-l1"><a class="reference internal" href="../reference.html">Python API</a></li>
<li class="toctree-l1"><a class="reference internal" href="../indices.html">Indices and tables</a></li>
<li class="toctree-l1"><a class="reference internal" href="../changelog.html">Changelog</a></li>
Expand Down
10 changes: 10 additions & 0 deletions docs/_sources/articles.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Articles
========

.. toctree::
:maxdepth: 1

notebooks/get_started
notebooks/steps


1 change: 1 addition & 0 deletions docs/_sources/index.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Table of contents

Home <self>
notebooks/get_started
articles
reference
indices
changelog
Expand Down
8 changes: 4 additions & 4 deletions docs/_sources/notebooks/get_started.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ We derive the deforestation risk map using the ``makemap()`` function. This func
results_makemap = rmj.makemap(
fcc_file=fcc_file,
time_interval=[10, 10],
output_dir="outputs_makemap",
output_dir=out_dir,
clean=False,
dist_bins=np.arange(0, 1080, step=30),
win_sizes=np.arange(5, 48, 16),
Expand Down Expand Up @@ -157,7 +157,7 @@ We also have access to a plot showing how the cumulative percentage of deforesta

.. code:: python
ofile = "outputs_makemap/perc_dist.png"
ofile = os.path.join(out_dir, "perc_dist.png")
ofile
.. _fig:perc_dist:
Expand Down Expand Up @@ -190,7 +190,7 @@ We identify the moving window size and the slicing algorithm of the best model.

.. code:: python
ofile = "outputs_makemap/pred_obs_ws5_ei.png"
ofile = os.path.join(out_dir, "pred_obs_ws5_ei.png")
ofile
.. _fig:pred_obs:
Expand All @@ -208,7 +208,7 @@ We plot the risk map using the ``plot.riskmap()`` function.

.. code:: python
ofile = os.path.join("outputs_makemap", "riskmap_ws5_ei.png")
ofile = os.path.join(out_dir, "riskmap_ws5_ei.png")
riskmap_fig = rmj.plot.riskmap(
input_risk_map="outputs_makemap/riskmap_ws5_ei.tif",
maxpixels=1e8,
Expand Down
355 changes: 355 additions & 0 deletions docs/_sources/notebooks/steps.rst.txt

Large diffs are not rendered by default.

Binary file modified docs/_static/riskmapjnr-example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
142 changes: 142 additions & 0 deletions docs/articles.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@

<!DOCTYPE html>

<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.18.1: http://docutils.sourceforge.net/" />

<title>Articles &#8212; riskmapjnr — Map of deforestation risk following JNR methodology</title>
<link rel="stylesheet" type="text/css" href="_static/pygments.css" />
<link rel="stylesheet" type="text/css" href="_static/alabaster.css" />
<script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script>
<script src="_static/jquery.js"></script>
<script src="_static/underscore.js"></script>
<script src="_static/_sphinx_javascript_frameworks_compat.js"></script>
<script src="_static/doctools.js"></script>
<script crossorigin="anonymous" integrity="sha256-Ae2Vz/4ePdIu6ZyI/5ZGsYnb+m0JlOmKPjt6XZ9JJkA=" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js"></script>
<link rel="shortcut icon" href="_static/favicon.ico"/>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="All steps" href="notebooks/steps.html" />
<link rel="prev" title="Get Started" href="notebooks/get_started.html" />

<link rel="stylesheet" href="_static/custom.css" type="text/css" />


<meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />

</head><body>
<div class="document">

<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<p class="logo">
<a href="index.html">
<img class="logo" src="_static/logo-riskmapjnr.svg" alt="Logo"/>

<h1 class="logo logo-name">riskmapjnr</h1>

</a>
</p>



<p class="blurb">Map of deforestation risk following JNR methodology</p>




<p>
<iframe src="https://ghbtns.com/github-btn.html?user=ghislainv&repo=riskmapjnr&type=star&count=true&size=large&v=2"
allowtransparency="true" frameborder="0" scrolling="0" width="200px" height="35px"></iframe>
</p>





<h3>Navigation</h3>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="index.html">Home</a></li>
<li class="toctree-l1"><a class="reference internal" href="notebooks/get_started.html">Get Started</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">Articles</a><ul>
<li class="toctree-l2"><a class="reference internal" href="notebooks/get_started.html">Get Started</a></li>
<li class="toctree-l2"><a class="reference internal" href="notebooks/steps.html">All steps</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="reference.html">Python API</a></li>
<li class="toctree-l1"><a class="reference internal" href="indices.html">Indices and tables</a></li>
<li class="toctree-l1"><a class="reference internal" href="changelog.html">Changelog</a></li>
<li class="toctree-l1"><a class="reference internal" href="license.html">License</a></li>
</ul>

<div class="relations">
<h3>Related Topics</h3>
<ul>
<li><a href="index.html">Documentation overview</a><ul>
<li>Previous: <a href="notebooks/get_started.html" title="previous chapter">Get Started</a></li>
<li>Next: <a href="notebooks/steps.html" title="next chapter">All steps</a></li>
</ul></li>
</ul>
</div>
<div id="searchbox" style="display: none" role="search">
<h3 id="searchlabel">Quick search</h3>
<div class="searchformwrapper">
<form class="search" action="search.html" method="get">
<input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
<input type="submit" value="Go" />
</form>
</div>
</div>
<script>document.getElementById('searchbox').style.display = "block"</script>








</div>
</div>
<div class="documentwrapper">
<div class="bodywrapper">


<div class="body" role="main">

<section id="articles">
<h1>Articles<a class="headerlink" href="#articles" title="Permalink to this heading"></a></h1>
<div class="toctree-wrapper compound">
<ul>
<li class="toctree-l1"><a class="reference internal" href="notebooks/get_started.html">Get Started</a></li>
<li class="toctree-l1"><a class="reference internal" href="notebooks/steps.html">All steps</a></li>
</ul>
</div>
</section>


</div>

</div>
</div>
<div class="clearer"></div>
</div>
<div class="footer">
&copy;2022, Ghislain Vieilledent.

|
Powered by <a href="http://sphinx-doc.org/">Sphinx 5.0.1</a>
&amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.12</a>

|
<a href="_sources/articles.rst.txt"
rel="nofollow">Page source</a>
</div>




</body>
</html>
1 change: 1 addition & 0 deletions docs/changelog.html
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ <h3>Navigation</h3>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="index.html">Home</a></li>
<li class="toctree-l1"><a class="reference internal" href="notebooks/get_started.html">Get Started</a></li>
<li class="toctree-l1"><a class="reference internal" href="articles.html">Articles</a></li>
<li class="toctree-l1"><a class="reference internal" href="reference.html">Python API</a></li>
<li class="toctree-l1"><a class="reference internal" href="indices.html">Indices and tables</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">Changelog</a><ul>
Expand Down
1 change: 1 addition & 0 deletions docs/code_of_conduct.html
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ <h3>Navigation</h3>
<ul>
<li class="toctree-l1"><a class="reference internal" href="index.html">Home</a></li>
<li class="toctree-l1"><a class="reference internal" href="notebooks/get_started.html">Get Started</a></li>
<li class="toctree-l1"><a class="reference internal" href="articles.html">Articles</a></li>
<li class="toctree-l1"><a class="reference internal" href="reference.html">Python API</a></li>
<li class="toctree-l1"><a class="reference internal" href="indices.html">Indices and tables</a></li>
<li class="toctree-l1"><a class="reference internal" href="changelog.html">Changelog</a></li>
Expand Down
1 change: 1 addition & 0 deletions docs/contributing.html
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ <h3>Navigation</h3>
<ul>
<li class="toctree-l1"><a class="reference internal" href="index.html">Home</a></li>
<li class="toctree-l1"><a class="reference internal" href="notebooks/get_started.html">Get Started</a></li>
<li class="toctree-l1"><a class="reference internal" href="articles.html">Articles</a></li>
<li class="toctree-l1"><a class="reference internal" href="reference.html">Python API</a></li>
<li class="toctree-l1"><a class="reference internal" href="indices.html">Indices and tables</a></li>
<li class="toctree-l1"><a class="reference internal" href="changelog.html">Changelog</a></li>
Expand Down
1 change: 1 addition & 0 deletions docs/genindex.html
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ <h3>Navigation</h3>
<ul>
<li class="toctree-l1"><a class="reference internal" href="index.html">Home</a></li>
<li class="toctree-l1"><a class="reference internal" href="notebooks/get_started.html">Get Started</a></li>
<li class="toctree-l1"><a class="reference internal" href="articles.html">Articles</a></li>
<li class="toctree-l1"><a class="reference internal" href="reference.html">Python API</a></li>
<li class="toctree-l1"><a class="reference internal" href="indices.html">Indices and tables</a></li>
<li class="toctree-l1"><a class="reference internal" href="changelog.html">Changelog</a></li>
Expand Down
6 changes: 6 additions & 0 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ <h3>Navigation</h3>
<ul class="current">
<li class="toctree-l1 current"><a class="current reference internal" href="#">Home</a></li>
<li class="toctree-l1"><a class="reference internal" href="notebooks/get_started.html">Get Started</a></li>
<li class="toctree-l1"><a class="reference internal" href="articles.html">Articles</a></li>
<li class="toctree-l1"><a class="reference internal" href="reference.html">Python API</a></li>
<li class="toctree-l1"><a class="reference internal" href="indices.html">Indices and tables</a></li>
<li class="toctree-l1"><a class="reference internal" href="changelog.html">Changelog</a></li>
Expand Down Expand Up @@ -265,6 +266,11 @@ <h2>Table of contents<a class="headerlink" href="#table-of-contents" title="Perm
<li class="toctree-l2"><a class="reference internal" href="notebooks/get_started.html#results">3 Results</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="articles.html">Articles</a><ul>
<li class="toctree-l2"><a class="reference internal" href="notebooks/get_started.html">Get Started</a></li>
<li class="toctree-l2"><a class="reference internal" href="notebooks/steps.html">All steps</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="reference.html">Python API</a><ul>
<li class="toctree-l2"><a class="reference internal" href="reference.html#module-riskmapjnr">Main functions</a></li>
<li class="toctree-l2"><a class="reference internal" href="reference.html#module-riskmapjnr.plot">Plot functions</a></li>
Expand Down
1 change: 1 addition & 0 deletions docs/indices.html
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ <h3>Navigation</h3>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="index.html">Home</a></li>
<li class="toctree-l1"><a class="reference internal" href="notebooks/get_started.html">Get Started</a></li>
<li class="toctree-l1"><a class="reference internal" href="articles.html">Articles</a></li>
<li class="toctree-l1"><a class="reference internal" href="reference.html">Python API</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">Indices and tables</a></li>
<li class="toctree-l1"><a class="reference internal" href="changelog.html">Changelog</a></li>
Expand Down
1 change: 1 addition & 0 deletions docs/license.html
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ <h3>Navigation</h3>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="index.html">Home</a></li>
<li class="toctree-l1"><a class="reference internal" href="notebooks/get_started.html">Get Started</a></li>
<li class="toctree-l1"><a class="reference internal" href="articles.html">Articles</a></li>
<li class="toctree-l1"><a class="reference internal" href="reference.html">Python API</a></li>
<li class="toctree-l1"><a class="reference internal" href="indices.html">Indices and tables</a></li>
<li class="toctree-l1"><a class="reference internal" href="changelog.html">Changelog</a></li>
Expand Down
13 changes: 7 additions & 6 deletions docs/notebooks/get_started.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<link rel="shortcut icon" href="../_static/favicon.ico"/>
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
<link rel="next" title="Python API" href="../reference.html" />
<link rel="next" title="Articles" href="../articles.html" />
<link rel="prev" title="riskmapjnr Python package" href="../index.html" />

<link rel="stylesheet" href="../_static/custom.css" type="text/css" />
Expand Down Expand Up @@ -67,6 +67,7 @@ <h3>Navigation</h3>
<li class="toctree-l2"><a class="reference internal" href="#results">3 Results</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../articles.html">Articles</a></li>
<li class="toctree-l1"><a class="reference internal" href="../reference.html">Python API</a></li>
<li class="toctree-l1"><a class="reference internal" href="../indices.html">Indices and tables</a></li>
<li class="toctree-l1"><a class="reference internal" href="../changelog.html">Changelog</a></li>
Expand All @@ -78,7 +79,7 @@ <h3>Related Topics</h3>
<ul>
<li><a href="../index.html">Documentation overview</a><ul>
<li>Previous: <a href="../index.html" title="previous chapter"><code class="docutils literal notranslate"><span class="pre">riskmapjnr</span></code> Python package</a></li>
<li>Next: <a href="../reference.html" title="next chapter">Python API</a></li>
<li>Next: <a href="../articles.html" title="next chapter">Articles</a></li>
</ul></li>
</ul>
</div>
Expand Down Expand Up @@ -180,7 +181,7 @@ <h2>2 Derive the deforestation risk map<a class="headerlink" href="#derive-the-d
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="n">results_makemap</span> <span class="o">=</span> <span class="n">rmj</span><span class="o">.</span><span class="n">makemap</span><span class="p">(</span>
<span class="n">fcc_file</span><span class="o">=</span><span class="n">fcc_file</span><span class="p">,</span>
<span class="n">time_interval</span><span class="o">=</span><span class="p">[</span><span class="mi">10</span><span class="p">,</span> <span class="mi">10</span><span class="p">],</span>
<span class="n">output_dir</span><span class="o">=</span><span class="s2">&quot;outputs_makemap&quot;</span><span class="p">,</span>
<span class="n">output_dir</span><span class="o">=</span><span class="n">out_dir</span><span class="p">,</span>
<span class="n">clean</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span>
<span class="n">dist_bins</span><span class="o">=</span><span class="n">np</span><span class="o">.</span><span class="n">arange</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">1080</span><span class="p">,</span> <span class="n">step</span><span class="o">=</span><span class="mi">30</span><span class="p">),</span>
<span class="n">win_sizes</span><span class="o">=</span><span class="n">np</span><span class="o">.</span><span class="n">arange</span><span class="p">(</span><span class="mi">5</span><span class="p">,</span> <span class="mi">48</span><span class="p">,</span> <span class="mi">16</span><span class="p">),</span>
Expand Down Expand Up @@ -280,7 +281,7 @@ <h3>3.1 Deforestation risk and distance to forest edge<a class="headerlink" href
</tbody>
</table>
<p>We also have access to a plot showing how the cumulative percentage of deforestation increases with the distance to forest edge.</p>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="n">ofile</span> <span class="o">=</span> <span class="s2">&quot;outputs_makemap/perc_dist.png&quot;</span>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="n">ofile</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">out_dir</span><span class="p">,</span> <span class="s2">&quot;perc_dist.png&quot;</span><span class="p">)</span>
<span class="n">ofile</span>
</pre></div>
</div>
Expand All @@ -307,7 +308,7 @@ <h3>3.2 Best model<a class="headerlink" href="#best-model" title="Permalink to t
</section>
<section id="validation">
<h3>3.3 Validation<a class="headerlink" href="#validation" title="Permalink to this heading"></a></h3>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="n">ofile</span> <span class="o">=</span> <span class="s2">&quot;outputs_makemap/pred_obs_ws5_ei.png&quot;</span>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="n">ofile</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">out_dir</span><span class="p">,</span> <span class="s2">&quot;pred_obs_ws5_ei.png&quot;</span><span class="p">)</span>
<span class="n">ofile</span>
</pre></div>
</div>
Expand All @@ -321,7 +322,7 @@ <h3>3.3 Validation<a class="headerlink" href="#validation" title="Permalink to t
<section id="risk-map-of-deforestation">
<h3>3.4 Risk map of deforestation<a class="headerlink" href="#risk-map-of-deforestation" title="Permalink to this heading"></a></h3>
<p>We plot the risk map using the <code class="docutils literal notranslate"><span class="pre">plot.riskmap()</span></code> function.</p>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="n">ofile</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="s2">&quot;outputs_makemap&quot;</span><span class="p">,</span> <span class="s2">&quot;riskmap_ws5_ei.png&quot;</span><span class="p">)</span>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="n">ofile</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">out_dir</span><span class="p">,</span> <span class="s2">&quot;riskmap_ws5_ei.png&quot;</span><span class="p">)</span>
<span class="n">riskmap_fig</span> <span class="o">=</span> <span class="n">rmj</span><span class="o">.</span><span class="n">plot</span><span class="o">.</span><span class="n">riskmap</span><span class="p">(</span>
<span class="n">input_risk_map</span><span class="o">=</span><span class="s2">&quot;outputs_makemap/riskmap_ws5_ei.tif&quot;</span><span class="p">,</span>
<span class="n">maxpixels</span><span class="o">=</span><span class="mf">1e8</span><span class="p">,</span>
Expand Down
Loading

0 comments on commit 1be9583

Please sign in to comment.