diff --git a/far_functions/far_calibrate.py b/far_functions/far_calibrate.py index 2731607..4759fc3 100644 --- a/far_functions/far_calibrate.py +++ b/far_functions/far_calibrate.py @@ -155,7 +155,9 @@ def run(self): # Chains burnin=1000, mcmc=1000, thin=1, # Starting values - beta_start=self.beta_start) + beta_start=self.beta_start, + # Verbose = False for QGIS task + verbose=0) # Ecological and statistical significance effects = mod_icar.betas[1:] positive_effects = effects >= 0 @@ -204,7 +206,9 @@ def run(self): mcmc=mcmc, thin=thin, # Starting values - beta_start=beta_start) + beta_start=beta_start, + # Verbose = False for QGIS task + verbose=0) # Check isCanceled() to handle cancellation if self.isCanceled(): diff --git a/help/docsrc/README.org b/help/docsrc/README.org index 87af127..57c2fee 100644 --- a/help/docsrc/README.org +++ b/help/docsrc/README.org @@ -57,6 +57,25 @@ Deforestation risk maps obtained using this plugin can be used to estimate emiss #+attr_rst: :alt Banner [[https://ecology.ghislainv.fr/deforisk-qgis-plugin][https://ecology.ghislainv.fr/deforisk-qgis-plugin/_static/banner.png]] +* Specificities + +*Python based.* The ~deforisk~ plugin relies on four specific Python packages developed specifically for modelling deforestation: ~geefcc~, ~pywdpa~, ~forestatrisk~, and ~riskmapjnr~. The ~geefcc~ packages can be used to make forest cover change maps from Google Earth Engine (GEE) and download them locally using two global tree/forest cover change products: Global Forest Change or Tropical Moist Forests. The ~pywdpa~ package allows downloading vector files of protected areas for any countries using the World Database on Protected Areas (WDPA). The ~forestatrisk~ package provides functions to model deforestation and predict the spatial deforestation risk using various explanatory variables (distance to forest edge, elevation, protected areas, etc.) and various statistical models including iCAR, GLM, and Random Forest models. The ~riskmapjnr~ package allows deriving deforestation risk maps following Verra JNR methodologies which include a moving window model and a benchmark model which assumes a decrease of the deforestation risk with the distance to forest edge. + +#+attr_rst: :alt geefc :width 100px +[[https://ecology.ghislainv.fr/geefcc][https://ecology.ghislainv.fr/deforisk-qgis-plugin/_static/logo-geefcc.png]] +#+attr_rst: :alt pywdpa :width 100px +[[https://ecology.ghislainv.fr/pywdpa][https://ecology.ghislainv.fr/deforisk-qgis-plugin/_static/logo-pywdpa.png]] +#+attr_rst: :alt forestatrisk :width 100px +[[https://ecology.ghislainv.fr/forestatrisk][https://ecology.ghislainv.fr/deforisk-qgis-plugin/_static/logo-forestatrisk.png]] +#+attr_rst: :alt riskmapjnr :width 100px +[[https://ecology.ghislainv.fr/riskmapjnr][https://ecology.ghislainv.fr/deforisk-qgis-plugin/_static/logo-riskmapjnr.png]] + +*Processing raster by blocks.* Raster files of forest cover change and explanatory variables might occupy a space of several gigabytes on disk. Processing such large rasters in memory can be prohibitively intensive on computers with limited RAM. Functions used in the ~deforisk~ plugin process large rasters by blocks of pixels representing subsets of the raster data. This makes computation efficient, with low memory usage. Reading and writing subsets of raster data is done by using functions from GDAL, a dependency of the plugin. Numerical computations on arrays are performed with the NumPy Python package, whose core is mostly made of optimized and compiled C code that runs quickly. + +*Running tasks in parallel.* State-of-the-art approach to select the best deforestation risk map and forecast deforestation implies comparing various models, fit the models using forest cover change over different time periods and predict the deforestation risk at several dates. This implies repeating a high number of tasks. To save computation time, the ~deforisk~ plugin use the QGIS task manager which allows running several analysis in parallel. + +*OS independent.* Using both computation by block for large rasters and task parallelization, the ~deforisk~ plugin allows selecting the best deforestation risk map and forecast deforestation for large countries or areas of interest in a limited amount of time, even on personal computers with average performance hardware. Because the ~deforisk~ is a QGIS plugin written in Python, it should run on all operating systems able to run QGIS, including Windows ($\geq10$), Linux, and Mac OS. + * Installing the ~deforisk~ plugin in Qgis #+attr_rst: :directive note @@ -78,7 +97,6 @@ The development of the plugin has been funded by [[https://www.cirad.fr/en/][Cir #+attr_rst: :height 100px :alt Logo FAO [[https://www.fao.org][https://ecology.ghislainv.fr/deforisk-qgis-plugin/_static/logo_fao.png]] - * Contributing The ~deforisk~ QGIS plugin is Open Source and released under the [[https://ecology.ghislainv.fr/deforisk-qgis-plugin/license.html][GNU GPL version 3 license]]. Anybody who is interested can contribute to the package development following our [[https://ecology.ghislainv.fr/deforisk-qgis-plugin/contributing.html][Community guidelines]]. Every contributor must agree to follow the project's [[https://ecology.ghislainv.fr/deforisk-qgis-plugin/code_of_conduct.html][Code of conduct]]. diff --git a/help/docsrc/README.rst b/help/docsrc/README.rst index 305aaf9..57a8d23 100644 --- a/help/docsrc/README.rst +++ b/help/docsrc/README.rst @@ -40,6 +40,37 @@ Deforestation risk maps obtained using this plugin can be used to estimate emiss :target: https://ecology.ghislainv.fr/deforisk-qgis-plugin :alt: Banner +Specificities +------------- + +**Python based.** The ``deforisk`` plugin relies on four specific Python packages developed specifically for modelling deforestation: ``geefcc``, ``pywdpa``, ``forestatrisk``, and ``riskmapjnr``. The ``geefcc`` packages can be used to make forest cover change maps from Google Earth Engine (GEE) and download them locally using two global tree/forest cover change products: Global Forest Change or Tropical Moist Forests. The ``pywdpa`` package allows downloading vector files of protected areas for any countries using the World Database on Protected Areas (WDPA). The ``forestatrisk`` package provides functions to model deforestation and predict the spatial deforestation risk using various explanatory variables (distance to forest edge, elevation, protected areas, etc.) and various statistical models including iCAR, GLM, and Random Forest models. The ``riskmapjnr`` package allows deriving deforestation risk maps following Verra JNR methodologies which include a moving window model and a benchmark model which assumes a decrease of the deforestation risk with the distance to forest edge. + +.. image:: https://ecology.ghislainv.fr/deforisk-qgis-plugin/\_static/logo-geefcc.png + :target: https://ecology.ghislainv.fr/geefcc + :alt: geefc + :width: 100px + +.. image:: https://ecology.ghislainv.fr/deforisk-qgis-plugin/\_static/logo-pywdpa.png + :target: https://ecology.ghislainv.fr/pywdpa + :alt: pywdpa + :width: 100px + +.. image:: https://ecology.ghislainv.fr/deforisk-qgis-plugin/\_static/logo-forestatrisk.png + :target: https://ecology.ghislainv.fr/forestatrisk + :alt: forestatrisk + :width: 100px + +.. image:: https://ecology.ghislainv.fr/deforisk-qgis-plugin/\_static/logo-riskmapjnr.png + :target: https://ecology.ghislainv.fr/riskmapjnr + :alt: riskmapjnr + :width: 100px + +**Processing raster by blocks.** Raster files of forest cover change and explanatory variables might occupy a space of several gigabytes on disk. Processing such large rasters in memory can be prohibitively intensive on computers with limited RAM. Functions used in the ``deforisk`` plugin process large rasters by blocks of pixels representing subsets of the raster data. This makes computation efficient, with low memory usage. Reading and writing subsets of raster data is done by using functions from GDAL, a dependency of the plugin. Numerical computations on arrays are performed with the NumPy Python package, whose core is mostly made of optimized and compiled C code that runs quickly. + +**Running tasks in parallel.** State-of-the-art approach to select the best deforestation risk map and forecast deforestation implies comparing various models, fit the models using forest cover change over different time periods and predict the deforestation risk at several dates. This implies repeating a high number of tasks. To save computation time, the ``deforisk`` plugin use the QGIS task manager which allows running several analysis in parallel. + +**OS independent.** Using both computation by block for large rasters and task parallelization, the ``deforisk`` plugin allows selecting the best deforestation risk map and forecast deforestation for large countries or areas of interest in a limited amount of time, even on personal computers with average performance hardware. Because the ``deforisk`` is a QGIS plugin written in Python, it should run on all operating systems able to run QGIS, including Windows (:math:`\geq10`), Linux, and Mac OS. + Installing the ``deforisk`` plugin in Qgis ------------------------------------------ diff --git a/help/docsrc/_images/python_pkgs/logo-far.png b/help/docsrc/_images/python_pkgs/logo-far.png new file mode 100644 index 0000000..11156c0 Binary files /dev/null and b/help/docsrc/_images/python_pkgs/logo-far.png differ diff --git a/help/docsrc/_images/python_pkgs/logo-geefcc.png b/help/docsrc/_images/python_pkgs/logo-geefcc.png new file mode 100644 index 0000000..6e497fa Binary files /dev/null and b/help/docsrc/_images/python_pkgs/logo-geefcc.png differ diff --git a/help/docsrc/_images/python_pkgs/logo-pywdpa.png b/help/docsrc/_images/python_pkgs/logo-pywdpa.png new file mode 100644 index 0000000..f01e121 Binary files /dev/null and b/help/docsrc/_images/python_pkgs/logo-pywdpa.png differ diff --git a/help/docsrc/_images/python_pkgs/logo-riskmapjnr.png b/help/docsrc/_images/python_pkgs/logo-riskmapjnr.png new file mode 100644 index 0000000..90d1955 Binary files /dev/null and b/help/docsrc/_images/python_pkgs/logo-riskmapjnr.png differ diff --git a/help/docsrc/_images/python_pkgs/python_pkgs.png b/help/docsrc/_images/python_pkgs/python_pkgs.png new file mode 100644 index 0000000..5142650 Binary files /dev/null and b/help/docsrc/_images/python_pkgs/python_pkgs.png differ diff --git a/help/docsrc/_images/python_pkgs/python_pkgs.xcf b/help/docsrc/_images/python_pkgs/python_pkgs.xcf new file mode 100644 index 0000000..a7e569f Binary files /dev/null and b/help/docsrc/_images/python_pkgs/python_pkgs.xcf differ diff --git a/help/docsrc/_static/logo-far.png b/help/docsrc/_static/logo-far.png new file mode 100644 index 0000000..11156c0 Binary files /dev/null and b/help/docsrc/_static/logo-far.png differ diff --git a/help/docsrc/_static/logo-geefcc.png b/help/docsrc/_static/logo-geefcc.png new file mode 100644 index 0000000..6e497fa Binary files /dev/null and b/help/docsrc/_static/logo-geefcc.png differ diff --git a/help/docsrc/_static/logo-pywdpa.png b/help/docsrc/_static/logo-pywdpa.png new file mode 100644 index 0000000..f01e121 Binary files /dev/null and b/help/docsrc/_static/logo-pywdpa.png differ diff --git a/help/docsrc/_static/logo-riskmapjnr.png b/help/docsrc/_static/logo-riskmapjnr.png new file mode 100644 index 0000000..90d1955 Binary files /dev/null and b/help/docsrc/_static/logo-riskmapjnr.png differ diff --git a/help/docsrc/get_started.org b/help/docsrc/get_started.org index ef4c910..0302fcf 100644 --- a/help/docsrc/get_started.org +++ b/help/docsrc/get_started.org @@ -20,7 +20,7 @@ Open QGIS on your computer. To have access to log messages, activate the "Log Messages" panel in QGIS going to =View > Panel > Log Messages= in the Menu. When using a plugin, it is also a good habit to open the Python console in QGIS to have access to Python messages returned in the console. To open it, click on the Python icon @@rst:|ico_py|@@ in the "Plugins Toolbar". If the toolbar is not visible, activate it going to =View > Toolbars > Plugins Toolbar= in the Menu. -Once the plugin has been installed (see [[file:installation.html][Installation]] instructions), open the plugin clicking on its icon @@rst:|ico_deforisk|@@. You should see the versions of the dependencies installed in your environment written in the Python console. Check that these version numbers correspond to the last version for each dependency. Otherwise upgrade your dependencies. +Once the plugin has been installed (see [[file:installation.html][Installation]] instructions), open the plugin clicking on its icon @@rst:|ico_deforisk|@@. You should see the versions of the dependencies installed in your environment written in the Python console. Check that these version numbers correspond to the last version for each dependency. Otherwise upgrade the dependencies. #+begin_src python :results none :exports code osmconvert 0.8.10 diff --git a/help/docsrc/get_started.rst b/help/docsrc/get_started.rst index 3673580..684a909 100644 --- a/help/docsrc/get_started.rst +++ b/help/docsrc/get_started.rst @@ -18,7 +18,7 @@ Introduction Open QGIS on your computer. To have access to log messages, activate the “Log Messages” panel in QGIS going to ``View > Panel > Log Messages`` in the Menu. When using a plugin, it is also a good habit to open the Python console in QGIS to have access to Python messages returned in the console. To open it, click on the Python icon |ico_py| in the “Plugins Toolbar”. If the toolbar is not visible, activate it going to ``View > Toolbars > Plugins Toolbar`` in the Menu. -Once the plugin has been installed (see `Installation `_ instructions), open the plugin clicking on its icon |ico_deforisk|. You should see the versions of the dependencies installed in your environment written in the Python console. Check that these version numbers correspond to the last version for each dependency. Otherwise upgrade your dependencies. +Once the plugin has been installed (see `Installation `_ instructions), open the plugin clicking on its icon |ico_deforisk|. You should see the versions of the dependencies installed in your environment written in the Python console. Check that these version numbers correspond to the last version for each dependency. Otherwise upgrade the dependencies. .. code:: python