Articles¶
+-
+
- Get Started +
- All steps +
diff --git a/.gitignore b/.gitignore index 3ac6b8f..d78ed9d 100644 --- a/.gitignore +++ b/.gitignore @@ -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__/ diff --git a/docs/_images/fcc123.png b/docs/_images/fcc123.png index e3c650d..f420cb1 100644 Binary files a/docs/_images/fcc123.png and b/docs/_images/fcc123.png differ diff --git a/docs/_images/fcc1231.png b/docs/_images/fcc1231.png new file mode 100644 index 0000000..f420cb1 Binary files /dev/null and b/docs/_images/fcc1231.png differ diff --git a/docs/_images/perc_dist1.png b/docs/_images/perc_dist1.png new file mode 100644 index 0000000..7273955 Binary files /dev/null and b/docs/_images/perc_dist1.png differ diff --git a/docs/_images/plot_dist.png b/docs/_images/plot_dist.png index 7e67376..7273955 100644 Binary files a/docs/_images/plot_dist.png and b/docs/_images/plot_dist.png differ diff --git a/docs/_images/pred_obs.png b/docs/_images/pred_obs.png index 1bb92b1..6095c99 100644 Binary files a/docs/_images/pred_obs.png and b/docs/_images/pred_obs.png differ diff --git a/docs/_images/riskmap.png b/docs/_images/riskmap.png new file mode 100644 index 0000000..2c67431 Binary files /dev/null and b/docs/_images/riskmap.png differ diff --git a/docs/_images/riskmap_ws5_ei.png b/docs/_images/riskmap_ws5_ei.png index 66c6787..ebe06ab 100644 Binary files a/docs/_images/riskmap_ws5_ei.png and b/docs/_images/riskmap_ws5_ei.png differ diff --git a/docs/_modules/index.html b/docs/_modules/index.html index da8c20a..2277e7d 100644 --- a/docs/_modules/index.html +++ b/docs/_modules/index.html @@ -57,6 +57,7 @@
riskmapjnr
Python packageresults_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),
@@ -280,7 +281,7 @@ 3.1 Deforestation risk and distance to forest edge
We also have access to a plot showing how the cumulative percentage of deforestation increases with the distance to forest edge.
-ofile = "outputs_makemap/perc_dist.png"
+ofile = os.path.join(out_dir, "perc_dist.png")
ofile
@@ -307,7 +308,7 @@ 3.2 Best model
3.3 Validation¶
-ofile = "outputs_makemap/pred_obs_ws5_ei.png"
+ofile = os.path.join(out_dir, "pred_obs_ws5_ei.png")
ofile
@@ -321,7 +322,7 @@ 3.3 Validation
3.4 Risk map of deforestation¶
We plot the risk map using the plot.riskmap()
function.
-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,
diff --git a/docs/notebooks/steps.html b/docs/notebooks/steps.html
new file mode 100644
index 0000000..dfb6440
--- /dev/null
+++ b/docs/notebooks/steps.html
@@ -0,0 +1,582 @@
+
+
+
+
+
+
+
+
+ All steps — riskmapjnr — Map of deforestation risk following JNR methodology
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+All steps¶
+
+1 Introduction¶
+
+1.1 Objective¶
+We present here all the steps of the JNR methodology that need to be followed to derive a map of the deforestation risk in a given jurisdiction.
+
+
+1.2 Importing Python modules¶
+We import the Python modules needed for running the analysis.
+# Imports
+import os
+import pkg_resources
+
+import numpy as np
+import matplotlib.pyplot as plt
+import pandas as pd
+from tabulate import tabulate
+
+import riskmapjnr as rmj
+
+
+Increase the cache for GDAL to increase computational speed.
+# GDAL
+os.environ["GDAL_CACHEMAX"] = "1024"
+
+
+Set the PROJ_LIB
environmental variable.
+os.environ["PROJ_LIB"] = "/home/ghislain/.pyenv/versions/miniconda3-latest/envs/conda-rmj/share/proj"
+
+
+Create a directory to save results.
+out_dir = "outputs_steps"
+rmj.make_dir(out_dir)
+
+
+
+
+1.3 Forest cover change data¶
+We use the Guadeloupe archipelago as a case study. Recent forest cover change data for Guadeloupe is included in the riskmapjnr
package. The raster file (fcc123_GLP.tif
) includes the following values: 1 for deforestation on the period 2000–2010, 2 for deforestation on the period 2010–2020, and 3 for the remaining forest in 2020. NoData value is set to 0. The first period (2000–2010) will be used for calibration and the second period (2010–2020) will be used for validation. This is the only data we need to derive a map of deforestation risk following the JNR methodology.
+fcc_file = pkg_resources.resource_filename("riskmapjnr", "data/fcc123_GLP.tif")
+print(fcc_file)
+border_file = pkg_resources.resource_filename("riskmapjnr", "data/ctry_border_GLP.gpkg")
+print(border_file)
+
+
+/home/ghislain/Code/riskmapjnr/riskmapjnr/data/fcc123_GLP.tif
+/home/ghislain/Code/riskmapjnr/riskmapjnr/data/ctry_border_GLP.gpkg
+
+
+We plot the forest cover change map with the plot.fcc123()
function.
+ofile = os.path.join(out_dir, "fcc123.png")
+fig_fcc123 = rmj.plot.fcc123(
+ input_fcc_raster=fcc_file,
+ maxpixels=1e8,
+ output_file=ofile,
+ borders=border_file,
+ linewidth=0.2,
+ figsize=(5, 4), dpi=800)
+ofile
+
+
+
+
+
+
+2 Deforestation risk and distance to forest edge¶
+The first step is to compute the distance to the forest edge after which the risk of deforestation becomes negligible. Indeed, it is known from previous studies on tropical deforestation that the deforestation risk decreases rapidly with the distance to the forest edge and that most of the deforestation occurs close to the forest edge (Vieilledent et al., 2013, Grinand et al., 2020, Vieilledent, 2021, Dezécache et al., 2017). The JNR methodology suggests identifying the distance to the forest edge \(d\), so that at least 99% of the deforestation occurs within a distance \(\leq d\). Forest areas located at a distance from the forest edge \(\gt d\) can be considered as having no risk of being deforested. As a consequence, forest pixels with a distance from the forest edge \(\gt d\) are assigned category 0 (zero) for the deforestation risk.
+ofile = os.path.join(out_dir, "perc_dist.png")
+dist_edge_thres = rmj.dist_edge_threshold(
+ fcc_file=fcc_file,
+ defor_values=1,
+ dist_file=os.path.join(out_dir, "dist_edge.tif"),
+ dist_bins=np.arange(0, 1080, step=30),
+ tab_file_dist=os.path.join(out_dir, "tab_dist.csv"),
+ fig_file_dist=ofile,
+ blk_rows=128, verbose=False)
+ofile
+
+
+
+The function returns a dictionnary including the distance threshold.
+dist_thresh = dist_edge_thres["dist_thresh"]
+print(f"The distance threshold is {dist_thresh} m")
+
+
+The distance threshold is 120 m
+
+
+A table indicating the cumulative percentage of deforestation as a function of the distance is also produced:
+
+
+Distance
+Npixels
+Area
+Cumulation
+Percentage
+
+
+
+30
+24937
+2244.33
+2244.33
+83.583
+
+60
+3451
+310.59
+2554.92
+95.15
+
+90
+1001
+90.09
+2645.01
+98.5051
+
+120
+282
+25.38
+2670.39
+99.4503
+
+150
+102
+9.18
+2679.57
+99.7922
+
+180
+29
+2.61
+2682.18
+99.8894
+
+210
+14
+1.26
+2683.44
+99.9363
+
+240
+6
+0.54
+2683.98
+99.9564
+
+270
+2
+0.18
+2684.16
+99.9631
+
+300
+3
+0.27
+2684.43
+99.9732
+
+
+
+
+
+3 Local deforestation rate¶
+The second step is to compute a local risk of deforestation at the pixel level using a moving window made of several pixels. The deforestation risk is estimated from the deforestation rate inside the moving window. The deforestation rate \(\theta\) (in %/yr) is computed from the formula \(\theta=(\alpha_2/\alpha_1)^{1/\tau}-1\), with \(\alpha\) the forest areas (in ha) at time \(t_1\) and \(t_2\), and \(\tau\), the time interval (in yr) between time \(t_1\) and \(t_2\). Using the deforestation rate formula, the moving window and the past forest cover change map, we can derive a raster map describing the local risk of deforestation at the same resolution as the input map.
+To save space on disk, deforestation rates are converted to integer values between 0 and 10000 (ten thousand) and the raster type is set to UInt16. This ensures a precision of 10-4for the deforestation rate which is sufficient to determine the 30 categories of deforestation risk, as imposed by the JNR methodology.
+# Set window size
+s = 5
+# Compute local deforestation rate
+rmj.local_defor_rate(
+ fcc_file=fcc_file,
+ defor_values=1,
+ ldefrate_file=os.path.join(out_dir, f"ldefrate.tif"),
+ win_size=s,
+ time_interval=10,
+ blk_rows=100,
+ verbose=False)
+
+
+
+
+4 Pixels with zero risk of deforestation¶
+This third step sets a value of 10001 to pixels with zero deforestation risk. As explained previously, a risk of deforestation of zero is assumed when distance to forest edge is greater than the distance below which more than 99% of the deforestation occurs.
+rmj.set_defor_cat_zero(
+ ldefrate_file=os.path.join(out_dir, f"ldefrate.tif"),
+ dist_file=os.path.join(out_dir, "dist_edge.tif"),
+ dist_thresh=dist_thresh,
+ ldefrate_with_zero_file=os.path.join(out_dir, f"ldefrate_with_zero.tif"),
+ blk_rows=128,
+ verbose=False)
+
+
+
+
+5 Categories of deforestation risk¶
+The fourth step implies converting the continuous values of the raster map of deforestation risk to categorical values. The JNR methodology suggests to use 31 classes of risk from “0” to “30” including the “0” class for the forest pixels with no risk of being deforested (located at a distance to the forest edge \(> d\), see first step). Following the JNR methodology, at least three slicing algorithms must be compared to derive the categorical map of deforestation risk, such as “equal area”, “equal interval”, and “natural breaks”. With the “equal area” algorithm, each class from “1” to “30” must cover approximately the same area. With the “equal interval” algorithm, classes from “1” to “30” correspond to bins of deforestation risk of the same range. In this case, some risk classes will be in majority in the landscape compared to other classes of lower frequency. With the “natural breaks” algorithm, the continuous deforestation risk is normalized before running an “equal interval” algorithm.
+rmj.defor_cat(
+ ldefrate_with_zero_file=os.path.join(out_dir, f"ldefrate_with_zero.tif"),
+ riskmap_file=os.path.join(out_dir, "riskmap.tif"),
+ ncat=30,
+ method="Equal Interval",
+ blk_rows=128,
+ verbose=False)
+
+
+The risk map can be plotted using the plot.riskmap()
function.
+ofile = os.path.join(out_dir, "riskmap.png")
+riskmap_fig = rmj.plot.riskmap(
+ input_risk_map=os.path.join(out_dir, "riskmap.tif"),
+ maxpixels=1e8,
+ output_file=ofile,
+ borders=border_file,
+ legend=True,
+ figsize=(5, 4), dpi=800,
+ linewidth=0.2,)
+ofile
+
+
+
+
+
+6 Deforestation rates per category of risk¶
+Before the validation step, we need to compute the historical deforestation rates (in %/yr) for each category of spatial deforestation risk. The historical deforestation rates are computed for the calibration period (here 2000–2010). Deforestation rates provide estimates of the percentage of forest (which is then converted to an area of forest) that should be deforested inside each forest pixel which belongs to a given category of deforestation risk.
+rmj.defrate_per_cat(
+ fcc_file=fcc_file,
+ defor_values=1,
+ riskmap_file=os.path.join(out_dir, "riskmap.tif"),
+ time_interval=10,
+ tab_file_defrate=os.path.join(out_dir, "defrate_per_cat.csv"),
+ blk_rows=128,
+ verbose=False)
+
+
+A table indicating the deforestation rate per category of deforestation is produced:
+
+
+cat
+nfor
+ndefor
+rate
+
+
+
+1
+286897
+0
+0.0
+
+2
+0
+0
+
+
+3
+0
+0
+
+
+4
+0
+0
+
+
+5
+0
+0
+
+
+6
+0
+0
+
+
+7
+0
+0
+
+
+8
+0
+0
+
+
+9
+0
+0
+
+
+10
+0
+0
+
+
+11
+6948
+97
+0.13115645793568742
+
+12
+4555
+83
+0.16797929162030611
+
+13
+4428
+102
+0.207883556342903
+
+14
+4079
+158
+0.32635456697582377
+
+15
+3771
+161
+0.35359204117624776
+
+16
+1733
+102
+0.4548023398767944
+
+17
+2940
+157
+0.4223580050270457
+
+18
+4178
+230
+0.432341580700236
+
+19
+4028
+262
+0.48960250057719656
+
+20
+2401
+182
+0.5453769808930122
+
+21
+3654
+317
+0.596469248332768
+
+22
+1896
+129
+0.5057096122044651
+
+23
+4637
+530
+0.7029181842913952
+
+24
+3192
+398
+0.7359809944026328
+
+25
+2775
+349
+0.7392177123700654
+
+26
+5257
+910
+0.8505428722687592
+
+27
+3933
+780
+0.8903521189382809
+
+28
+4174
+949
+0.9241819269543683
+
+29
+6428
+1870
+0.9678645395136823
+
+30
+31671
+21848
+0.9999917619641472
+
+
+
+From this table, we see that the deforestation rate increases with the deforestation risk category and that deforestation rates are spread on the interval [0, 1], suggesting that category 1 represents well a category with very low deforestation risk (equal to 0), and category 30 represents well a category with very high deforestation risk (close to 1).
+
+
+7 Validation¶
+The fifth step focuses on comparing the map of deforestation risk with a deforestation map corresponding to the validation period. The validation period follows the calibration period and provides independent observations of deforestation.
+To do so, we consider a square grid of at least 1000 spatial cells containing at least one forest pixel at the beginning of the validation period. Following JNR specification, the cell size should be \(\leq\) 10 km. Note that with the map of deforestation risk, each forest pixel at the beginning of the validation period falls into a category of deforestation risk. For each cell of the grid, we compute the predicted area of deforestation (in ha) given the map of deforestation risk and the historical deforestation rates for each category of deforestation risk computed on the calibration period (see previous step).
+We can then compare the predicted deforestation with the observed deforestation in that spatial cell for the validation period. Because all cells don’t have the same forest cover at the beginning of the validation period, a weight \(w_j\) is computed for each grid cell \(j\) such that \(w_j=\beta_j / B\), with \(\beta_j\) the forest cover (in ha) in the cell \(j\) at the beginning of the validation period and \(B\) the total forest cover in the jurisdiction (in ha) at the same date. We then calculate the weighted root mean squared error (wRMSE) from the observed and predicted deforestation for each cell and the cell weights.
+ofile = os.path.join(out_dir, "pred_obs.png")
+rmj.validation(
+ fcc_file=fcc_file,
+ time_interval=10,
+ riskmap_file=os.path.join(out_dir, "riskmap.tif"),
+ tab_file_defrate=os.path.join(out_dir, "defrate_per_cat.csv"),
+ csize=40,
+ tab_file_pred=os.path.join(out_dir, "pred_obs.csv"),
+ fig_file_pred=ofile,
+ figsize=(6.4, 4.8),
+ dpi=100, verbose=False)
+ofile
+
+
+
+
+
+8 Final risk map¶
+The user must repeat the procedure and obtain risk maps for various window size and slicing algorithms. Following the JNR methodology, at least 25 different sizes for the moving window must be tested together with two slicing algorithms (“Equal Interval” and “Equal Area”), thus leading to a minimum of 50 different maps of deforestation risk. The map with the smallest wRMSE value is considered the best risk map. Once the best risk map is identified, with the corresponding window size and slicing algorithm, a final risk map is derived considering both the calibration and validation period (see the Get Started tutorial).
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/docs/objects.inv b/docs/objects.inv
index d1a16eb..cb118b9 100644
Binary files a/docs/objects.inv and b/docs/objects.inv differ
diff --git a/docs/py-modindex.html b/docs/py-modindex.html
index 3bc24a0..dfbb33a 100644
--- a/docs/py-modindex.html
+++ b/docs/py-modindex.html
@@ -60,6 +60,7 @@ Navigation
- Home
- Get Started
+- Articles
- Python API
- Indices and tables
- Changelog
diff --git a/docs/reference.html b/docs/reference.html
index 367aa5d..61eebcd 100644
--- a/docs/reference.html
+++ b/docs/reference.html
@@ -19,7 +19,7 @@
-
+
@@ -60,6 +60,7 @@ Navigation
- Home
- Get Started
+- Articles
- Python API
- Main functions
- Plot functions
@@ -75,7 +76,7 @@ Navigation
Related Topics
- Documentation overview
- - Previous: Get Started
+ - Previous: All steps
- Next: Indices and tables
diff --git a/docs/search.html b/docs/search.html
index a206b6c..48c52cb 100644
--- a/docs/search.html
+++ b/docs/search.html
@@ -63,6 +63,7 @@ Navigation
- Home
- Get Started
+- Articles
- Python API
- Indices and tables
- Changelog
diff --git a/docs/searchindex.js b/docs/searchindex.js
index 5604fe5..30289de 100644
--- a/docs/searchindex.js
+++ b/docs/searchindex.js
@@ -1 +1 @@
-Search.setIndex({"docnames": ["changelog", "code_of_conduct", "contributing", "index", "indices", "license", "notebooks/get_started", "reference"], "filenames": ["changelog.rst", "code_of_conduct.rst", "contributing.rst", "index.rst", "indices.rst", "license.rst", "notebooks/get_started.rst", "reference.rst"], "titles": ["Changelog", "Code of conduct", "Community guidelines", "riskmapjnr
Python package", "Indices and tables", "License", "Get Started", "Python API"], "terms": {"first": [0, 3, 5, 6, 7], "releas": [0, 2, 3, 5], "packag": [0, 2, 5, 6, 7], "In": [1, 3, 5], "interest": [1, 2, 3, 5], "foster": 1, "an": [1, 3, 5, 7], "open": [1, 2, 3], "welcom": [1, 5], "environ": [1, 3, 6], "we": [1, 5, 6, 7], "contributor": [1, 2, 3, 5], "maintain": [1, 5], "make": [1, 2, 5, 7], "particip": 1, "project": [1, 2, 3], "commun": [1, 3, 5], "harass": 1, "free": [1, 2, 5], "experi": 1, "everyon": [1, 5], "regardless": [1, 5], "ag": 1, "bodi": [1, 5], "size": [1, 3, 6, 7], "disabl": 1, "ethnic": 1, "sex": 1, "characterist": 1, "gender": 1, "ident": [1, 6], "express": [1, 5], "level": [1, 3, 7], "educ": 1, "socio": 1, "econom": 1, "statu": [1, 5], "nation": [1, 3], "person": [1, 5], "appear": 1, "race": 1, "religion": 1, "sexual": 1, "orient": 1, "exampl": [1, 2, 5, 7], "behavior": 1, "contribut": 1, "creat": [1, 2, 3, 6, 7], "posit": [1, 7], "includ": [1, 3, 5, 6, 7], "us": [1, 6, 7], "inclus": [1, 5], "languag": [1, 5], "Being": 1, "respect": [1, 5], "differ": [1, 3, 5, 7], "viewpoint": 1, "gracefulli": 1, "accept": 1, "construct": 1, "critic": 1, "focus": 1, "what": [1, 5], "best": [1, 3, 5, 7], "show": [1, 5, 6], "empathi": 1, "toward": 1, "other": [1, 3, 7], "member": 1, "unaccept": [1, 5], "The": [1, 2, 3, 5, 6, 7], "imageri": 1, "unwelcom": 1, "attent": 1, "advanc": 1, "troll": 1, "insult": 1, "derogatori": 1, "comment": 1, "polit": 1, "attack": 1, "public": [1, 3], "privat": [1, 5], "publish": [1, 5], "inform": [1, 3, 5], "physic": [1, 5], "electron": [1, 5], "address": [1, 5], "without": [1, 5], "explicit": 1, "permiss": 1, "which": [1, 2, 3, 5, 6], "could": [1, 5], "reason": [1, 5], "consid": [1, 5, 6, 7], "inappropri": 1, "profession": 1, "set": [1, 6, 7], "ar": [1, 2, 3, 5, 6, 7], "clarifi": 1, "expect": [1, 5], "take": [1, 5], "appropri": [1, 5], "fair": [1, 5], "correct": [1, 3, 5], "action": [1, 5], "ani": [1, 3, 5], "instanc": 1, "have": [1, 3, 6, 7], "right": 1, "remov": [1, 3, 5], "edit": 1, "reject": 1, "commit": [1, 2, 5], "wiki": 1, "issu": 1, "align": 1, "thi": [1, 2, 3, 6, 7], "ban": 1, "temporarili": 1, "perman": [1, 5], "thei": [1, 3, 5], "deem": [1, 5], "threaten": [1, 5], "offens": 1, "harm": 1, "appli": [1, 3], "within": [1, 3, 5, 6], "all": [1, 3, 5, 6, 7], "space": 1, "also": [1, 3, 5, 6, 7], "when": [1, 5, 7], "individu": [1, 5], "repres": [1, 3, 5, 7], "its": [1, 3, 5], "offici": [1, 5], "e": [1, 3, 5], "mail": [1, 5], "post": 1, "via": [1, 2], "social": 1, "media": 1, "account": [1, 3], "act": 1, "appoint": 1, "onlin": 1, "offlin": 1, "event": [1, 5], "represent": 1, "mai": [1, 5], "further": [1, 5], "defin": [1, 5, 7], "abus": [1, 5], "otherwis": [1, 5], "report": [1, 6], "contact": [1, 5], "team": 1, "ghislain": [1, 6], "dot": 1, "vieilled": 1, "cirad": 1, "fr": [1, 3], "complaint": 1, "review": [1, 5], "investig": 1, "result": [1, 3, 5], "necessari": [1, 5, 7], "circumst": [1, 5], "oblig": [1, 5], "confidenti": 1, "regard": [1, 5], "incid": 1, "detail": [1, 3, 5, 6], "specif": [1, 5], "polici": 1, "separ": [1, 5], "who": [1, 2, 3, 5], "do": [1, 2, 5], "follow": [1, 2, 3, 5, 6, 7], "good": [1, 2], "faith": 1, "face": 1, "temporari": 1, "repercuss": 1, "determin": [1, 3, 5], "s": [1, 2, 3, 5, 7], "leadership": 1, "adapt": [1, 5], "from": [1, 2, 3, 6, 7], "coven": [1, 5], "version": [1, 2, 3, 6, 7], "1": [1, 3, 7], "4": [1, 7], "avail": [1, 5], "http": [1, 3, 5], "www": [1, 5], "org": [1, 5], "html": [1, 5], "For": [1, 3, 5, 7], "answer": 1, "common": [1, 5], "question": 1, "about": [1, 5], "see": [1, 3, 5, 7], "faq": 1, "riskmapjnr": [2, 6, 7], "python": 2, "sourc": [2, 3, 7], "under": [2, 3, 5, 7], "gnu": [2, 3], "gpl": [2, 3, 5], "3": [2, 3, 7], "licens": [2, 3], "anybodi": [2, 3], "can": [2, 3, 5, 6, 7], "develop": [2, 3, 5], "There": 2, "mani": 2, "wai": [2, 3, 5, 7], "write": [2, 5], "tutori": [2, 3], "test": 2, "improv": 2, "document": [2, 5], "submit": 2, "bug": 2, "featur": [2, 5], "request": 2, "provid": [2, 3, 5, 7], "new": [2, 3, 7], "function": [2, 5, 6], "incorpor": [2, 3, 5], "futur": [2, 5], "everi": [2, 3, 5], "must": [2, 3, 5, 7], "agre": [2, 3, 5], "Of": [2, 5], "conduct": [2, 3], "If": [2, 5, 7], "you": [2, 3, 5], "want": [2, 5], "discuss": 2, "pleas": [2, 5], "github": [2, 3], "page": [2, 3, 4], "chang": [2, 3, 5, 7], "should": [2, 3, 5], "made": [2, 5], "pull": 2, "pr": 2, "learn": 2, "how": [2, 3, 6], "video": 2, "seri": 2, "aaron": 2, "meurer": 2, "git": 2, "workflow": 2, "guid": 2, "import": [2, 5, 7], "step": [2, 3, 5, 6, 7], "start": [2, 3, 5], "fork": 2, "repositori": [2, 3], "branch": 2, "default": [2, 7], "master": [2, 3], "keep": [2, 5], "your": [2, 3], "up": [2, 6], "date": [2, 5, 7], "chri": 2, "beam": 2, "ha": [2, 3, 5, 6, 7], "written": [2, 5], "messag": [2, 7], "push": 2, "obtain": [3, 6, 7], "map": [3, 7], "spatial": [3, 6, 7], "risk": [3, 5, 7], "deforest": [3, 7], "forest": [3, 7], "degrad": 3, "methodolog": [3, 6, 7], "context": [3, 5], "jurisdict": 3, "nest": 3, "redd": 3, "jnr": [3, 6, 7], "vc": 3, "verifi": 3, "carbon": 3, "standard": [3, 5], "program": 3, "allow": [3, 5], "certifi": 3, "turn": 3, "greenhous": 3, "ga": 3, "ghg": 3, "emiss": 3, "reduct": 3, "tradabl": 3, "credit": 3, "sinc": 3, "launch": 3, "2006": 3, "grown": 3, "world": 3, "largest": 3, "voluntari": 3, "sector": 3, "mitig": 3, "across": [3, 5], "entir": [3, 5, 7], "subnat": 3, "call": [3, 5, 6, 7], "i": [3, 7], "aim": [3, 5], "reduc": 3, "scale": 3, "framework": 3, "integr": 3, "govern": [3, 5], "led": 3, "activ": [3, 5], "establish": 3, "clear": [3, 5], "pathwai": 3, "broader": 3, "ensur": [3, 5], "given": [3, 5, 7], "consist": [3, 5], "baselin": 3, "approach": 3, "leakag": 3, "displac": 3, "caus": [3, 5], "area": [3, 5, 6, 7], "outsid": [3, 5], "boundari": 3, "monitor": 3, "tool": [3, 5], "benchmark": 3, "user": 3, "alloc": 3, "requir": 3, "deriv": 3, "base": [3, 5], "minim": 3, "past": 3, "creation": 3, "categor": [3, 6, 7], "static": 3, "whose": [3, 5], "categori": [3, 7], "valid": [3, 5, 7], "period": [3, 6, 7], "refer": [3, 5], "frel": 3, "throughout": 3, "geograph": 3, "distribut": [3, 5], "lower": [3, 7], "while": [3, 7], "assum": [5, 7], "simplic": 3, "straightforward": 3, "sever": [3, 7], "geoprocess": 3, "raster": [3, 6, 7], "data": [3, 5, 7], "larg": 3, "cover": [3, 5, 7], "extent": [3, 5], "eg": 3, "high": 3, "resolut": [3, 7], "30": [3, 5, 6, 7], "m": [3, 6, 7], "modul": [3, 4], "uniqu": [], "collect": 5, "perform": [3, 5, 6], "depend": 3, "run": [3, 5, 6, 7], "virtual": 3, "either": [3, 5, 7], "through": [3, 5], "miniconda3": [3, 6], "here": 3, "Then": 3, "command": [3, 5], "name": [3, 5, 7], "rmj": [3, 6], "c": [3, 5], "forg": 3, "gdal": [3, 6], "numpi": [3, 6, 7], "matplotlib": [3, 7], "panda": [3, 6], "pip": 3, "scipi": [3, 7], "ye": 3, "pypi": 3, "com": 3, "ghislainv": 3, "archiv": 3, "zip": 3, "dev": 3, "jupyt": 3, "geopanda": 3, "descart": 3, "folium": 3, "option": [3, 5, 7], "addit": [3, 7], "To": [3, 5], "deactiv": 3, "delet": [3, 7], "env": [3, 6], "cd": 3, "mkdir": 3, "venv": 3, "directori": [3, 6, 7], "usr": 3, "bin": [3, 7], "python3": 3, "global": 3, "build_ext": 3, "config": 3, "rm": 3, "r": 3, "just": [3, 7], "been": [3, 5, 7], "correctli": [3, 7], "termin": [3, 7], "return": [3, 5, 7], "short": [3, 5], "descript": [3, 7], "number": [3, 5, 6, 7], "ecolog": 3, "x": [3, 6, 7], "execut": [3, 5], "get": [3, 5], "todo": [], "our": [3, 5], "guidelin": 3, "code": [3, 6], "home": [3, 6], "introduct": [], "api": 3, "miscellan": 3, "indic": [5, 6], "changelog": 3, "0": [3, 6, 7], "gener": 3, "preambl": 3, "term": 3, "AND": 3, "condit": 3, "These": 3, "index": [3, 4], "search": [3, 4], "local": [3, 5, 7], "29": 5, "june": 5, "2007": 5, "copyright": 5, "softwar": 5, "foundat": 5, "inc": 5, "fsf": 5, "permit": 5, "copyleft": 5, "kind": 5, "work": [5, 7], "most": 5, "practic": 5, "design": 5, "awai": 5, "share": [5, 6], "By": 5, "contrast": 5, "intend": 5, "guarante": 5, "sure": 5, "remain": [5, 6, 7], "author": 5, "too": 5, "speak": 5, "price": 5, "charg": 5, "them": [5, 7], "wish": 5, "receiv": 5, "piec": 5, "know": 5, "thing": 5, "need": [5, 6], "prevent": 5, "deni": 5, "ask": 5, "therefor": 5, "certain": 5, "respons": 5, "whether": [5, 7], "grati": 5, "fee": 5, "pass": 5, "same": [5, 7], "And": 5, "so": [5, 7], "two": [5, 7], "assert": 5, "offer": 5, "give": 5, "clearli": 5, "explain": 5, "both": [5, 7], "sake": 5, "mark": 5, "problem": 5, "attribut": 5, "erron": 5, "previou": 5, "some": [5, 7], "devic": 5, "access": [5, 6], "instal": 5, "insid": 5, "although": 5, "manufactur": 5, "fundament": 5, "incompat": 5, "systemat": 5, "pattern": 5, "occur": [5, 6], "product": 5, "precis": 5, "where": 5, "prohibit": 5, "those": 5, "aris": 5, "substanti": 5, "domain": 5, "stand": 5, "readi": 5, "extend": 5, "provis": 5, "final": 5, "constantli": 5, "state": 5, "restrict": 5, "purpos": 5, "comput": [3, 5, 6, 7], "avoid": [5, 7], "special": 5, "danger": 5, "effect": 5, "proprietari": 5, "assur": 5, "cannot": 5, "render": 5, "modif": 5, "mean": [5, 6, 7], "like": 5, "semiconductor": 5, "mask": 5, "each": [5, 7], "license": 5, "organ": 5, "part": 5, "fashion": 5, "than": [5, 6, 7], "exact": 5, "earlier": 5, "A": [5, 7], "unmodifi": 5, "propag": 5, "anyth": 5, "would": 5, "directli": 5, "secondarili": 5, "liabl": 5, "infring": 5, "applic": 5, "except": [5, 7], "countri": [3, 5], "well": [5, 7], "enabl": 5, "parti": 5, "mere": 5, "interact": 5, "network": 5, "transfer": 5, "interfac": 5, "displai": 5, "notic": 5, "conveni": 5, "promin": 5, "visibl": 5, "tell": 5, "view": 5, "present": [5, 7], "list": [5, 7], "menu": 5, "item": 5, "meet": 5, "criterion": 5, "prefer": 5, "object": [5, 7], "recogn": 5, "case": [5, 6], "specifi": 5, "particular": 5, "one": [5, 7], "wide": 5, "among": 5, "system": 5, "librari": 5, "whole": 5, "normal": [5, 7], "major": 5, "compon": 5, "b": 5, "serv": 5, "onli": [3, 5, 6, 7], "implement": [5, 7], "essenti": 5, "kernel": 5, "window": [3, 5, 6, 7], "oper": [3, 5], "compil": 5, "produc": [5, 7], "correspond": [5, 7], "script": 5, "control": 5, "howev": 5, "doe": [5, 7], "file": [3, 5, 6, 7], "associ": [5, 7], "dynam": 5, "link": 5, "subprogram": 5, "intim": 5, "flow": 5, "between": [5, 6, 7], "regener": 5, "grant": 5, "irrevoc": 5, "met": 5, "explicitli": 5, "affirm": 5, "unlimit": 5, "output": [5, 7], "content": 5, "constitut": 5, "acknowledg": 5, "equival": 5, "long": 5, "forc": 5, "sole": 5, "exclus": 5, "facil": 5, "compli": 5, "materi": 5, "thu": 5, "behalf": 5, "direct": 5, "relationship": [5, 6, 7], "below": [5, 7], "sublicens": 5, "unnecessari": 5, "shall": 5, "technolog": 5, "measur": 5, "fulfil": 5, "articl": 5, "wipo": 5, "treati": 5, "adopt": 5, "20": [5, 6], "decemb": 5, "1996": 5, "similar": 5, "waiv": 5, "power": 5, "forbid": 5, "exercis": 5, "intent": 5, "enforc": 5, "against": 5, "third": 5, "medium": 5, "conspicu": 5, "intact": 5, "ad": 5, "accord": 5, "absenc": 5, "along": 5, "support": 5, "carri": 5, "relev": 5, "anyon": 5, "come": 5, "possess": 5, "invalid": 5, "d": 5, "independ": 5, "natur": [5, 7], "extens": 5, "combin": 5, "larger": 5, "volum": 5, "storag": 5, "aggreg": 5, "beyond": [3, 5, 6, 7], "machin": 5, "readabl": 5, "embodi": 5, "accompani": 5, "fix": 5, "durabl": 5, "customarili": 5, "interchang": 5, "least": 5, "three": [5, 7], "year": [5, 7], "spare": 5, "custom": 5, "model": [5, 7], "more": [5, 6], "cost": 5, "server": 5, "altern": 5, "occasion": 5, "noncommerci": 5, "subsect": 5, "6b": 5, "place": 5, "next": 5, "sai": 5, "find": 5, "host": 5, "satisfi": 5, "peer": 5, "transmiss": 5, "being": [5, 6], "6d": 5, "portion": 5, "exclud": [5, 7], "consum": 5, "tangibl": 5, "properti": 5, "famili": 5, "household": 5, "sold": 5, "dwell": 5, "doubt": 5, "resolv": 5, "favor": [3, 5], "coverag": 5, "typic": [5, 7], "class": [5, 6, 7], "actual": 5, "commerci": 5, "industri": 5, "unless": 5, "signific": 5, "mode": [5, 7], "method": [5, 6, 7], "procedur": 5, "kei": 5, "suffic": 5, "continu": 5, "interf": 5, "becaus": 5, "transact": 5, "perpetu": 5, "character": 5, "But": 5, "neither": 5, "nor": 5, "retain": 5, "abil": 5, "rom": 5, "servic": 5, "updat": 5, "itself": 5, "advers": 5, "affect": 5, "violat": 5, "rule": 5, "protocol": 5, "format": 5, "publicli": 5, "password": 5, "unpack": 5, "read": 5, "supplement": 5, "treat": 5, "though": 5, "were": 5, "own": 5, "notwithstand": 5, "add": [5, 7], "holder": 5, "preserv": 5, "contain": 5, "misrepresent": 5, "origin": 5, "licensor": 5, "declin": 5, "trademark": 5, "trade": 5, "f": [5, 6], "indemnif": 5, "contractu": 5, "assumpt": 5, "impos": 5, "relicens": 5, "surviv": 5, "statement": 5, "abov": 5, "expressli": 5, "attempt": 5, "void": 5, "paragraph": 5, "ceas": 5, "reinstat": 5, "provision": 5, "until": 5, "fail": 5, "notifi": 5, "prior": 5, "60": [5, 6, 7], "dai": 5, "after": 5, "cessat": 5, "moreov": 5, "time": [5, 7], "cure": 5, "receipt": 5, "qualifi": 5, "order": 5, "ancillari": 5, "consequ": 5, "likewis": 5, "noth": 5, "subject": 5, "complianc": 5, "entiti": 5, "asset": 5, "subdivid": 5, "merg": 5, "whatev": 5, "predecessor": 5, "had": 5, "plu": [5, 7], "effort": 5, "royalti": 5, "initi": 5, "litig": 5, "cross": 5, "claim": 5, "counterclaim": 5, "lawsuit": 5, "alleg": 5, "sell": 5, "sale": 5, "alreadi": [5, 7], "acquir": 5, "hereaft": 5, "manner": 5, "worldwid": 5, "agreement": 5, "denomin": 5, "sue": 5, "knowingli": 5, "reli": 5, "readili": 5, "arrang": 5, "depriv": 5, "yourself": 5, "benefit": 5, "knowledg": 5, "identifi": [5, 6, 7], "believ": 5, "pursuant": 5, "connect": 5, "singl": 5, "procur": 5, "convey": 5, "discriminatori": 5, "scope": 5, "busi": 5, "payment": 5, "primarili": 5, "enter": 5, "wa": 5, "28": [5, 7], "march": 5, "constru": 5, "impli": 5, "defens": 5, "court": 5, "contradict": 5, "excus": 5, "simultan": 5, "pertin": 5, "whom": 5, "refrain": 5, "concern": 5, "Such": [3, 5], "spirit": 5, "distinguish": 5, "later": 5, "choos": 5, "ever": 5, "proxi": 5, "decid": 5, "THERE": 5, "IS": 5, "NO": 5, "FOR": 5, "THE": 5, "TO": 5, "BY": 5, "IN": 5, "OR": 5, "AS": 5, "OF": 5, "BUT": 5, "NOT": 5, "merchant": 5, "fit": 5, "qualiti": 5, "WITH": 5, "prove": 5, "defect": 5, "repair": 5, "WILL": 5, "BE": 5, "damag": 5, "incident": 5, "consequenti": 5, "out": 5, "inabl": 5, "loss": 5, "BEING": 5, "inaccur": 5, "sustain": 5, "failur": 5, "even": 5, "IF": 5, "SUCH": 5, "advis": 5, "possibl": 5, "close": 5, "approxim": [5, 7], "absolut": 5, "waiver": 5, "civil": 5, "end": [5, 7], "greatest": 5, "achiev": 5, "redistribut": 5, "attach": 5, "It": [5, 7], "safest": 5, "line": [5, 6, 7], "pointer": 5, "full": 5, "found": 5, "brief": 5, "idea": 5, "hope": 5, "paper": 5, "type": [5, 7], "w": 5, "hypothet": 5, "cours": 5, "might": 5, "gui": 5, "box": 5, "employ": 5, "programm": 5, "school": 5, "sign": 5, "subroutin": 5, "lesser": 5, "instead": 5, "philosophi": 5, "why": 5, "lgpl": 5, "analysi": [6, 7], "os": 6, "np": [6, 7], "pyplot": [], "plt": [], "pd": 6, "hold": 7, "ouput": [], "make_dir": [6, 7], "increas": [6, 7], "cach": 6, "speed": 6, "gdal_cachemax": 6, "1024": 6, "input_fil": [], "dist_fil": 7, "tab_fil": [], "fig_fil": [], "figsiz": [6, 7], "6": [6, 7], "8": [6, 7], "dpi": [6, 7], "100": [6, 7], "arrai": 7, "90": [6, 7], "120": [6, 7], "150": [6, 7], "180": [6, 7], "210": [6, 7], "240": [6, 7], "270": [6, 7], "300": [6, 7], "330": 7, "360": 7, "390": 7, "420": 7, "450": 7, "480": 7, "510": 7, "540": 7, "570": 7, "600": 7, "630": 7, "660": 7, "690": 7, "720": 7, "750": 7, "780": 7, "810": 7, "840": 7, "870": 7, "900": 7, "930": 7, "960": 7, "990": 7, "1020": 7, "1050": 7, "blk_row": [6, 7], "128": [6, 7], "percentag": [6, 7], "total": 7, "distanc": [3, 7], "edg": [3, 7], "tabl": [6, 7], "cumul": [6, 7], "threshold": [6, 7], "99": [6, 7], "landscap": 7, "plot": [3, 6], "unit": 7, "input": [3, 7], "paramet": 7, "123": 7, "2": [3, 7], "second": [6, 7], "No": 7, "valu": [6, 7], "zero": 7, "path": [6, 7], "csv": 7, "variabl": [6, 7], "npix": 7, "pixel": [6, 7], "cum": 7, "sum": 7, "perc": 7, "figur": [6, 7], "imag": 7, "dimension": 7, "monoton": 7, "arang": [6, 7], "1080": [6, 7], "row": 7, "block": [3, 7], "break": 7, "lage": 7, "memori": [3, 7], "dictionari": 7, "With": 7, "tot_def": 7, "dist_thresh": [6, 7], "dist_valu": [], "shortest": [], "georeferenc": 3, "coordin": [], "none": 7, "uint32": [], "4294967295": [], "nodata": [6, 7], "output_fil": [6, 7], "win_siz": [6, 7], "time_interv": [6, 7], "rate": [3, 7], "move": [3, 6, 7], "focal": 7, "uniform_filt": 7, "over": 7, "generic_filt": 7, "40": [6, 7], "slower": 7, "stride": 7, "cell": [6, 7], "exist": 7, "constant": 7, "cval": 7, "odd": 7, "equal": [6, 7], "interv": [6, 7], "observ": [6, 7], "greater": 7, "rang": 7, "10000": 7, "uint16": 7, "65535": 7, "defor_cat_zero": [], "tif": [6, 7], "verbos": [6, 7], "true": [6, 7], "10001": 7, "integ": 7, "ten": 7, "thousand": 7, "current": 7, "assign": 7, "logic": 7, "print": [6, 7], "fcc_file": [6, 7], "defor_cat_fil": [], "per": 7, "histor": 7, "estim": [3, 7], "nbin": [], "previous": 7, "surfac": 7, "predomin": 7, "small": 7, "befor": 7, "slice": [3, 6, 7], "algorithm": [3, 6, 7], "byte": 7, "255": 7, "defrate_per_cat_fil": [], "csize": [6, 7], "validation_data": [], "pred_ob": 7, "png": [6, 7], "predict": [6, 7], "grid": [6, 7], "maximum": 7, "10km": 7, "compar": 7, "vs": 7, "weight": [6, 7], "root": [6, 7], "squar": [6, 7], "error": [6, 7], "wrmse": [6, 7], "hectar": 7, "10": [6, 7], "km": [6, 7], "9": 7, "ncell": 7, "begin": 7, "csize_km": 7, "kilomet": 7, "invers": 7, "logit": 7, "differenci": 7, "neg": 7, "overflow": 7, "exp": 7, "param": 7, "silent": 7, "complet": 7, "regular": 7, "rais": 7, "parent": 7, "newdir": 7, "entri": 7, "point": 7, "check": 7, "pkg_resourc": 6, "tabul": 6, "proj_lib": 6, "pyenv": 6, "latest": 6, "conda": 6, "proj": 6, "guadeloup": 6, "archipelago": 6, "studi": 6, "recent": 6, "fcc123_glp": 6, "2000": [6, 7], "2010": [6, 7], "2020": [6, 7], "resource_filenam": 6, "becom": [], "neglig": [3, 6], "inde": [], "known": 3, "tropic": [], "decreas": [], "rapidli": [], "et": [], "al": [], "2013": [], "grinand": [], "2021": [], "dez\u00e9cach": [], "2017": [], "suggest": [], "leq": [], "locat": 6, "gt": [], "As": [], "ofil": 6, "plot_dist": [], "dist_edge_threshold": [3, 7], "dist_edg": 7, "tab_dist": [], "npixel": 6, "25325": [], "2279": [], "25": [], "85": [], "2263": [], "3134": [], "282": [], "06": [], "2561": [], "31": 6, "95": [], "7732": [], "869": [], "78": [], "21": [], "2639": [], "52": [], "98": 6, "6976": [], "235": [], "15": 6, "2660": [], "67": [], "4885": [], "91": [], "19": [], "2668": [], "86": [], "7947": [], "7": [], "2671": [], "56": [], "8957": [], "35": [], "2672": [], "9462": [], "5": [6, 7], "45": [], "2673": [], "36": 6, "963": [], "18": [], "54": [], "9697": [], "72": [], "9764": [], "local_defor_r": [3, 7], "set_defor_cat_zero": [3, 7], "defrate_per_cat": [3, 7], "defor_cat": [3, 7], "750m": [], "environment": 6, "calibr": [6, 7], "dist_edge_thr": [], "dictionnari": [], "theta": [], "yr": [], "formula": [], "alpha_2": [], "alpha_1": [], "tau": [], "alpha": [], "t_1": [], "t_2": [], "describ": [], "save": 6, "disk": [], "convert": [], "suffici": [], "th": [], "ws": [], "ldefrate_w": 7, "ldefrate_ws31": [], "fourth": [], "frequenc": [], "belong": 6, "divid": 3, "region": 7, "statist": [], "50": [], "55": [], "65": [], "70": [], "75": [], "80": [], "cat": [], "nfor": [], "ndefor": [], "39841": [], "00200617": [], "13367": [], "0214846": [], "13238": [], "46": 6, "0342101": [], "13348": [], "05265": [], "13290": [], "105": [], "0762562": [], "13309": [], "107158": [], "13328": [], "168": [], "119136": [], "13175": [], "184": [], "1312": [], "13435": [], "232": [], "159864": [], "13272": [], "268": [], "184534": [], "11": 7, "13336": [], "348": [], "232344": [], "12": [], "13291": [], "386": [], "255262": [], "13": 6, "13308": [], "410": [], "2687": [], "14": [], "13296": [], "491": [], "313587": [], "13304": [], "628": [], "383405": [], "16": 6, "13315": [], "649": [], "393287": [], "17": [], "13285": [], "611": [], "375516": [], "13333": [], "763": [], "44528": [], "955": [], "525106": [], "13301": [], "1041": [], "557349": [], "1270": [], "633328": [], "22": 6, "13288": [], "1509": [], "700437": [], "23": [], "13321": [], "1623": [], "727261": [], "24": [], "13300": [], "1790": [], "764367": [], "13302": [], "2280": [], "847442": [], "26": 7, "13314": [], "2751": [], "901193": [], "27": 7, "13295": [], "3834": [], "966697": [], "6932": [], "99936": [], "note": [], "slightli": [], "inferior": [], "spread": [], "veri": [], "low": [], "vari": 3, "transform": 3, "select": [3, 7], "higher": 3, "accuraci": 3, "scientif": 3, "fast": 3, "matrix": 3, "vector": [3, 7], "process": 3, "g": 3, "fifth": [], "1000": 7, "fall": [], "don": [], "t": [], "w_j": [], "j": [], "beta_j": [], "calcul": [], "red": 6, "n": 6, "graph": 6, "repeat": [], "variou": [], "togeth": [], "lead": [], "minimum": [], "smallest": [], "onc": [], "dist_bin": [6, 7], "tab_file_dist": 7, "perc_dist": [6, 7], "fig_file_dist": 7, "ldefrate_fil": 7, "ldefrate_with_zero_fil": 7, "ldefrate_with_zero": 7, "tab_file_defr": 7, "ncat": [6, 7], "tab_file_pr": 7, "fig_file_pr": 7, "defor_valu": 7, "scalar": 7, "makemap": [6, 7], "output_dir": [6, 7], "clean": [6, 7], "fals": [6, 7], "peform": 7, "tab_file_map_comp": [], "fig_file_map_comp": [], "calval_dir": 7, "dure": 7, "dist_edge_c": 7, "_with_zero": 7, "defor_cat_w": [], "_": 7, "defrate_per_cat_w": 7, "pred_obs_w": 7, "abbrevi": 7, "ei": [6, 7], "ea": 7, "nb": 7, "ws_hat": [6, 7], "m_hat": [6, 7], "wrmse_hat": 7, "invlogit": 7, "make_squar": [], "rasterfil": [], "square_s": [], "33": [], "caracterist": [], "side": [], "tupl": [], "length": 7, "axi": [], "y": [], "offset": [], "makeblock": [], "256": [], "progress_bar": [], "niter": [], "draw": [], "iter": [], "tree": 7, "dir_path": 7, "int": 7, "limit_to_directori": 7, "bool": 7, "length_limit": 7, "visual": 7, "structur": 7, "limit": 7, "recurs": 7, "stuctur": 7, "results_makemap": 6, "outputs_makemap": 6, "48": 6, "theshold": 6, "53389": [], "4805": [], "01": 6, "253": [], "10235": [], "921": [], "5726": [], "89": [], "6795": [], "3848": [], "346": [], "32": [], "6072": [], "1033": [], "1474": [], "132": [], "66": [], "6205": [], "97": 6, "181": [], "914": [], "82": [], "6287": [], "4693": 6, "428": [], "38": [], "6325": [], "92": [], "0725": [], "230": [], "6346": [], "62": [], "3967": [], "178": [], "02": [], "6362": [], "64": 6, "6476": [], "6370": [], "74": [], "7745": [], "39": [], "51": [], "6374": [], "8294": [], "pred_obs_ws5_ei": 6, "done": [], "riskmap_fil": 7, "riskmap": [6, 7], "map_comp": 7, "riskmap_w": 7, "calval": 7, "perc_dist_c": 7, "input_risk_map": [6, 7], "prob": 7, "maxpixel": [6, 7], "500000": 7, "border": [6, 7], "legend": [6, 7], "69": 7, "kwarg": 7, "probabl": 7, "colorbar": 7, "inch": 7, "keyword": 7, "argument": 7, "border_fil": 6, "ctry_border_glp": 6, "gpkg": 6, "sequenc": 6, "52150": 6, "73": 6, "6676": 6, "10755": 6, "967": 6, "911": 6, "5661": 6, "88": 6, "8602": 6, "4192": 6, "377": 6, "265": 6, "6038": 6, "49": 6, "94": 6, "7818": 6, "1654": 6, "148": 6, "854": 6, "6187": 6, "34": [6, 7], "1183": 6, "968": 6, "87": 6, "1165": 6, "6274": 6, "4857": 6, "402": 6, "1785": 6, "6310": 6, "0536": 6, "233": 6, "9692": 6, "6331": 6, "3827": 6, "149": 6, "4095": 6, "6345": 6, "5932": 6, "99964": 6, "6354": 6, "7344": 6, "13983": 6, "6358": 6, "7994": 6, "easi": [], "manipul": [], "leaflet": [], "join": 6, "riskmap_ws5_ei": 6, "riskmap_fig": 6, "1e8": 6, "800": 6, "linewidth": 6, "fcc123": [6, 7], "input_fcc_rast": [6, 7], "zoom": 7, "col": 7, "165": 7, "227": 7, "139": 7, "xmin": 7, "xmax": 7, "ymin": 7, "ymax": 7, "rgba": 7, "color": 7, "out_dir": 6, "orang": 6, "green": 6, "fig_fcc123": 6, "farther": 6}, "objects": {"": [[7, 0, 0, "-", "riskmapjnr"]], "riskmapjnr": [[7, 1, 1, "", "defor_cat"], [7, 1, 1, "", "defrate_per_cat"], [7, 1, 1, "", "dist_edge_threshold"], [7, 1, 1, "", "local_defor_rate"], [7, 1, 1, "", "makemap"], [7, 0, 0, "-", "plot"], [7, 0, 0, "-", "riskmapjnr"], [7, 1, 1, "", "set_defor_cat_zero"], [7, 1, 1, "", "validation"]], "riskmapjnr.misc": [[7, 0, 0, "-", "miscellaneous"]], "riskmapjnr.misc.miscellaneous": [[7, 1, 1, "", "invlogit"], [7, 1, 1, "", "make_dir"], [7, 1, 1, "", "tree"]], "riskmapjnr.plot": [[7, 1, 1, "", "fcc123"], [7, 1, 1, "", "riskmap"]], "riskmapjnr.riskmapjnr": [[7, 1, 1, "", "main"]]}, "objtypes": {"0": "py:module", "1": "py:function"}, "objnames": {"0": ["py", "module", "Python module"], "1": ["py", "function", "Python function"]}, "titleterms": {"changelog": 0, "riskmapjnr": [0, 3], "0": [0, 5], "1": [0, 5, 6], "code": [1, 2, 5], "conduct": 1, "our": 1, "pledg": 1, "standard": 1, "respons": 1, "scope": 1, "enforc": 1, "attribut": 1, "commun": 2, "guidelin": 2, "report": 2, "an": 2, "issu": 2, "contribut": [2, 3], "python": [3, 6, 7], "packag": 3, "overview": 3, "statement": 3, "need": 3, "instal": 3, "us": [3, 5], "conda": 3, "recommend": 3, "virtualenv": 3, "test": 3, "main": [3, 7], "function": [3, 7], "tabl": [3, 4], "content": 3, "indic": [3, 4], "licens": 5, "gnu": 5, "gener": 5, "public": 5, "preambl": [5, 6], "term": 5, "AND": 5, "condit": 5, "definit": 5, "sourc": 5, "2": [5, 6], "basic": 5, "permiss": 5, "3": [5, 6], "protect": 5, "user": 5, "legal": 5, "right": 5, "from": 5, "anti": 5, "circumvent": 5, "law": 5, "4": [5, 6], "convei": 5, "verbatim": 5, "copi": 5, "5": 5, "modifi": 5, "version": 5, "6": 5, "non": 5, "form": 5, "7": 5, "addit": 5, "8": 5, "termin": 5, "9": 5, "accept": 5, "Not": 5, "requir": 5, "have": 5, "10": 5, "automat": 5, "downstream": 5, "recipi": 5, "11": 5, "patent": 5, "12": 5, "No": 5, "surrend": 5, "other": 5, "freedom": 5, "13": 5, "affero": 5, "14": 5, "revis": 5, "thi": 5, "15": 5, "disclaim": 5, "warranti": 5, "16": 5, "limit": 5, "liabil": 5, "17": 5, "interpret": 5, "section": 5, "how": 5, "appli": 5, "These": 5, "your": 5, "new": 5, "program": 5, "get": 6, "start": 6, "introduct": [], "import": 6, "modul": 6, "api": 7, "dist_edge_threshold": [], "local_defor_r": [], "set_defor_cat_zero": [], "defrate_per_cat": [], "defor_cat": [], "valid": 6, "miscellan": 7, "invlogit": [], "make_dir": [], "forest": 6, "cover": 6, "chang": 6, "data": 6, "deforest": 6, "risk": 6, "distanc": 6, "edg": 6, "local": [], "rate": [], "categori": [], "zero": [], "per": [], "pixel": [], "final": [], "map": 6, "deriv": 6, "result": 6, "riskmap": [], "plot": 7, "best": 6, "model": 6, "matplotlib": []}, "envversion": {"sphinx.domains.c": 2, "sphinx.domains.changeset": 1, "sphinx.domains.citation": 1, "sphinx.domains.cpp": 6, "sphinx.domains.index": 1, "sphinx.domains.javascript": 2, "sphinx.domains.math": 2, "sphinx.domains.python": 3, "sphinx.domains.rst": 2, "sphinx.domains.std": 2, "sphinx.ext.viewcode": 1, "nbsphinx": 4, "sphinx": 56}})
\ No newline at end of file
+Search.setIndex({"docnames": ["articles", "changelog", "code_of_conduct", "contributing", "index", "indices", "license", "notebooks/get_started", "notebooks/steps", "reference"], "filenames": ["articles.rst", "changelog.rst", "code_of_conduct.rst", "contributing.rst", "index.rst", "indices.rst", "license.rst", "notebooks/get_started.rst", "notebooks/steps.rst", "reference.rst"], "titles": ["Articles", "Changelog", "Code of conduct", "Community guidelines", "riskmapjnr
Python package", "Indices and tables", "License", "Get Started", "All steps", "Python API"], "terms": {"first": [1, 4, 6, 7, 8, 9], "releas": [1, 3, 4, 6], "packag": [1, 3, 6, 7, 8, 9], "In": [2, 4, 6, 8], "interest": [2, 3, 4, 6], "foster": 2, "an": [2, 4, 6, 8, 9], "open": [2, 3, 4], "welcom": [2, 6], "environ": [2, 4, 7, 8], "we": [2, 6, 7, 8, 9], "contributor": [2, 3, 4, 6], "maintain": [2, 6], "make": [2, 3, 6, 9], "particip": 2, "project": [2, 3, 4], "commun": [2, 4, 6], "harass": 2, "free": [2, 3, 6], "experi": 2, "everyon": [2, 6], "regardless": [2, 6], "ag": 2, "bodi": [2, 6], "size": [2, 4, 7, 8, 9], "disabl": 2, "ethnic": 2, "sex": 2, "characterist": 2, "gender": 2, "ident": [2, 7, 8], "express": [2, 6], "level": [2, 4, 8, 9], "educ": 2, "socio": 2, "econom": 2, "statu": [2, 6], "nation": [2, 4], "person": [2, 6], "appear": 2, "race": 2, "religion": 2, "sexual": 2, "orient": 2, "exampl": [2, 3, 6, 9], "behavior": 2, "contribut": 2, "creat": [2, 3, 4, 7, 8, 9], "posit": [2, 9], "includ": [2, 4, 6, 7, 8, 9], "us": [2, 7, 8, 9], "inclus": [2, 6], "languag": [2, 6], "Being": 2, "respect": [2, 6], "differ": [2, 4, 6, 8, 9], "viewpoint": 2, "gracefulli": 2, "accept": 2, "construct": 2, "critic": 2, "focus": [2, 8], "what": [2, 6], "best": [2, 4, 6, 8, 9], "show": [2, 6, 7, 8], "empathi": 2, "toward": 2, "other": [2, 4, 8, 9], "member": 2, "unaccept": [2, 6], "The": [2, 3, 4, 6, 7, 8, 9], "imageri": 2, "unwelcom": 2, "attent": 2, "advanc": 2, "troll": 2, "insult": 2, "derogatori": 2, "comment": 2, "polit": 2, "attack": 2, "public": [2, 4], "privat": [2, 6], "publish": [2, 6], "inform": [2, 4, 6], "physic": [2, 6], "electron": [2, 6], "address": [2, 6], "without": [2, 6], "explicit": 2, "permiss": 2, "which": [2, 3, 4, 6, 7, 8], "could": [2, 6], "reason": [2, 6], "consid": [2, 6, 7, 8, 9], "inappropri": 2, "profession": 2, "set": [2, 7, 8, 9], "ar": [2, 3, 4, 6, 7, 8, 9], "clarifi": 2, "expect": [2, 6], "take": [2, 6], "appropri": [2, 6], "fair": [2, 6], "correct": [2, 4, 6], "action": [2, 6], "ani": [2, 4, 6], "instanc": 2, "have": [2, 4, 7, 8, 9], "right": 2, "remov": [2, 4, 6], "edit": 2, "reject": 2, "commit": [2, 3, 6], "wiki": 2, "issu": 2, "align": 2, "thi": [2, 3, 4, 7, 8, 9], "ban": 2, "temporarili": 2, "perman": [2, 6], "thei": [2, 4, 6], "deem": [2, 6], "threaten": [2, 6], "offens": 2, "harm": 2, "appli": [2, 4], "within": [2, 4, 6, 7, 8], "all": [0, 2, 4, 6, 7, 9], "space": [2, 8], "also": [2, 4, 6, 7, 8, 9], "when": [2, 6, 8, 9], "individu": [2, 6], "repres": [2, 4, 6, 8, 9], "its": [2, 4, 6], "offici": [2, 6], "e": [2, 4, 6], "mail": [2, 6], "post": 2, "via": [2, 3], "social": 2, "media": 2, "account": [2, 4], "act": 2, "appoint": 2, "onlin": 2, "offlin": 2, "event": [2, 6], "represent": 2, "mai": [2, 6], "further": [2, 6], "defin": [2, 6, 9], "abus": [2, 6], "otherwis": [2, 6], "report": [2, 7, 8], "contact": [2, 6], "team": 2, "ghislain": [2, 7, 8], "dot": 2, "vieilled": [2, 8], "cirad": 2, "fr": [2, 4], "complaint": 2, "review": [2, 6], "investig": 2, "result": [2, 4, 6, 8], "necessari": [2, 6, 9], "circumst": [2, 6], "oblig": [2, 6], "confidenti": 2, "regard": [2, 6], "incid": 2, "detail": [2, 4, 6, 7], "specif": [2, 6, 8], "polici": 2, "separ": [2, 6], "who": [2, 3, 4, 6], "do": [2, 3, 6, 8], "follow": [2, 3, 4, 6, 7, 8, 9], "good": [2, 3], "faith": 2, "face": 2, "temporari": 2, "repercuss": 2, "determin": [2, 4, 6, 8], "s": [2, 3, 4, 6, 8, 9], "leadership": 2, "adapt": [2, 6], "from": [2, 3, 4, 7, 8, 9], "coven": [2, 6], "version": [2, 3, 4, 7, 8, 9], "1": [2, 4, 9], "4": [2, 9], "avail": [2, 6], "http": [2, 4, 6], "www": [2, 6], "org": [2, 6], "html": [2, 6], "For": [2, 4, 6, 8, 9], "answer": 2, "common": [2, 6], "question": 2, "about": [2, 6], "see": [2, 4, 6, 8, 9], "faq": 2, "riskmapjnr": [3, 7, 8, 9], "python": 3, "sourc": [3, 4, 9], "under": [3, 4, 6, 9], "gnu": [3, 4], "gpl": [3, 4, 6], "3": [3, 4, 9], "licens": [3, 4], "anybodi": [3, 4], "can": [3, 4, 6, 7, 8, 9], "develop": [3, 4, 6], "There": 3, "mani": 3, "wai": [3, 4, 6, 9], "write": [3, 6], "tutori": [3, 4, 8], "test": [3, 8], "improv": 3, "document": [3, 6], "submit": 3, "bug": 3, "featur": [3, 6], "request": 3, "provid": [3, 4, 6, 8, 9], "new": [3, 4, 9], "function": [3, 6, 7, 8], "incorpor": [3, 4, 6], "futur": [3, 6], "everi": [3, 4, 6], "must": [3, 4, 6, 8, 9], "agre": [3, 4, 6], "Of": [3, 6], "conduct": [3, 4], "If": [3, 6, 9], "you": [3, 4, 6], "want": [3, 6], "discuss": 3, "pleas": [3, 6], "github": [3, 4], "page": [3, 4, 5], "chang": [3, 4, 6, 9], "should": [3, 4, 6, 8], "made": [3, 6, 8], "pull": 3, "pr": 3, "learn": 3, "how": [3, 4, 7], "video": 3, "seri": 3, "aaron": 3, "meurer": 3, "git": 3, "workflow": 3, "guid": 3, "import": [3, 6, 9], "step": [0, 3, 4, 6, 7, 9], "start": [0, 3, 4, 6, 8], "fork": 3, "repositori": [3, 4], "branch": 3, "default": [3, 9], "master": [3, 4], "keep": [3, 6], "your": [3, 4], "up": [3, 7, 8], "date": [3, 6, 8, 9], "chri": 3, "beam": 3, "ha": [3, 4, 6, 7, 8, 9], "written": [3, 6], "messag": [3, 9], "push": 3, "obtain": [4, 7, 8, 9], "map": [4, 9], "spatial": [4, 7, 8, 9], "risk": [4, 6, 9], "deforest": [4, 9], "forest": [4, 9], "degrad": 4, "methodolog": [4, 7, 8, 9], "context": [4, 6], "jurisdict": [4, 8], "nest": 4, "redd": 4, "jnr": [4, 7, 8, 9], "vc": 4, "verifi": 4, "carbon": 4, "standard": [4, 6], "program": 4, "allow": [4, 6], "certifi": 4, "turn": 4, "greenhous": 4, "ga": 4, "ghg": 4, "emiss": 4, "reduct": 4, "tradabl": 4, "credit": 4, "sinc": 4, "launch": 4, "2006": 4, "grown": 4, "world": 4, "largest": 4, "voluntari": 4, "sector": 4, "mitig": 4, "across": [4, 6], "entir": [4, 6, 9], "subnat": 4, "call": [4, 6, 7, 9], "i": [4, 9], "aim": [4, 6], "reduc": 4, "scale": 4, "framework": 4, "integr": 4, "govern": [4, 6], "led": 4, "activ": [4, 6], "establish": 4, "clear": [4, 6], "pathwai": 4, "broader": 4, "ensur": [4, 6, 8], "given": [4, 6, 8, 9], "consist": [4, 6], "baselin": 4, "approach": 4, "leakag": 4, "displac": 4, "caus": [4, 6], "area": [4, 6, 7, 8, 9], "outsid": [4, 6], "boundari": 4, "monitor": 4, "tool": [4, 6], "benchmark": 4, "user": [4, 8], "alloc": 4, "requir": 4, "deriv": [4, 8], "base": [4, 6], "minim": 4, "past": [4, 8], "creation": 4, "categor": [4, 7, 8, 9], "static": 4, "whose": [4, 6], "categori": [4, 9], "valid": [4, 6, 9], "period": [4, 7, 8, 9], "refer": [4, 6], "frel": 4, "throughout": 4, "geograph": 4, "distribut": [4, 6], "lower": [4, 8, 9], "while": [4, 9], "assum": [6, 8, 9], "simplic": 4, "straightforward": 4, "sever": [4, 8, 9], "geoprocess": 4, "raster": [4, 7, 8, 9], "data": [4, 6, 9], "larg": 4, "cover": [4, 6, 9], "extent": [4, 6], "eg": 4, "high": [4, 8], "resolut": [4, 8, 9], "30": [4, 6, 7, 8, 9], "m": [4, 7, 8, 9], "modul": [4, 5], "uniqu": [], "collect": 6, "perform": [4, 6, 7], "depend": 4, "run": [4, 6, 7, 8, 9], "virtual": 4, "either": [4, 6, 9], "through": [4, 6], "miniconda3": [4, 7, 8], "here": [4, 8], "Then": 4, "command": [4, 6], "name": [4, 6, 9], "rmj": [4, 7, 8], "c": [4, 6], "forg": 4, "gdal": [4, 7, 8], "numpi": [4, 7, 8, 9], "matplotlib": [4, 8, 9], "panda": [4, 7, 8], "pip": 4, "scipi": [4, 9], "ye": 4, "pypi": 4, "com": 4, "ghislainv": 4, "archiv": 4, "zip": 4, "dev": 4, "jupyt": 4, "geopanda": 4, "descart": 4, "folium": 4, "option": [4, 6, 9], "addit": [4, 9], "To": [4, 6, 8], "deactiv": 4, "delet": [4, 9], "env": [4, 7, 8], "cd": 4, "mkdir": 4, "venv": 4, "directori": [4, 7, 8, 9], "usr": 4, "bin": [4, 8, 9], "python3": 4, "global": 4, "build_ext": 4, "config": 4, "rm": 4, "r": 4, "just": [4, 9], "been": [4, 6, 9], "correctli": [4, 9], "termin": [4, 9], "return": [4, 6, 8, 9], "short": [4, 6], "descript": [4, 9], "number": [4, 6, 7, 8, 9], "ecolog": 4, "x": [4, 7, 8, 9], "execut": [4, 6], "get": [0, 4, 6, 8], "todo": [], "our": [4, 6], "guidelin": 4, "code": [4, 7, 8], "home": [4, 7, 8], "introduct": [], "api": 4, "miscellan": 4, "indic": [6, 7, 8], "changelog": 4, "0": [4, 7, 8, 9], "gener": 4, "preambl": 4, "term": 4, "AND": 4, "condit": 4, "These": 4, "index": [4, 5], "search": [4, 5], "local": [4, 6, 9], "29": [6, 8], "june": 6, "2007": 6, "copyright": 6, "softwar": 6, "foundat": 6, "inc": 6, "fsf": 6, "permit": 6, "copyleft": 6, "kind": 6, "work": [6, 9], "most": [6, 8], "practic": 6, "design": 6, "awai": 6, "share": [6, 7, 8], "By": 6, "contrast": 6, "intend": 6, "guarante": 6, "sure": 6, "remain": [6, 7, 8, 9], "author": 6, "too": 6, "speak": 6, "price": 6, "charg": 6, "them": [6, 9], "wish": 6, "receiv": 6, "piec": 6, "know": 6, "thing": 6, "need": [6, 7, 8], "prevent": 6, "deni": 6, "ask": 6, "therefor": 6, "certain": 6, "respons": 6, "whether": [6, 9], "grati": 6, "fee": 6, "pass": 6, "same": [6, 8, 9], "And": 6, "so": [6, 8, 9], "two": [6, 8, 9], "assert": 6, "offer": 6, "give": 6, "clearli": 6, "explain": [6, 8], "both": [6, 8, 9], "sake": 6, "mark": 6, "problem": 6, "attribut": 6, "erron": 6, "previou": [6, 8], "some": [6, 8, 9], "devic": 6, "access": [6, 7], "instal": 6, "insid": [6, 8], "although": 6, "manufactur": 6, "fundament": 6, "incompat": 6, "systemat": 6, "pattern": 6, "occur": [6, 7, 8], "product": 6, "precis": [6, 8], "where": 6, "prohibit": 6, "those": 6, "aris": 6, "substanti": 6, "domain": 6, "stand": 6, "readi": 6, "extend": 6, "provis": 6, "final": 6, "constantli": 6, "state": 6, "restrict": 6, "purpos": 6, "comput": [4, 6, 7, 8, 9], "avoid": [6, 9], "special": 6, "danger": 6, "effect": 6, "proprietari": 6, "assur": 6, "cannot": 6, "render": 6, "modif": 6, "mean": [6, 7, 8, 9], "like": 6, "semiconductor": 6, "mask": 6, "each": [6, 8, 9], "license": 6, "organ": 6, "part": 6, "fashion": 6, "than": [6, 7, 8, 9], "exact": 6, "earlier": 6, "A": [6, 8, 9], "unmodifi": 6, "propag": 6, "anyth": 6, "would": 6, "directli": 6, "secondarili": 6, "liabl": 6, "infring": 6, "applic": 6, "except": [6, 9], "countri": [4, 6], "well": [6, 8, 9], "enabl": 6, "parti": 6, "mere": 6, "interact": 6, "network": 6, "transfer": 6, "interfac": 6, "displai": 6, "notic": 6, "conveni": 6, "promin": 6, "visibl": 6, "tell": 6, "view": 6, "present": [6, 8, 9], "list": [6, 9], "menu": 6, "item": 6, "meet": 6, "criterion": 6, "prefer": 6, "object": [6, 9], "recogn": 6, "case": [6, 7, 8], "specifi": 6, "particular": 6, "one": [6, 8, 9], "wide": 6, "among": 6, "system": 6, "librari": 6, "whole": 6, "normal": [6, 8, 9], "major": [6, 8], "compon": 6, "b": [6, 8], "serv": 6, "onli": [4, 6, 7, 8, 9], "implement": [6, 9], "essenti": 6, "kernel": 6, "window": [4, 6, 7, 8, 9], "oper": [4, 6], "compil": 6, "produc": [6, 8, 9], "correspond": [6, 8, 9], "script": 6, "control": 6, "howev": 6, "doe": [6, 9], "file": [4, 6, 7, 8, 9], "associ": [6, 9], "dynam": 6, "link": 6, "subprogram": 6, "intim": 6, "flow": 6, "between": [6, 7, 8, 9], "regener": 6, "grant": 6, "irrevoc": 6, "met": 6, "explicitli": 6, "affirm": 6, "unlimit": 6, "output": [6, 9], "content": 6, "constitut": 6, "acknowledg": 6, "equival": 6, "long": 6, "forc": 6, "sole": 6, "exclus": 6, "facil": 6, "compli": 6, "materi": 6, "thu": [6, 8], "behalf": 6, "direct": 6, "relationship": [6, 7, 8, 9], "below": [6, 8, 9], "sublicens": 6, "unnecessari": 6, "shall": 6, "technolog": 6, "measur": 6, "fulfil": 6, "articl": [4, 6], "wipo": 6, "treati": 6, "adopt": 6, "20": [6, 7, 8], "decemb": 6, "1996": 6, "similar": 6, "waiv": 6, "power": 6, "forbid": 6, "exercis": 6, "intent": 6, "enforc": 6, "against": 6, "third": [6, 8], "medium": 6, "conspicu": 6, "intact": 6, "ad": 6, "accord": 6, "absenc": 6, "along": 6, "support": 6, "carri": 6, "relev": 6, "anyon": 6, "come": 6, "possess": 6, "invalid": 6, "d": [6, 8], "independ": [6, 8], "natur": [6, 8, 9], "extens": 6, "combin": 6, "larger": 6, "volum": 6, "storag": 6, "aggreg": 6, "beyond": [4, 6, 7, 9], "machin": 6, "readabl": 6, "embodi": 6, "accompani": 6, "fix": 6, "durabl": 6, "customarili": 6, "interchang": 6, "least": [6, 8], "three": [6, 8, 9], "year": [6, 9], "spare": 6, "custom": 6, "model": [6, 9], "more": [6, 7, 8], "cost": 6, "server": 6, "altern": 6, "occasion": 6, "noncommerci": 6, "subsect": 6, "6b": 6, "place": 6, "next": 6, "sai": 6, "find": 6, "host": 6, "satisfi": 6, "peer": 6, "transmiss": 6, "being": [6, 7, 8], "6d": 6, "portion": 6, "exclud": [6, 9], "consum": 6, "tangibl": 6, "properti": 6, "famili": 6, "household": 6, "sold": 6, "dwell": 6, "doubt": 6, "resolv": 6, "favor": [4, 6], "coverag": 6, "typic": [6, 9], "class": [6, 7, 8, 9], "actual": 6, "commerci": 6, "industri": 6, "unless": 6, "signific": 6, "mode": [6, 9], "method": [6, 7, 8, 9], "procedur": [6, 8], "kei": 6, "suffic": 6, "continu": [6, 8], "interf": 6, "becaus": [6, 8], "transact": 6, "perpetu": 6, "character": 6, "But": 6, "neither": 6, "nor": 6, "retain": 6, "abil": 6, "rom": 6, "servic": 6, "updat": 6, "itself": 6, "advers": 6, "affect": 6, "violat": 6, "rule": 6, "protocol": 6, "format": 6, "publicli": 6, "password": 6, "unpack": 6, "read": 6, "supplement": 6, "treat": 6, "though": 6, "were": 6, "own": 6, "notwithstand": 6, "add": [6, 9], "holder": 6, "preserv": 6, "contain": [6, 8], "misrepresent": 6, "origin": 6, "licensor": 6, "declin": 6, "trademark": 6, "trade": 6, "f": [6, 7, 8], "indemnif": 6, "contractu": 6, "assumpt": 6, "impos": [6, 8], "relicens": 6, "surviv": 6, "statement": 6, "abov": 6, "expressli": 6, "attempt": 6, "void": 6, "paragraph": 6, "ceas": 6, "reinstat": 6, "provision": 6, "until": 6, "fail": 6, "notifi": 6, "prior": 6, "60": [6, 7, 8, 9], "dai": 6, "after": [6, 8], "cessat": 6, "moreov": 6, "time": [6, 8, 9], "cure": 6, "receipt": 6, "qualifi": 6, "order": 6, "ancillari": 6, "consequ": [6, 8], "likewis": 6, "noth": 6, "subject": 6, "complianc": 6, "entiti": 6, "asset": 6, "subdivid": 6, "merg": 6, "whatev": 6, "predecessor": 6, "had": 6, "plu": [6, 9], "effort": 6, "royalti": 6, "initi": 6, "litig": 6, "cross": 6, "claim": 6, "counterclaim": 6, "lawsuit": 6, "alleg": 6, "sell": 6, "sale": 6, "alreadi": [6, 9], "acquir": 6, "hereaft": 6, "manner": 6, "worldwid": 6, "agreement": 6, "denomin": 6, "sue": 6, "knowingli": 6, "reli": 6, "readili": 6, "arrang": 6, "depriv": 6, "yourself": 6, "benefit": 6, "knowledg": 6, "identifi": [6, 7, 8, 9], "believ": 6, "pursuant": 6, "connect": 6, "singl": 6, "procur": 6, "convey": 6, "discriminatori": 6, "scope": 6, "busi": 6, "payment": 6, "primarili": 6, "enter": 6, "wa": 6, "28": [6, 8, 9], "march": 6, "constru": 6, "impli": [6, 8], "defens": 6, "court": 6, "contradict": 6, "excus": 6, "simultan": 6, "pertin": 6, "whom": 6, "refrain": 6, "concern": 6, "Such": [4, 6], "spirit": 6, "distinguish": 6, "later": 6, "choos": 6, "ever": 6, "proxi": 6, "decid": 6, "THERE": 6, "IS": 6, "NO": 6, "FOR": 6, "THE": 6, "TO": 6, "BY": 6, "IN": 6, "OR": 6, "AS": 6, "OF": 6, "BUT": 6, "NOT": 6, "merchant": 6, "fit": 6, "qualiti": 6, "WITH": 6, "prove": 6, "defect": 6, "repair": 6, "WILL": 6, "BE": 6, "damag": 6, "incident": 6, "consequenti": 6, "out": 6, "inabl": 6, "loss": 6, "BEING": 6, "inaccur": 6, "sustain": 6, "failur": 6, "even": 6, "IF": 6, "SUCH": 6, "advis": 6, "possibl": 6, "close": [6, 8], "approxim": [6, 8, 9], "absolut": 6, "waiver": 6, "civil": 6, "end": [6, 9], "greatest": 6, "achiev": 6, "redistribut": 6, "attach": 6, "It": [6, 9], "safest": 6, "line": [6, 7, 8, 9], "pointer": 6, "full": 6, "found": 6, "brief": 6, "idea": 6, "hope": 6, "paper": 6, "type": [6, 8, 9], "w": 6, "hypothet": 6, "cours": 6, "might": 6, "gui": 6, "box": 6, "employ": 6, "programm": 6, "school": 6, "sign": 6, "subroutin": 6, "lesser": 6, "instead": 6, "philosophi": 6, "why": 6, "lgpl": 6, "analysi": [7, 8, 9], "os": [7, 8], "np": [7, 8, 9], "pyplot": 8, "plt": 8, "pd": [7, 8], "hold": 9, "ouput": [], "make_dir": [7, 8, 9], "increas": [7, 8, 9], "cach": [7, 8], "speed": [7, 8], "gdal_cachemax": [7, 8], "1024": [7, 8], "input_fil": [], "dist_fil": [8, 9], "tab_fil": [], "fig_fil": [], "figsiz": [7, 8, 9], "6": [7, 9], "8": [7, 9], "dpi": [7, 8, 9], "100": [7, 8, 9], "arrai": 9, "90": [7, 8, 9], "120": [7, 8, 9], "150": [7, 8, 9], "180": [7, 8, 9], "210": [7, 8, 9], "240": [7, 8, 9], "270": [7, 8, 9], "300": [7, 8, 9], "330": 9, "360": 9, "390": 9, "420": 9, "450": 9, "480": 9, "510": 9, "540": 9, "570": 9, "600": 9, "630": 9, "660": 9, "690": 9, "720": 9, "750": 9, "780": [8, 9], "810": 9, "840": 9, "870": 9, "900": 9, "930": 9, "960": 9, "990": 9, "1020": 9, "1050": 9, "blk_row": [7, 8, 9], "128": [7, 8, 9], "percentag": [7, 8, 9], "total": [8, 9], "distanc": [4, 9], "edg": [4, 9], "tabl": [7, 8, 9], "cumul": [7, 8, 9], "threshold": [7, 8, 9], "99": [7, 8, 9], "landscap": [8, 9], "plot": [4, 7, 8], "unit": 9, "input": [4, 8, 9], "paramet": 9, "123": 9, "2": [4, 9], "second": [7, 8, 9], "No": 9, "valu": [7, 8, 9], "zero": 9, "path": [7, 8, 9], "csv": [8, 9], "variabl": [7, 8, 9], "npix": 9, "pixel": [7, 9], "cum": 9, "sum": 9, "perc": 9, "figur": [7, 8, 9], "imag": 9, "dimension": 9, "monoton": 9, "arang": [7, 8, 9], "1080": [7, 8, 9], "row": 9, "block": [4, 9], "break": [8, 9], "lage": 9, "memori": [4, 9], "dictionari": 9, "With": [8, 9], "tot_def": 9, "dist_thresh": [7, 8, 9], "dist_valu": [], "shortest": [], "georeferenc": 4, "coordin": [], "none": 9, "uint32": [], "4294967295": [], "nodata": [7, 8, 9], "output_fil": [7, 8, 9], "win_siz": [7, 8, 9], "time_interv": [7, 8, 9], "rate": [4, 9], "move": [4, 7, 8, 9], "focal": 9, "uniform_filt": 9, "over": 9, "generic_filt": 9, "40": [7, 8, 9], "slower": 9, "stride": 9, "cell": [7, 8, 9], "exist": 9, "constant": 9, "cval": 9, "odd": 9, "equal": [7, 8, 9], "interv": [7, 8, 9], "observ": [7, 8, 9], "greater": [8, 9], "rang": [8, 9], "10000": [8, 9], "uint16": [8, 9], "65535": 9, "defor_cat_zero": [], "tif": [7, 8, 9], "verbos": [7, 8, 9], "true": [7, 8, 9], "10001": [8, 9], "integ": [8, 9], "ten": [8, 9], "thousand": [8, 9], "current": 9, "assign": [8, 9], "logic": 9, "print": [7, 8, 9], "fcc_file": [7, 8, 9], "defor_cat_fil": [], "per": 9, "histor": [8, 9], "estim": [4, 8, 9], "nbin": [], "previous": [8, 9], "surfac": 9, "predomin": 9, "small": 9, "befor": [8, 9], "slice": [4, 7, 8, 9], "algorithm": [4, 7, 8, 9], "byte": 9, "255": 9, "defrate_per_cat_fil": [], "csize": [7, 8, 9], "validation_data": [], "pred_ob": [8, 9], "png": [7, 8, 9], "predict": [7, 8, 9], "grid": [7, 8, 9], "maximum": 9, "10km": 9, "compar": [8, 9], "vs": 9, "weight": [7, 8, 9], "root": [7, 8, 9], "squar": [7, 8, 9], "error": [7, 8, 9], "wrmse": [7, 8, 9], "hectar": 9, "10": [7, 8, 9], "km": [7, 8, 9], "9": [8, 9], "ncell": 9, "begin": [8, 9], "csize_km": 9, "kilomet": 9, "invers": 9, "logit": 9, "differenci": 9, "neg": 9, "overflow": 9, "exp": 9, "param": 9, "silent": 9, "complet": 9, "regular": 9, "rais": 9, "parent": 9, "newdir": 9, "entri": 9, "point": 9, "check": 9, "pkg_resourc": [7, 8], "tabul": [7, 8], "proj_lib": [7, 8], "pyenv": [7, 8], "latest": [7, 8], "conda": [7, 8], "proj": [7, 8], "guadeloup": [7, 8], "archipelago": [7, 8], "studi": [7, 8], "recent": [7, 8], "fcc123_glp": [7, 8], "2000": [7, 8, 9], "2010": [7, 8, 9], "2020": [7, 8, 9], "resource_filenam": [7, 8], "becom": 8, "neglig": [4, 7, 8], "inde": 8, "known": [4, 8], "tropic": 8, "decreas": 8, "rapidli": 8, "et": 8, "al": 8, "2013": 8, "grinand": 8, "2021": 8, "dez\u00e9cach": 8, "2017": 8, "suggest": 8, "leq": 8, "locat": [7, 8], "gt": 8, "As": 8, "ofil": [7, 8], "plot_dist": [], "dist_edge_threshold": [4, 8, 9], "dist_edg": [8, 9], "tab_dist": 8, "npixel": [7, 8], "25325": [], "2279": [], "25": 8, "85": [], "2263": [], "3134": [], "282": 8, "06": [], "2561": [], "31": [7, 8], "95": 8, "7732": [], "869": [], "78": [], "21": 8, "2639": [], "52": [], "98": [7, 8], "6976": [], "235": [], "15": [7, 8], "2660": [], "67": [], "4885": [], "91": [], "19": 8, "2668": [], "86": [], "7947": [], "7": [], "2671": [], "56": [], "8957": [], "35": [], "2672": [], "9462": [], "5": [7, 9], "45": [], "2673": [], "36": 7, "963": [], "18": 8, "54": 8, "9697": [], "72": [], "9764": [], "local_defor_r": [4, 8, 9], "set_defor_cat_zero": [4, 8, 9], "defrate_per_cat": [4, 8, 9], "defor_cat": [4, 8, 9], "750m": [], "environment": [7, 8], "calibr": [7, 8, 9], "dist_edge_thr": 8, "dictionnari": 8, "theta": 8, "yr": 8, "formula": 8, "alpha_2": 8, "alpha_1": 8, "tau": 8, "alpha": 8, "t_1": 8, "t_2": 8, "describ": 8, "save": [7, 8], "disk": 8, "convert": 8, "suffici": 8, "th": [], "ws": [], "ldefrate_w": 9, "ldefrate_ws31": [], "fourth": 8, "frequenc": 8, "belong": [7, 8], "divid": 4, "region": 9, "statist": [], "50": 8, "55": [], "65": [], "70": [], "75": [], "80": [], "cat": 8, "nfor": 8, "ndefor": 8, "39841": [], "00200617": [], "13367": [], "0214846": [], "13238": [], "46": 7, "0342101": [], "13348": [], "05265": [], "13290": [], "105": [], "0762562": [], "13309": [], "107158": [], "13328": [], "168": [], "119136": [], "13175": [], "184": [], "1312": [], "13435": [], "232": [], "159864": [], "13272": [], "268": [], "184534": [], "11": [8, 9], "13336": [], "348": [], "232344": [], "12": 8, "13291": [], "386": [], "255262": [], "13": [7, 8], "13308": [], "410": [], "2687": [], "14": 8, "13296": [], "491": [], "313587": [], "13304": [], "628": [], "383405": [], "16": [7, 8], "13315": [], "649": [], "393287": [], "17": 8, "13285": [], "611": [], "375516": [], "13333": [], "763": [], "44528": [], "955": [], "525106": [], "13301": [], "1041": [], "557349": [], "1270": [], "633328": [], "22": [7, 8], "13288": [], "1509": [], "700437": [], "23": 8, "13321": [], "1623": [], "727261": [], "24": 8, "13300": [], "1790": [], "764367": [], "13302": [], "2280": [], "847442": [], "26": [8, 9], "13314": [], "2751": [], "901193": [], "27": [8, 9], "13295": [], "3834": [], "966697": [], "6932": [], "99936": [], "note": 8, "slightli": [], "inferior": [], "spread": 8, "veri": 8, "low": 8, "vari": 4, "transform": 4, "select": [4, 9], "higher": 4, "accuraci": 4, "scientif": 4, "fast": 4, "matrix": 4, "vector": [4, 9], "process": 4, "g": 4, "fifth": 8, "1000": [8, 9], "fall": 8, "don": 8, "t": 8, "w_j": 8, "j": 8, "beta_j": 8, "calcul": 8, "red": [7, 8], "n": [7, 8], "graph": [7, 8], "repeat": 8, "variou": 8, "togeth": 8, "lead": 8, "minimum": 8, "smallest": 8, "onc": 8, "dist_bin": [7, 8, 9], "tab_file_dist": [8, 9], "perc_dist": [7, 8, 9], "fig_file_dist": [8, 9], "ldefrate_fil": [8, 9], "ldefrate_with_zero_fil": [8, 9], "ldefrate_with_zero": [8, 9], "tab_file_defr": [8, 9], "ncat": [7, 8, 9], "tab_file_pr": [8, 9], "fig_file_pr": [8, 9], "defor_valu": [8, 9], "scalar": 9, "makemap": [7, 9], "output_dir": [7, 9], "clean": [7, 9], "fals": [7, 8, 9], "peform": 9, "tab_file_map_comp": [], "fig_file_map_comp": [], "calval_dir": 9, "dure": 9, "dist_edge_c": 9, "_with_zero": 9, "defor_cat_w": [], "_": 9, "defrate_per_cat_w": 9, "pred_obs_w": 9, "abbrevi": 9, "ei": [7, 9], "ea": 9, "nb": 9, "ws_hat": [7, 9], "m_hat": [7, 9], "wrmse_hat": 9, "invlogit": 9, "make_squar": [], "rasterfil": [], "square_s": [], "33": 8, "caracterist": [], "side": [], "tupl": [], "length": 9, "axi": [], "y": [], "offset": [], "makeblock": [], "256": [], "progress_bar": [], "niter": [], "draw": [], "iter": [], "tree": 9, "dir_path": 9, "int": 9, "limit_to_directori": 9, "bool": 9, "length_limit": 9, "visual": 9, "structur": 9, "limit": 9, "recurs": 9, "stuctur": 9, "results_makemap": 7, "outputs_makemap": 7, "48": 7, "theshold": 7, "53389": [], "4805": [], "01": [7, 8], "253": [], "10235": [], "921": [], "5726": [], "89": [], "6795": [], "3848": [], "346": [], "32": [], "6072": [], "1033": [], "1474": [], "132": [], "66": [], "6205": [], "97": [7, 8], "181": [], "914": [], "82": [], "6287": [], "4693": 7, "428": [], "38": 8, "6325": [], "92": 8, "0725": [], "230": 8, "6346": [], "62": [], "3967": [], "178": [], "02": [], "6362": [], "64": 7, "6476": [], "6370": [], "74": [], "7745": [], "39": 8, "51": [], "6374": [], "8294": [], "pred_obs_ws5_ei": 7, "done": [], "riskmap_fil": [8, 9], "riskmap": [7, 8, 9], "map_comp": 9, "riskmap_w": 9, "calval": 9, "perc_dist_c": 9, "input_risk_map": [7, 8, 9], "prob": 9, "maxpixel": [7, 8, 9], "500000": 9, "border": [7, 8, 9], "legend": [7, 8, 9], "69": 9, "kwarg": 9, "probabl": 9, "colorbar": 9, "inch": 9, "keyword": 9, "argument": 9, "border_fil": [7, 8], "ctry_border_glp": [7, 8], "gpkg": [7, 8], "sequenc": 7, "52150": 7, "73": 7, "6676": 7, "10755": 7, "967": 7, "911": 7, "5661": 7, "88": 7, "8602": 7, "4192": 7, "377": 7, "265": 7, "6038": 7, "49": 7, "94": 7, "7818": 7, "1654": 7, "148": 7, "854": 7, "6187": 7, "34": [7, 9], "1183": 7, "968": 7, "87": 7, "1165": 7, "6274": 7, "4857": 7, "402": 7, "1785": 7, "6310": 7, "0536": 7, "233": 7, "9692": 7, "6331": 7, "3827": 7, "149": 7, "4095": 7, "6345": 7, "5932": 7, "99964": 7, "6354": 7, "7344": 7, "13983": 7, "6358": 7, "7994": 7, "easi": [], "manipul": [], "leaflet": [], "join": [7, 8], "riskmap_ws5_ei": 7, "riskmap_fig": [7, 8], "1e8": [7, 8], "800": [7, 8], "linewidth": [7, 8], "fcc123": [7, 8, 9], "input_fcc_rast": [7, 8, 9], "zoom": 9, "col": 9, "165": 9, "227": 9, "139": 9, "xmin": 9, "xmax": 9, "ymin": 9, "ymax": 9, "rgba": 9, "color": 9, "out_dir": [7, 8], "orang": [7, 8], "green": [7, 8], "fig_fcc123": [7, 8], "farther": [7, 8], "outputs_step": 8, "24937": 8, "2244": 8, "83": 8, "583": 8, "3451": 8, "310": 8, "59": 8, "2554": 8, "1001": 8, "09": 8, "2645": 8, "5051": 8, "2670": 8, "4503": 8, "102": 8, "2679": 8, "57": 8, "7922": 8, "61": 8, "2682": 8, "8894": 8, "2683": 8, "44": 8, "9363": 8, "9564": 8, "2684": 8, "9631": 8, "43": 8, "9732": 8, "53": [], "63": [], "76": [], "93": [], "96": [], "47": [], "286897": 8, "6948": 8, "13115645793568742": 8, "4555": 8, "16797929162030611": 8, "4428": 8, "207883556342903": 8, "4079": 8, "158": 8, "32635456697582377": 8, "3771": 8, "161": 8, "35359204117624776": 8, "1733": 8, "4548023398767944": 8, "2940": 8, "157": 8, "4223580050270457": 8, "4178": 8, "432341580700236": 8, "4028": 8, "262": 8, "48960250057719656": 8, "2401": 8, "182": 8, "5453769808930122": 8, "3654": 8, "317": 8, "596469248332768": 8, "1896": 8, "129": 8, "5057096122044651": 8, "4637": 8, "530": 8, "7029181842913952": 8, "3192": 8, "398": 8, "7359809944026328": 8, "2775": 8, "349": 8, "7392177123700654": 8, "5257": 8, "910": 8, "8505428722687592": 8, "3933": 8, "8903521189382809": 8, "4174": 8, "949": 8, "9241819269543683": 8, "6428": 8, "1870": 8, "9678645395136823": 8, "31671": 8, "21848": 8, "9999917619641472": 8, "ldefrat": 8, "13768": [], "153165": [], "13355": [], "603": [], "369995": [], "13261": [], "791": [], "459368": [], "13812": [], "1518": [], "687848": [], "13050": [], "2434": [], "873088": [], "13141": [], "4261": [], "980146": [], "11993": [], "6751": [], "999745": [], "14298": [], "13029": []}, "objects": {"": [[9, 0, 0, "-", "riskmapjnr"]], "riskmapjnr": [[9, 1, 1, "", "defor_cat"], [9, 1, 1, "", "defrate_per_cat"], [9, 1, 1, "", "dist_edge_threshold"], [9, 1, 1, "", "local_defor_rate"], [9, 1, 1, "", "makemap"], [9, 0, 0, "-", "plot"], [9, 0, 0, "-", "riskmapjnr"], [9, 1, 1, "", "set_defor_cat_zero"], [9, 1, 1, "", "validation"]], "riskmapjnr.misc": [[9, 0, 0, "-", "miscellaneous"]], "riskmapjnr.misc.miscellaneous": [[9, 1, 1, "", "invlogit"], [9, 1, 1, "", "make_dir"], [9, 1, 1, "", "tree"]], "riskmapjnr.plot": [[9, 1, 1, "", "fcc123"], [9, 1, 1, "", "riskmap"]], "riskmapjnr.riskmapjnr": [[9, 1, 1, "", "main"]]}, "objtypes": {"0": "py:module", "1": "py:function"}, "objnames": {"0": ["py", "module", "Python module"], "1": ["py", "function", "Python function"]}, "titleterms": {"changelog": 1, "riskmapjnr": [1, 4], "0": [1, 6], "1": [1, 6, 7, 8], "code": [2, 3, 6], "conduct": 2, "our": 2, "pledg": 2, "standard": 2, "respons": 2, "scope": 2, "enforc": 2, "attribut": 2, "commun": 3, "guidelin": 3, "report": 3, "an": 3, "issu": 3, "contribut": [3, 4], "python": [4, 7, 8, 9], "packag": 4, "overview": 4, "statement": 4, "need": 4, "instal": 4, "us": [4, 6], "conda": 4, "recommend": 4, "virtualenv": 4, "test": 4, "main": [4, 9], "function": [4, 9], "tabl": [4, 5], "content": 4, "indic": [4, 5], "licens": 6, "gnu": 6, "gener": 6, "public": 6, "preambl": [6, 7], "term": 6, "AND": 6, "condit": 6, "definit": 6, "sourc": 6, "2": [6, 7, 8], "basic": 6, "permiss": 6, "3": [6, 7, 8], "protect": 6, "user": 6, "legal": 6, "right": 6, "from": 6, "anti": 6, "circumvent": 6, "law": 6, "4": [6, 7, 8], "convei": 6, "verbatim": 6, "copi": 6, "5": [6, 8], "modifi": 6, "version": 6, "6": [6, 8], "non": 6, "form": 6, "7": [6, 8], "addit": 6, "8": [6, 8], "termin": 6, "9": 6, "accept": 6, "Not": 6, "requir": 6, "have": 6, "10": 6, "automat": 6, "downstream": 6, "recipi": 6, "11": 6, "patent": 6, "12": 6, "No": 6, "surrend": 6, "other": 6, "freedom": 6, "13": 6, "affero": 6, "14": 6, "revis": 6, "thi": 6, "15": 6, "disclaim": 6, "warranti": 6, "16": 6, "limit": 6, "liabil": 6, "17": 6, "interpret": 6, "section": 6, "how": 6, "appli": 6, "These": 6, "your": 6, "new": 6, "program": 6, "get": 7, "start": 7, "introduct": 8, "import": [7, 8], "modul": [7, 8], "api": 9, "dist_edge_threshold": [], "local_defor_r": [], "set_defor_cat_zero": [], "defrate_per_cat": [], "defor_cat": [], "valid": [7, 8], "miscellan": 9, "invlogit": [], "make_dir": [], "forest": [7, 8], "cover": [7, 8], "chang": [7, 8], "data": [7, 8], "deforest": [7, 8], "risk": [7, 8], "distanc": [7, 8], "edg": [7, 8], "local": 8, "rate": 8, "categori": 8, "zero": 8, "per": 8, "pixel": 8, "final": 8, "map": [7, 8], "deriv": 7, "result": 7, "riskmap": [], "plot": 9, "best": 7, "model": 7, "matplotlib": [], "articl": 0, "step": 8, "all": 8, "object": 8}, "envversion": {"sphinx.domains.c": 2, "sphinx.domains.changeset": 1, "sphinx.domains.citation": 1, "sphinx.domains.cpp": 6, "sphinx.domains.index": 1, "sphinx.domains.javascript": 2, "sphinx.domains.math": 2, "sphinx.domains.python": 3, "sphinx.domains.rst": 2, "sphinx.domains.std": 2, "sphinx.ext.viewcode": 1, "nbsphinx": 4, "sphinx": 56}})
\ No newline at end of file
diff --git a/docsrc/articles.rst b/docsrc/articles.rst
new file mode 100644
index 0000000..7856bcb
--- /dev/null
+++ b/docsrc/articles.rst
@@ -0,0 +1,10 @@
+Articles
+========
+
+.. toctree::
+ :maxdepth: 1
+
+ notebooks/get_started
+ notebooks/steps
+
+
diff --git a/docsrc/index.rst b/docsrc/index.rst
index 2286bca..91e023d 100644
--- a/docsrc/index.rst
+++ b/docsrc/index.rst
@@ -8,6 +8,7 @@ Table of contents
Home
notebooks/get_started
+ articles
reference
indices
changelog
diff --git a/docsrc/notebooks/get_started.org b/docsrc/notebooks/get_started.org
index f36d208..11316fb 100644
--- a/docsrc/notebooks/get_started.org
+++ b/docsrc/notebooks/get_started.org
@@ -134,7 +134,7 @@ We derive the deforestation risk map using the =makemap()= function. This functi
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),
@@ -166,7 +166,7 @@ print(f"The distance theshold is {dist_thresh} m.")
We have access to a table indicating the cumulative percentage of deforestation as a function of the distance to forest edge.
#+begin_src python :results value raw :session :exports results
-perc_df = pd.read_csv("outputs_makemap/perc_dist.csv", na_filter=False)
+perc_df = pd.read_csv(os.path.join(out_dir, "perc_dist.csv"), na_filter=False)
col_names = ["Distance", "Npixels", "Area", "Cumulation", "Percentage"]
tabulate(perc_df.head(10), headers=col_names, tablefmt="orgtbl", showindex=False)
#+end_src
@@ -188,7 +188,7 @@ tabulate(perc_df.head(10), headers=col_names, tablefmt="orgtbl", showindex=False
We also have access to a plot showing how the cumulative percentage of deforestation increases with the distance to forest edge.
#+begin_src python :results file :session :exports both
-ofile = "outputs_makemap/perc_dist.png"
+ofile = os.path.join(out_dir, "perc_dist.png")
ofile
#+end_src
@@ -216,7 +216,7 @@ print(f"The best slicing algorithm is '{m_hat}'.")
** Validation
#+begin_src python :results file :session :exports both
-ofile = "outputs_makemap/pred_obs_ws5_ei.png"
+ofile = os.path.join(out_dir, "pred_obs_ws5_ei.png")
ofile
#+end_src
@@ -231,7 +231,7 @@ ofile
We plot the risk map using the =plot.riskmap()= function.
#+begin_src python :results file :session :exports both
-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,
diff --git a/docsrc/notebooks/get_started.rst b/docsrc/notebooks/get_started.rst
index 5b6fb01..61080ac 100644
--- a/docsrc/notebooks/get_started.rst
+++ b/docsrc/notebooks/get_started.rst
@@ -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),
@@ -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:
@@ -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:
@@ -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,
diff --git a/docsrc/notebooks/steps.org b/docsrc/notebooks/steps.org
index a06aec7..ca60055 100644
--- a/docsrc/notebooks/steps.org
+++ b/docsrc/notebooks/steps.org
@@ -8,7 +8,7 @@
# license :GPLv3
# ==============================================================================
-#+title: Steps
+#+title: All steps
#+author:
# #+author: Ghislain Vieilledent
# #+email: ghislain.vieilledent@cirad.fr
@@ -47,6 +47,10 @@
* Introduction
+** Objective
+
+We present here all the steps of the JNR methodology that need to be followed to derive a map of the deforestation risk in a given jurisdiction.
+
** Importing Python modules
We import the Python modules needed for running the analysis.
@@ -66,32 +70,33 @@ import riskmapjnr as rmj
#+RESULTS:
-We create some directories to hold the data and the ouputs with the
-function =rmj.make_dir()=.
+Increase the cache for GDAL to increase computational speed.
#+begin_src python :results output :session :exports both
-rmj.make_dir("outputs")
+# GDAL
+os.environ["GDAL_CACHEMAX"] = "1024"
#+end_src
#+RESULTS:
-We increase the cache for GDAL to increase computational speed.
+Set the =PROJ_LIB= environmental variable.
#+begin_src python :results output :session :exports both
-# GDAL
-os.environ["GDAL_CACHEMAX"] = "1024"
+os.environ["PROJ_LIB"] = "/home/ghislain/.pyenv/versions/miniconda3-latest/envs/conda-rmj/share/proj"
#+end_src
#+RESULTS:
-Set =PROJ_LIB= environmental variable.
+Create a directory to save results.
#+begin_src python :results output :session :exports both
-os.environ["PROJ_LIB"] = "/home/ghislain/.pyenv/versions/miniconda3-latest/envs/conda-rmj/share/proj"
+out_dir = "outputs_steps"
+rmj.make_dir(out_dir)
#+end_src
#+RESULTS:
+
** Forest cover change data
We use the Guadeloupe archipelago as a case study. Recent forest cover change data for Guadeloupe is included in the =riskmapjnr= package. The raster file (=fcc123_GLP.tif=) includes the following values: *1* for deforestation on the period 2000--2010, *2* for deforestation on the period 2010--2020, and *3* for the remaining forest in 2020. NoData value is set to *0*. The first period (2000--2010) will be used for calibration and the second period (2010--2020) will be used for validation. This is the only data we need to derive a map of deforestation risk following the JNR methodology.
@@ -99,32 +104,56 @@ We use the Guadeloupe archipelago as a case study. Recent forest cover change da
#+begin_src python :results output :session :exports both
fcc_file = pkg_resources.resource_filename("riskmapjnr", "data/fcc123_GLP.tif")
print(fcc_file)
+border_file = pkg_resources.resource_filename("riskmapjnr", "data/ctry_border_GLP.gpkg")
+print(border_file)
#+end_src
#+RESULTS:
: /home/ghislain/Code/riskmapjnr/riskmapjnr/data/fcc123_GLP.tif
+: /home/ghislain/Code/riskmapjnr/riskmapjnr/data/ctry_border_GLP.gpkg
+
+We plot the forest cover change map with the =plot.fcc123()= function.
+
+#+begin_src python :results file :session :exports both
+ofile = os.path.join(out_dir, "fcc123.png")
+fig_fcc123 = rmj.plot.fcc123(
+ input_fcc_raster=fcc_file,
+ maxpixels=1e8,
+ output_file=ofile,
+ borders=border_file,
+ linewidth=0.2,
+ figsize=(5, 4), dpi=800)
+ofile
+#+end_src
+
+#+NAME: fig:steps-fccmap
+#+ATTR_RST: :width 600
+#+CAPTION: *Forest cover change map.* Deforestation on the first period (2000--2010) is in orange, deforestation on the second period (2000--2020) is in red and remaining forest (in 2020) is in green.
+#+RESULTS:
+[[file:outputs_steps/fcc123.png]]
* Deforestation risk and distance to forest edge
The first step is to compute the distance to the forest edge after which the risk of deforestation becomes negligible. Indeed, it is known from previous studies on tropical deforestation that the deforestation risk decreases rapidly with the distance to the forest edge and that most of the deforestation occurs close to the forest edge (Vieilledent et al., 2013, Grinand et al., 2020, Vieilledent, 2021, Dezécache et al., 2017). The JNR methodology suggests identifying the distance to the forest edge $d$, so that at least 99% of the deforestation occurs within a distance $\leq d$. Forest areas located at a distance from the forest edge $\gt d$ can be considered as having no risk of being deforested. As a consequence, forest pixels with a distance from the forest edge $\gt d$ are assigned category 0 (zero) for the deforestation risk.
#+begin_src python :results file :session :exports both
-ofile = "outputs/plot_dist.png"
+ofile = os.path.join(out_dir, "perc_dist.png")
dist_edge_thres = rmj.dist_edge_threshold(
- input_file=fcc_file,
- dist_file="outputs/dist_edge.tif",
- tab_file="outputs/tab_dist.csv",
- fig_file=ofile,
- bins=np.arange(0, 1080, step=30),
- blk_rows=128, verbose=True)
+ fcc_file=fcc_file,
+ defor_values=1,
+ dist_file=os.path.join(out_dir, "dist_edge.tif"),
+ dist_bins=np.arange(0, 1080, step=30),
+ tab_file_dist=os.path.join(out_dir, "tab_dist.csv"),
+ fig_file_dist=ofile,
+ blk_rows=128, verbose=False)
ofile
#+end_src
-#+NAME: fig:dist_edge
+#+NAME: fig:steps-dist_edge
#+ATTR_RST: :width 600
#+CAPTION: *Identifying areas for which the risk of deforestation is negligible.* Figure shows that more than 99% of the deforestation occurs within a distance from the forest edge ≤ 120 m. Forest areas located at a distance > 120 m from the forest edge can be considered as having no risk of being deforested.
#+RESULTS:
-[[file:outputs/plot_dist.png]]
+[[file:outputs_steps/perc_dist.png]]
The function returns a dictionnary including the distance threshold.
@@ -139,7 +168,7 @@ print(f"The distance threshold is {dist_thresh} m")
A table indicating the cumulative percentage of deforestation as a function of the distance is also produced:
#+begin_src python :results value raw :session :exports results
-perc_df = pd.read_csv("outputs/tab_dist.csv", na_filter=False)
+perc_df = pd.read_csv(os.path.join(out_dir, "tab_dist.csv"), na_filter=False)
col_names = ["Distance", "Npixels", "Area", "Cumulation", "Percentage"]
tabulate(perc_df.head(10), headers=col_names, tablefmt="orgtbl", showindex=False)
#+end_src
@@ -147,16 +176,16 @@ tabulate(perc_df.head(10), headers=col_names, tablefmt="orgtbl", showindex=False
#+RESULTS:
| Distance | Npixels | Area | Cumulation | Percentage |
|----------+---------+---------+------------+------------|
-| 30 | 25325 | 2279.25 | 2279.25 | 85.2263 |
-| 60 | 3134 | 282.06 | 2561.31 | 95.7732 |
-| 90 | 869 | 78.21 | 2639.52 | 98.6976 |
-| 120 | 235 | 21.15 | 2660.67 | 99.4885 |
-| 150 | 91 | 8.19 | 2668.86 | 99.7947 |
-| 180 | 30 | 2.7 | 2671.56 | 99.8957 |
-| 210 | 15 | 1.35 | 2672.91 | 99.9462 |
-| 240 | 5 | 0.45 | 2673.36 | 99.963 |
-| 270 | 2 | 0.18 | 2673.54 | 99.9697 |
-| 300 | 2 | 0.18 | 2673.72 | 99.9764 |
+| 30 | 24937 | 2244.33 | 2244.33 | 83.583 |
+| 60 | 3451 | 310.59 | 2554.92 | 95.15 |
+| 90 | 1001 | 90.09 | 2645.01 | 98.5051 |
+| 120 | 282 | 25.38 | 2670.39 | 99.4503 |
+| 150 | 102 | 9.18 | 2679.57 | 99.7922 |
+| 180 | 29 | 2.61 | 2682.18 | 99.8894 |
+| 210 | 14 | 1.26 | 2683.44 | 99.9363 |
+| 240 | 6 | 0.54 | 2683.98 | 99.9564 |
+| 270 | 2 | 0.18 | 2684.16 | 99.9631 |
+| 300 | 3 | 0.27 | 2684.43 | 99.9732 |
* Local deforestation rate
@@ -165,116 +194,136 @@ The second step is to compute a local risk of deforestation at the pixel level u
To save space on disk, deforestation rates are converted to integer values between 0 and 10000 (ten thousand) and the raster type is set to UInt16. This ensures a precision of 10^{-4} for the deforestation rate which is sufficient to determine the 30 categories of deforestation risk, as imposed by the JNR methodology.
-#+begin_src python :results output :session :exports code
+#+begin_src python :results output :session :exports both
# Set window size
-ws = 31
+s = 5
# Compute local deforestation rate
-rmj.local_defor_rate(input_file=fcc_file,
- output_file="outputs/ldefrate_ws{}.tif".format(ws),
- win_size=ws,
- time_interval=10,
- blk_rows=100)
+rmj.local_defor_rate(
+ fcc_file=fcc_file,
+ defor_values=1,
+ ldefrate_file=os.path.join(out_dir, f"ldefrate.tif"),
+ win_size=s,
+ time_interval=10,
+ blk_rows=100,
+ verbose=False)
#+end_src
#+RESULTS:
-: 0%
8%
12%
16%
20%
24%
28%
32%
36%
40%
44%
48%
52%
56%
60%
64%
68%
72%
76%
80%
84%
88%
92%
96%
100%
100%
* Pixels with zero risk of deforestation
This third step sets a value of 10001 to pixels with zero deforestation risk. As explained previously, a risk of deforestation of zero is assumed when distance to forest edge is greater than the distance below which more than 99% of the deforestation occurs.
-#+begin_src python :results output :session :exports code
+#+begin_src python :results output :session :exports both
rmj.set_defor_cat_zero(
- input_file="outputs/ldefrate_ws31.tif",
- dist_file="outputs/dist_edge.tif",
+ ldefrate_file=os.path.join(out_dir, f"ldefrate.tif"),
+ dist_file=os.path.join(out_dir, "dist_edge.tif"),
dist_thresh=dist_thresh,
- output_file="outputs/defor_cat_zero.tif",
+ ldefrate_with_zero_file=os.path.join(out_dir, f"ldefrate_with_zero.tif"),
blk_rows=128,
- verbose=True)
+ verbose=False)
#+end_src
#+RESULTS:
-: Divide region in 20 blocks
-: 0%
10%
15%
20%
25%
30%
35%
40%
45%
50%
55%
60%
65%
70%
75%
80%
85%
90%
95%
100%
100%
-: Compute statistics
* Categories of deforestation risk
The fourth step implies converting the continuous values of the raster map of deforestation risk to categorical values. The JNR methodology suggests to use 31 classes of risk from "0" to "30" including the "0" class for the forest pixels with no risk of being deforested (located at a distance to the forest edge $> d$, see first step). Following the JNR methodology, at least three slicing algorithms must be compared to derive the categorical map of deforestation risk, such as "equal area", "equal interval", and "natural breaks". With the "equal area" algorithm, each class from "1" to "30" must cover approximately the same area. With the "equal interval" algorithm, classes from "1" to "30" correspond to bins of deforestation risk of the same range. In this case, some risk classes will be in majority in the landscape compared to other classes of lower frequency. With the "natural breaks" algorithm, the continuous deforestation risk is normalized before running an "equal interval" algorithm.
-#+begin_src python :results output :session :exports code
-rmj.defor_cat(input_file="outputs/defor_cat_zero.tif",
- output_file="outputs/defor_cat.tif",
- nbins=30,
- method="Equal Area",
- blk_rows=128)
+#+begin_src python :results output :session :exports both
+rmj.defor_cat(
+ ldefrate_with_zero_file=os.path.join(out_dir, f"ldefrate_with_zero.tif"),
+ riskmap_file=os.path.join(out_dir, "riskmap.tif"),
+ ncat=30,
+ method="Equal Interval",
+ blk_rows=128,
+ verbose=False)
+#+end_src
+
+#+RESULTS:
+
+The risk map can be plotted using the =plot.riskmap()= function.
+
+#+begin_src python :results file :session :exports both
+ofile = os.path.join(out_dir, "riskmap.png")
+riskmap_fig = rmj.plot.riskmap(
+ input_risk_map=os.path.join(out_dir, "riskmap.tif"),
+ maxpixels=1e8,
+ output_file=ofile,
+ borders=border_file,
+ legend=True,
+ figsize=(5, 4), dpi=800,
+ linewidth=0.2,)
+ofile
#+end_src
+#+NAME: fig:steps-riskmap
+#+ATTR_RST: :width 600
+#+CAPTION: *Map of the deforestation risk following the JNR methodology*. Forest pixels are categorized in up to 30 classes of deforestation risk. Forest pixels which belong to the class 0 (in green) are located farther than a distance of 120 m from the forest edge and have a negligible risk of being deforested.
#+RESULTS:
-: Divide region in 20 blocks
-: Compute histogram
-: 0%
10%
15%
20%
25%
30%
35%
40%
45%
50%
55%
60%
65%
70%
75%
80%
85%
90%
95%
100%
100%
-: Compute statistics
+[[file:outputs_steps/riskmap.png]]
+
* Deforestation rates per category of risk
Before the validation step, we need to compute the historical deforestation rates (in %/yr) for each category of spatial deforestation risk. The historical deforestation rates are computed for the calibration period (here 2000--2010). Deforestation rates provide estimates of the percentage of forest (which is then converted to an area of forest) that should be deforested inside each forest pixel which belongs to a given category of deforestation risk.
-#+begin_src python :results output :session :exports code
+#+begin_src python :results output :session :exports both
rmj.defrate_per_cat(
- fcc_file = fcc_file,
- defor_cat_file = "outputs/defor_cat.tif",
- time_interval = 10,
- tab_file = "outputs/defrate_per_cat.csv",
- blk_rows = 128)
+ fcc_file=fcc_file,
+ defor_values=1,
+ riskmap_file=os.path.join(out_dir, "riskmap.tif"),
+ time_interval=10,
+ tab_file_defrate=os.path.join(out_dir, "defrate_per_cat.csv"),
+ blk_rows=128,
+ verbose=False)
#+end_src
#+RESULTS:
-: Divide region in 20 blocks
-: Compute statistics
-: 0%
10%
15%
20%
25%
30%
35%
40%
45%
50%
55%
60%
65%
70%
75%
80%
85%
90%
95%
100%
100%
A table indicating the deforestation rate per category of deforestation is produced:
#+begin_src python :results value raw :session :exports results
-defrate_per_cat = pd.read_csv("outputs/defrate_per_cat.csv", na_filter=False)
+defrate_per_cat = pd.read_csv(os.path.join(out_dir, "defrate_per_cat.csv"), na_filter=False)
col_names = ["cat", "nfor", "ndefor", "rate"]
tabulate(defrate_per_cat, headers=col_names, tablefmt="orgtbl", showindex=False)
#+end_src
#+RESULTS:
-| cat | nfor | ndefor | rate |
-|-----+-------+--------+------------|
-| 1 | 39841 | 8 | 0.00200617 |
-| 2 | 13367 | 29 | 0.0214846 |
-| 3 | 13238 | 46 | 0.0342101 |
-| 4 | 13348 | 72 | 0.05265 |
-| 5 | 13290 | 105 | 0.0762562 |
-| 6 | 13309 | 150 | 0.107158 |
-| 7 | 13328 | 168 | 0.119136 |
-| 8 | 13175 | 184 | 0.1312 |
-| 9 | 13435 | 232 | 0.159864 |
-| 10 | 13272 | 268 | 0.184534 |
-| 11 | 13336 | 348 | 0.232344 |
-| 12 | 13291 | 386 | 0.255262 |
-| 13 | 13308 | 410 | 0.2687 |
-| 14 | 13296 | 491 | 0.313587 |
-| 15 | 13304 | 628 | 0.383405 |
-| 16 | 13315 | 649 | 0.393287 |
-| 17 | 13285 | 611 | 0.375516 |
-| 18 | 13333 | 763 | 0.44528 |
-| 19 | 13308 | 955 | 0.525106 |
-| 20 | 13301 | 1041 | 0.557349 |
-| 21 | 13304 | 1270 | 0.633328 |
-| 22 | 13288 | 1509 | 0.700437 |
-| 23 | 13321 | 1623 | 0.727261 |
-| 24 | 13300 | 1790 | 0.764367 |
-| 25 | 13302 | 2280 | 0.847442 |
-| 26 | 13314 | 2751 | 0.901193 |
-| 27 | 13295 | 3834 | 0.966697 |
-| 28 | 13314 | 6932 | 0.99936 |
-
-From this table, we see that except for category 1, categories have approximately the same surface area (corresponding to about 13300 pixels). Note that the number of categories might be slightly inferior to 30. Note also that the deforestation rate increases with the deforestation risk category and that deforestation rates are spread on the interval [0, 1], suggesting that category 1 represents well a category with very low deforestation risk (close to 0), and category 28 represents well a category with very high deforestation risk (close to 1).
+| cat | nfor | ndefor | rate |
+|-----+--------+--------+---------------------|
+| 1 | 286897 | 0 | 0.0 |
+| 2 | 0 | 0 | |
+| 3 | 0 | 0 | |
+| 4 | 0 | 0 | |
+| 5 | 0 | 0 | |
+| 6 | 0 | 0 | |
+| 7 | 0 | 0 | |
+| 8 | 0 | 0 | |
+| 9 | 0 | 0 | |
+| 10 | 0 | 0 | |
+| 11 | 6948 | 97 | 0.13115645793568742 |
+| 12 | 4555 | 83 | 0.16797929162030611 |
+| 13 | 4428 | 102 | 0.207883556342903 |
+| 14 | 4079 | 158 | 0.32635456697582377 |
+| 15 | 3771 | 161 | 0.35359204117624776 |
+| 16 | 1733 | 102 | 0.4548023398767944 |
+| 17 | 2940 | 157 | 0.4223580050270457 |
+| 18 | 4178 | 230 | 0.432341580700236 |
+| 19 | 4028 | 262 | 0.48960250057719656 |
+| 20 | 2401 | 182 | 0.5453769808930122 |
+| 21 | 3654 | 317 | 0.596469248332768 |
+| 22 | 1896 | 129 | 0.5057096122044651 |
+| 23 | 4637 | 530 | 0.7029181842913952 |
+| 24 | 3192 | 398 | 0.7359809944026328 |
+| 25 | 2775 | 349 | 0.7392177123700654 |
+| 26 | 5257 | 910 | 0.8505428722687592 |
+| 27 | 3933 | 780 | 0.8903521189382809 |
+| 28 | 4174 | 949 | 0.9241819269543683 |
+| 29 | 6428 | 1870 | 0.9678645395136823 |
+| 30 | 31671 | 21848 | 0.9999917619641472 |
+
+From this table, we see that the deforestation rate increases with the deforestation risk category and that deforestation rates are spread on the interval [0, 1], suggesting that category 1 represents well a category with very low deforestation risk (equal to 0), and category 30 represents well a category with very high deforestation risk (close to 1).
* Validation
@@ -285,29 +334,29 @@ To do so, we consider a square grid of at least 1000 spatial cells containing at
We can then compare the predicted deforestation with the observed deforestation in that spatial cell for the validation period. Because all cells don't have the same forest cover at the beginning of the validation period, a weight $w_j$ is computed for each grid cell $j$ such that $w_j=\beta_j / B$, with $\beta_j$ the forest cover (in ha) in the cell $j$ at the beginning of the validation period and $B$ the total forest cover in the jurisdiction (in ha) at the same date. We then calculate the weighted root mean squared error (wRMSE) from the observed and predicted deforestation for each cell and the cell weights.
#+begin_src python :results file :session :exports both
-ofile = "outputs/pred_obs.png"
+ofile = os.path.join(out_dir, "pred_obs.png")
rmj.validation(
- fcc_file = fcc_file,
- time_interval = 10,
- defor_cat_file = "outputs/defor_cat.tif",
- defrate_per_cat_file = "outputs/defrate_per_cat.csv",
- csize = 40,
- tab_file = "outputs/validation_data.csv",
- fig_file = ofile,
- figsize = (6.4, 4.8),
- dpi = 100)
+ fcc_file=fcc_file,
+ time_interval=10,
+ riskmap_file=os.path.join(out_dir, "riskmap.tif"),
+ tab_file_defrate=os.path.join(out_dir, "defrate_per_cat.csv"),
+ csize=40,
+ tab_file_pred=os.path.join(out_dir, "pred_obs.csv"),
+ fig_file_pred=ofile,
+ figsize=(6.4, 4.8),
+ dpi=100, verbose=False)
ofile
#+end_src
-#+NAME: fig:pred_obs
+#+NAME: fig:steps-pred_obs
#+ATTR_RST: :width 600
#+CAPTION: *Relationship between observed and predicted deforestation in 1 x 1 km grid cells*. The red line is the identity line. Values of the weighted root mean squared error (wRMSE, in ha) and of the number of observations ($n$, the number of spatial cells) are reported on the graph.
#+RESULTS:
-[[file:outputs/pred_obs.png]]
+[[file:outputs_steps/pred_obs.png]]
* Final risk map
-The user must repeat the procedure and obtain risk maps for various window size and slicing algorithms. Following the JNR methodology, at least 25 different sizes for the moving window must be tested together with two slicing algorithms ("Equal Interval" and "Equal Area"), thus leading to a minimum of 50 different maps of deforestation risk. The map with the smallest wRMSE value is considered the best risk map. Once the best risk map is identified, with the corresponding window size and slicing algorithm, a final risk map is derived considering both the calibration and validation period.
+The user must repeat the procedure and obtain risk maps for various window size and slicing algorithms. Following the JNR methodology, at least 25 different sizes for the moving window must be tested together with two slicing algorithms ("Equal Interval" and "Equal Area"), thus leading to a minimum of 50 different maps of deforestation risk. The map with the smallest wRMSE value is considered the best risk map. Once the best risk map is identified, with the corresponding window size and slicing algorithm, a final risk map is derived considering both the calibration and validation period (see the [[https://ecology.ghislainv.fr/riskmapjnr/notebooks/get_started.html][Get Started]] tutorial).
* Environment setup and test :noexport:
@@ -317,7 +366,7 @@ return(sys.executable)
#+END_SRC
#+RESULTS:
-: /home/ghislain/.pyenv/versions/miniconda3-latest/envs/conda-far/bin/python
+: /home/ghislain/.pyenv/versions/miniconda3-latest/envs/conda-rmj/bin/python
Local Variables:
org-babel-python-command: "/home/ghislain/.pyenv/versions/miniconda3-latest/envs/conda-rmj/bin/python"
diff --git a/docsrc/notebooks/steps.rst b/docsrc/notebooks/steps.rst
new file mode 100644
index 0000000..01d25c3
--- /dev/null
+++ b/docsrc/notebooks/steps.rst
@@ -0,0 +1,355 @@
+=========
+All steps
+=========
+
+
+
+
+1 Introduction
+--------------
+
+1.1 Objective
+~~~~~~~~~~~~~
+
+We present here all the steps of the JNR methodology that need to be followed to derive a map of the deforestation risk in a given jurisdiction.
+
+1.2 Importing Python modules
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+We import the Python modules needed for running the analysis.
+
+.. code:: python
+
+ # Imports
+ import os
+ import pkg_resources
+
+ import numpy as np
+ import matplotlib.pyplot as plt
+ import pandas as pd
+ from tabulate import tabulate
+
+ import riskmapjnr as rmj
+
+Increase the cache for GDAL to increase computational speed.
+
+.. code:: python
+
+ # GDAL
+ os.environ["GDAL_CACHEMAX"] = "1024"
+
+Set the ``PROJ_LIB`` environmental variable.
+
+.. code:: python
+
+ os.environ["PROJ_LIB"] = "/home/ghislain/.pyenv/versions/miniconda3-latest/envs/conda-rmj/share/proj"
+
+Create a directory to save results.
+
+.. code:: python
+
+ out_dir = "outputs_steps"
+ rmj.make_dir(out_dir)
+
+1.3 Forest cover change data
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+We use the Guadeloupe archipelago as a case study. Recent forest cover change data for Guadeloupe is included in the ``riskmapjnr`` package. The raster file (``fcc123_GLP.tif``) includes the following values: **1** for deforestation on the period 2000--2010, **2** for deforestation on the period 2010--2020, and **3** for the remaining forest in 2020. NoData value is set to **0**. The first period (2000--2010) will be used for calibration and the second period (2010--2020) will be used for validation. This is the only data we need to derive a map of deforestation risk following the JNR methodology.
+
+.. code:: python
+
+ fcc_file = pkg_resources.resource_filename("riskmapjnr", "data/fcc123_GLP.tif")
+ print(fcc_file)
+ border_file = pkg_resources.resource_filename("riskmapjnr", "data/ctry_border_GLP.gpkg")
+ print(border_file)
+
+::
+
+ /home/ghislain/Code/riskmapjnr/riskmapjnr/data/fcc123_GLP.tif
+ /home/ghislain/Code/riskmapjnr/riskmapjnr/data/ctry_border_GLP.gpkg
+
+
+We plot the forest cover change map with the ``plot.fcc123()`` function.
+
+.. code:: python
+
+ ofile = os.path.join(out_dir, "fcc123.png")
+ fig_fcc123 = rmj.plot.fcc123(
+ input_fcc_raster=fcc_file,
+ maxpixels=1e8,
+ output_file=ofile,
+ borders=border_file,
+ linewidth=0.2,
+ figsize=(5, 4), dpi=800)
+ ofile
+
+.. _fig:steps-fccmap:
+
+.. figure:: outputs_steps/fcc123.png
+ :width: 600
+
+
+ **Forest cover change map.** Deforestation on the first period (2000--2010) is in orange, deforestation on the second period (2000--2020) is in red and remaining forest (in 2020) is in green.
+
+2 Deforestation risk and distance to forest edge
+------------------------------------------------
+
+The first step is to compute the distance to the forest edge after which the risk of deforestation becomes negligible. Indeed, it is known from previous studies on tropical deforestation that the deforestation risk decreases rapidly with the distance to the forest edge and that most of the deforestation occurs close to the forest edge (Vieilledent et al., 2013, Grinand et al., 2020, Vieilledent, 2021, Dezécache et al., 2017). The JNR methodology suggests identifying the distance to the forest edge :math:`d`, so that at least 99% of the deforestation occurs within a distance :math:`\leq d`. Forest areas located at a distance from the forest edge :math:`\gt d` can be considered as having no risk of being deforested. As a consequence, forest pixels with a distance from the forest edge :math:`\gt d` are assigned category 0 (zero) for the deforestation risk.
+
+.. code:: python
+
+ ofile = os.path.join(out_dir, "perc_dist.png")
+ dist_edge_thres = rmj.dist_edge_threshold(
+ fcc_file=fcc_file,
+ defor_values=1,
+ dist_file=os.path.join(out_dir, "dist_edge.tif"),
+ dist_bins=np.arange(0, 1080, step=30),
+ tab_file_dist=os.path.join(out_dir, "tab_dist.csv"),
+ fig_file_dist=ofile,
+ blk_rows=128, verbose=False)
+ ofile
+
+.. _fig:steps-dist_edge:
+
+.. figure:: outputs_steps/perc_dist.png
+ :width: 600
+
+
+ **Identifying areas for which the risk of deforestation is negligible.** Figure shows that more than 99% of the deforestation occurs within a distance from the forest edge ≤ 120 m. Forest areas located at a distance > 120 m from the forest edge can be considered as having no risk of being deforested.
+
+The function returns a dictionnary including the distance threshold.
+
+.. code:: python
+
+ dist_thresh = dist_edge_thres["dist_thresh"]
+ print(f"The distance threshold is {dist_thresh} m")
+
+::
+
+ The distance threshold is 120 m
+
+
+A table indicating the cumulative percentage of deforestation as a function of the distance is also produced:
+
+.. table::
+
+ +----------+---------+---------+------------+------------+
+ | Distance | Npixels | Area | Cumulation | Percentage |
+ +==========+=========+=========+============+============+
+ | 30 | 24937 | 2244.33 | 2244.33 | 83.583 |
+ +----------+---------+---------+------------+------------+
+ | 60 | 3451 | 310.59 | 2554.92 | 95.15 |
+ +----------+---------+---------+------------+------------+
+ | 90 | 1001 | 90.09 | 2645.01 | 98.5051 |
+ +----------+---------+---------+------------+------------+
+ | 120 | 282 | 25.38 | 2670.39 | 99.4503 |
+ +----------+---------+---------+------------+------------+
+ | 150 | 102 | 9.18 | 2679.57 | 99.7922 |
+ +----------+---------+---------+------------+------------+
+ | 180 | 29 | 2.61 | 2682.18 | 99.8894 |
+ +----------+---------+---------+------------+------------+
+ | 210 | 14 | 1.26 | 2683.44 | 99.9363 |
+ +----------+---------+---------+------------+------------+
+ | 240 | 6 | 0.54 | 2683.98 | 99.9564 |
+ +----------+---------+---------+------------+------------+
+ | 270 | 2 | 0.18 | 2684.16 | 99.9631 |
+ +----------+---------+---------+------------+------------+
+ | 300 | 3 | 0.27 | 2684.43 | 99.9732 |
+ +----------+---------+---------+------------+------------+
+
+3 Local deforestation rate
+--------------------------
+
+The second step is to compute a local risk of deforestation at the pixel level using a moving window made of several pixels. The deforestation risk is estimated from the deforestation rate inside the moving window. The deforestation rate :math:`\theta` (in %/yr) is computed from the formula :math:`\theta=(\alpha_2/\alpha_1)^{1/\tau}-1`, with :math:`\alpha` the forest areas (in ha) at time :math:`t_1` and :math:`t_2`, and :math:`\tau`, the time interval (in yr) between time :math:`t_1` and :math:`t_2`. Using the deforestation rate formula, the moving window and the past forest cover change map, we can derive a raster map describing the local risk of deforestation at the same resolution as the input map.
+
+To save space on disk, deforestation rates are converted to integer values between 0 and 10000 (ten thousand) and the raster type is set to UInt16. This ensures a precision of 10\ :sup:`-4`\ for the deforestation rate which is sufficient to determine the 30 categories of deforestation risk, as imposed by the JNR methodology.
+
+.. code:: python
+
+ # Set window size
+ s = 5
+ # Compute local deforestation rate
+ rmj.local_defor_rate(
+ fcc_file=fcc_file,
+ defor_values=1,
+ ldefrate_file=os.path.join(out_dir, f"ldefrate.tif"),
+ win_size=s,
+ time_interval=10,
+ blk_rows=100,
+ verbose=False)
+
+4 Pixels with zero risk of deforestation
+----------------------------------------
+
+This third step sets a value of 10001 to pixels with zero deforestation risk. As explained previously, a risk of deforestation of zero is assumed when distance to forest edge is greater than the distance below which more than 99% of the deforestation occurs.
+
+.. code:: python
+
+ rmj.set_defor_cat_zero(
+ ldefrate_file=os.path.join(out_dir, f"ldefrate.tif"),
+ dist_file=os.path.join(out_dir, "dist_edge.tif"),
+ dist_thresh=dist_thresh,
+ ldefrate_with_zero_file=os.path.join(out_dir, f"ldefrate_with_zero.tif"),
+ blk_rows=128,
+ verbose=False)
+
+5 Categories of deforestation risk
+----------------------------------
+
+The fourth step implies converting the continuous values of the raster map of deforestation risk to categorical values. The JNR methodology suggests to use 31 classes of risk from “0” to “30” including the “0” class for the forest pixels with no risk of being deforested (located at a distance to the forest edge :math:`> d`, see first step). Following the JNR methodology, at least three slicing algorithms must be compared to derive the categorical map of deforestation risk, such as “equal area”, “equal interval”, and “natural breaks”. With the “equal area” algorithm, each class from “1” to “30” must cover approximately the same area. With the “equal interval” algorithm, classes from “1” to “30” correspond to bins of deforestation risk of the same range. In this case, some risk classes will be in majority in the landscape compared to other classes of lower frequency. With the “natural breaks” algorithm, the continuous deforestation risk is normalized before running an “equal interval” algorithm.
+
+.. code:: python
+
+ rmj.defor_cat(
+ ldefrate_with_zero_file=os.path.join(out_dir, f"ldefrate_with_zero.tif"),
+ riskmap_file=os.path.join(out_dir, "riskmap.tif"),
+ ncat=30,
+ method="Equal Interval",
+ blk_rows=128,
+ verbose=False)
+
+The risk map can be plotted using the ``plot.riskmap()`` function.
+
+.. code:: python
+
+ ofile = os.path.join(out_dir, "riskmap.png")
+ riskmap_fig = rmj.plot.riskmap(
+ input_risk_map=os.path.join(out_dir, "riskmap.tif"),
+ maxpixels=1e8,
+ output_file=ofile,
+ borders=border_file,
+ legend=True,
+ figsize=(5, 4), dpi=800,
+ linewidth=0.2,)
+ ofile
+
+.. _fig:steps-riskmap:
+
+.. figure:: outputs_steps/riskmap.png
+ :width: 600
+
+
+ **Map of the deforestation risk following the JNR methodology**. Forest pixels are categorized in up to 30 classes of deforestation risk. Forest pixels which belong to the class 0 (in green) are located farther than a distance of 120 m from the forest edge and have a negligible risk of being deforested.
+
+6 Deforestation rates per category of risk
+------------------------------------------
+
+Before the validation step, we need to compute the historical deforestation rates (in %/yr) for each category of spatial deforestation risk. The historical deforestation rates are computed for the calibration period (here 2000--2010). Deforestation rates provide estimates of the percentage of forest (which is then converted to an area of forest) that should be deforested inside each forest pixel which belongs to a given category of deforestation risk.
+
+.. code:: python
+
+ rmj.defrate_per_cat(
+ fcc_file=fcc_file,
+ defor_values=1,
+ riskmap_file=os.path.join(out_dir, "riskmap.tif"),
+ time_interval=10,
+ tab_file_defrate=os.path.join(out_dir, "defrate_per_cat.csv"),
+ blk_rows=128,
+ verbose=False)
+
+A table indicating the deforestation rate per category of deforestation is produced:
+
+.. table::
+
+ +-----+--------+--------+---------------------+
+ | cat | nfor | ndefor | rate |
+ +=====+========+========+=====================+
+ | 1 | 286897 | 0 | 0.0 |
+ +-----+--------+--------+---------------------+
+ | 2 | 0 | 0 | \ |
+ +-----+--------+--------+---------------------+
+ | 3 | 0 | 0 | \ |
+ +-----+--------+--------+---------------------+
+ | 4 | 0 | 0 | \ |
+ +-----+--------+--------+---------------------+
+ | 5 | 0 | 0 | \ |
+ +-----+--------+--------+---------------------+
+ | 6 | 0 | 0 | \ |
+ +-----+--------+--------+---------------------+
+ | 7 | 0 | 0 | \ |
+ +-----+--------+--------+---------------------+
+ | 8 | 0 | 0 | \ |
+ +-----+--------+--------+---------------------+
+ | 9 | 0 | 0 | \ |
+ +-----+--------+--------+---------------------+
+ | 10 | 0 | 0 | \ |
+ +-----+--------+--------+---------------------+
+ | 11 | 6948 | 97 | 0.13115645793568742 |
+ +-----+--------+--------+---------------------+
+ | 12 | 4555 | 83 | 0.16797929162030611 |
+ +-----+--------+--------+---------------------+
+ | 13 | 4428 | 102 | 0.207883556342903 |
+ +-----+--------+--------+---------------------+
+ | 14 | 4079 | 158 | 0.32635456697582377 |
+ +-----+--------+--------+---------------------+
+ | 15 | 3771 | 161 | 0.35359204117624776 |
+ +-----+--------+--------+---------------------+
+ | 16 | 1733 | 102 | 0.4548023398767944 |
+ +-----+--------+--------+---------------------+
+ | 17 | 2940 | 157 | 0.4223580050270457 |
+ +-----+--------+--------+---------------------+
+ | 18 | 4178 | 230 | 0.432341580700236 |
+ +-----+--------+--------+---------------------+
+ | 19 | 4028 | 262 | 0.48960250057719656 |
+ +-----+--------+--------+---------------------+
+ | 20 | 2401 | 182 | 0.5453769808930122 |
+ +-----+--------+--------+---------------------+
+ | 21 | 3654 | 317 | 0.596469248332768 |
+ +-----+--------+--------+---------------------+
+ | 22 | 1896 | 129 | 0.5057096122044651 |
+ +-----+--------+--------+---------------------+
+ | 23 | 4637 | 530 | 0.7029181842913952 |
+ +-----+--------+--------+---------------------+
+ | 24 | 3192 | 398 | 0.7359809944026328 |
+ +-----+--------+--------+---------------------+
+ | 25 | 2775 | 349 | 0.7392177123700654 |
+ +-----+--------+--------+---------------------+
+ | 26 | 5257 | 910 | 0.8505428722687592 |
+ +-----+--------+--------+---------------------+
+ | 27 | 3933 | 780 | 0.8903521189382809 |
+ +-----+--------+--------+---------------------+
+ | 28 | 4174 | 949 | 0.9241819269543683 |
+ +-----+--------+--------+---------------------+
+ | 29 | 6428 | 1870 | 0.9678645395136823 |
+ +-----+--------+--------+---------------------+
+ | 30 | 31671 | 21848 | 0.9999917619641472 |
+ +-----+--------+--------+---------------------+
+
+From this table, we see that the deforestation rate increases with the deforestation risk category and that deforestation rates are spread on the interval [0, 1], suggesting that category 1 represents well a category with very low deforestation risk (equal to 0), and category 30 represents well a category with very high deforestation risk (close to 1).
+
+7 Validation
+------------
+
+The fifth step focuses on comparing the map of deforestation risk with a deforestation map corresponding to the validation period. The validation period follows the calibration period and provides independent observations of deforestation.
+
+To do so, we consider a square grid of at least 1000 spatial cells containing at least one forest pixel at the beginning of the validation period. Following JNR specification, the cell size should be :math:`\leq` 10 km. Note that with the map of deforestation risk, each forest pixel at the beginning of the validation period falls into a category of deforestation risk. For each cell of the grid, we compute the predicted area of deforestation (in ha) given the map of deforestation risk and the historical deforestation rates for each category of deforestation risk computed on the calibration period (see previous step).
+
+We can then compare the predicted deforestation with the observed deforestation in that spatial cell for the validation period. Because all cells don’t have the same forest cover at the beginning of the validation period, a weight :math:`w_j` is computed for each grid cell :math:`j` such that :math:`w_j=\beta_j / B`, with :math:`\beta_j` the forest cover (in ha) in the cell :math:`j` at the beginning of the validation period and :math:`B` the total forest cover in the jurisdiction (in ha) at the same date. We then calculate the weighted root mean squared error (wRMSE) from the observed and predicted deforestation for each cell and the cell weights.
+
+.. code:: python
+
+ ofile = os.path.join(out_dir, "pred_obs.png")
+ rmj.validation(
+ fcc_file=fcc_file,
+ time_interval=10,
+ riskmap_file=os.path.join(out_dir, "riskmap.tif"),
+ tab_file_defrate=os.path.join(out_dir, "defrate_per_cat.csv"),
+ csize=40,
+ tab_file_pred=os.path.join(out_dir, "pred_obs.csv"),
+ fig_file_pred=ofile,
+ figsize=(6.4, 4.8),
+ dpi=100, verbose=False)
+ ofile
+
+.. _fig:steps-pred_obs:
+
+.. figure:: outputs_steps/pred_obs.png
+ :width: 600
+
+
+ **Relationship between observed and predicted deforestation in 1 x 1 km grid cells**. The red line is the identity line. Values of the weighted root mean squared error (wRMSE, in ha) and of the number of observations (:math:`n`, the number of spatial cells) are reported on the graph.
+
+8 Final risk map
+----------------
+
+The user must repeat the procedure and obtain risk maps for various window size and slicing algorithms. Following the JNR methodology, at least 25 different sizes for the moving window must be tested together with two slicing algorithms (“Equal Interval” and “Equal Area”), thus leading to a minimum of 50 different maps of deforestation risk. The map with the smallest wRMSE value is considered the best risk map. Once the best risk map is identified, with the corresponding window size and slicing algorithm, a final risk map is derived considering both the calibration and validation period (see the `Get Started `_ tutorial).
diff --git a/riskmapjnr/data/fcc123_GLP.tif b/riskmapjnr/data/fcc123_GLP.tif
index a37627a..0437169 100644
Binary files a/riskmapjnr/data/fcc123_GLP.tif and b/riskmapjnr/data/fcc123_GLP.tif differ