Difference between revisions of "SOD Spread tutorial"

From GRASS-Wiki
Jump to: navigation, search
(Compute the spread of SOD for default values)
Line 1: Line 1:
 
{{AddonCmd|r.pops.spread}} is a model for stochastic landscape spread of the pest and pathogens. It uses [https://github.com/ncsu-landscape-dynamics/PoPS PoPS] (Pest or Pathogen Spread) library. In this tutorial we will use it specifically to model the spread of Sudden Oak Death tree disease.
 
{{AddonCmd|r.pops.spread}} is a model for stochastic landscape spread of the pest and pathogens. It uses [https://github.com/ncsu-landscape-dynamics/PoPS PoPS] (Pest or Pathogen Spread) library. In this tutorial we will use it specifically to model the spread of Sudden Oak Death tree disease.
This tutorial shows how to run the model. You can download the [http://fatra.cnr.ncsu.edu/pops/data/Oregon.zip sample dataset] and simulate sudden oak death spread in the [https://goo.gl/maps/b1ZPn3abtW82 Rouge River-Siskiyou National Forest region] of western Oregon.
+
This tutorial shows how to run the model. You can download the [http://fatra.cnr.ncsu.edu/pops/data/PoPS_SOD_tutorial.zip sample dataset] and simulate sudden oak death spread in the [https://goo.gl/maps/b1ZPn3abtW82 Rouge River-Siskiyou National Forest region] of western Oregon.
  
 
= Software =
 
= Software =
 
Required software includes:
 
Required software includes:
* GRASS GIS >=7.2
+
* GRASS GIS >=7.8
 
* Addon module:
 
* Addon module:
 
** {{AddonCmd|r.pops.spread}}
 
** {{AddonCmd|r.pops.spread}}
  
 
= Input data used in this tutorial =
 
= Input data used in this tutorial =
Download the [http://fatra.cnr.ncsu.edu/pops/data/Oregon.zip sample dataset] containing:
+
Download the [http://fatra.cnr.ncsu.edu/pops/data/PoPS_SOD_tutorial.zip sample dataset] containing:
 
* digital elevation model
 
* digital elevation model
 
* orthophoto of study area
 
* orthophoto of study area
Line 15: Line 15:
 
* host layer
 
* host layer
 
* layer of all trees
 
* layer of all trees
* mapset containing moisture and temperature coefficients
+
* mapset containing weather coefficients
 
The sample dataset is a GRASS GIS Location, so it goes into your GRASS GIS Database which is usually a directory called grassdata in your home directory or your Documents directory.
 
The sample dataset is a GRASS GIS Location, so it goes into your GRASS GIS Database which is usually a directory called grassdata in your home directory or your Documents directory.
  
 
= Workflow =
 
= Workflow =
Download sample data and unzip it. Launch GRASS GIS and select the unzipped <tt>Oregon</tt> directory, Location <tt>Oregon_spread</tt> and create a new Mapset <tt>tutorial</tt>.
+
Download sample data and unzip it into your grassdata. Launch GRASS GIS and select Location <tt>PoPS_SOD_tutorial</tt> and Mapset <tt>tutorial</tt>.
  
<!-- Change working directory:
+
Change working directory:
  
Type <tt>cd</tt> (stands for change directory) into the GUI Console and hit Enter. Navigate to where ever you have saved the example data and change directory to the <tt>tutorial</tt> mapset. -->
+
Type <tt>cd</tt> (stands for change directory) into the GUI Console and hit Enter. You can create a directory for this exercise (outside of grassdata) anywhere where you can write and read. Navigate to that directory.
  
 
Install addon:
 
Install addon:
Line 30: Line 30:
 
</source>
 
</source>
  
First, we will set computational region of our analyses to an extent covering our study area and so that the cells are aligned with our host raster:
+
First, we will set computational region of our analyses to an extent covering our study area:
 
<source lang="bash">
 
<source lang="bash">
g.region vector=EU1_12x8 align=host -p
+
g.region region=small_study_area -p
 
</source>
 
</source>
  
 
== Create files with lists of input maps ==
 
== Create files with lists of input maps ==
 
Here we used already prepared weather coefficients, these can be created using this [https://github.com/ncsu-landscape-dynamics/weather-coefficient workflow].
 
Here we used already prepared weather coefficients, these can be created using this [https://github.com/ncsu-landscape-dynamics/weather-coefficient workflow].
We need two text files, one with temperature coefficients and one with precipitation coefficients.
+
Mapset weather includes raster layers per each week of a simulation. With that, we need to prepare a text file. List and write the maps in a file using g.list:
List and write the maps in a file using g.list. Search for ppt for precipitation and tmean or temperature mean for temperature, we list only the years we need for the simulation (2016 to 2021):
 
 
<source lang="bash">
 
<source lang="bash">
g.list -m type=raster pattern="*ppt_201[6-9]*,*ppt_202[0-2]*" mapset=weather output=precipitation.txt
+
g.list -m type=raster pattern="average_weather_*" mapset=weather output=weather.txt
g.list -m type=raster pattern="*tmean_201[6-9]*,*tmean_202[0-2]*" mapset=weather output=temperature.txt
 
 
</source>
 
</source>
 +
The file should be written to your current working directory.
 +
 +
== Download color ramp for infected ==
 +
Download [https://raw.githubusercontent.com/ncsu-landscape-dynamics/pops-intro-grass-notebook/master/color_infected.txt color ramp] into your current working directory to be used for better visualization of infected cells.
  
 
== Compute the spread of SOD for default values ==
 
== Compute the spread of SOD for default values ==

Revision as of 05:55, 31 March 2020

r.pops.spread is a model for stochastic landscape spread of the pest and pathogens. It uses PoPS (Pest or Pathogen Spread) library. In this tutorial we will use it specifically to model the spread of Sudden Oak Death tree disease. This tutorial shows how to run the model. You can download the sample dataset and simulate sudden oak death spread in the Rouge River-Siskiyou National Forest region of western Oregon.

Software

Required software includes:

Input data used in this tutorial

Download the sample dataset containing:

  • digital elevation model
  • orthophoto of study area
  • study boundaries
  • host layer
  • layer of all trees
  • mapset containing weather coefficients

The sample dataset is a GRASS GIS Location, so it goes into your GRASS GIS Database which is usually a directory called grassdata in your home directory or your Documents directory.

Workflow

Download sample data and unzip it into your grassdata. Launch GRASS GIS and select Location PoPS_SOD_tutorial and Mapset tutorial.

Change working directory:

Type cd (stands for change directory) into the GUI Console and hit Enter. You can create a directory for this exercise (outside of grassdata) anywhere where you can write and read. Navigate to that directory.

Install addon:

g.extension r.pops.spread

First, we will set computational region of our analyses to an extent covering our study area:

g.region region=small_study_area -p

Create files with lists of input maps

Here we used already prepared weather coefficients, these can be created using this workflow. Mapset weather includes raster layers per each week of a simulation. With that, we need to prepare a text file. List and write the maps in a file using g.list:

g.list -m type=raster pattern="average_weather_*" mapset=weather output=weather.txt

The file should be written to your current working directory.

Download color ramp for infected

Download color ramp into your current working directory to be used for better visualization of infected cells.

Compute the spread of SOD for default values

Example output of SOD spread. Overlaid onto the orthophoto image.

Run the model using the text files created and setting only the required parameters. For this analysis we used a wind direction of NE and are looking at the first 5 years of spread from the initial 2016 infection discovery.

r.pops.spread host=host total_plants=all_trees infected=inf_2016 output=spread_sod output_series=spread_sod wind=NE moisture_coefficient_file=precipitation.txt temperature_coefficient_file=temperature.txt start_time=2016 end_time=2021 step=week random_seed=4

Add ortho, spread results, and the initial infected area to the display to view the spread. Display only values greater than zero.

d.rast ortho
d.rast -i map=inf_2016 values=0
d.rast -i spread_sod values=0

You can visualize the spread series in Animation Tool.

So far the result represents one stochastic run, here we inspect the probability surface from 5 stochastic runs:

r.pops.spread host=host total_plants=all_trees infected=inf_2016 probability=probability wind=NE moisture_coefficient_file=precipitation.txt temperature_coefficient_file=temperature.txt start_time=2016 end_time=2021 step=week random_seed=4 runs=5 nprocs=5



Example output of SOD spread for kappa=0. Overlaid onto the orthophoto image.
Example output of SOD spread for kappa=4. Overlaid onto the orthophoto image.

Wind dispersal

Direction

Kappa influences the wind dispersal direction. Wind dispersal uses the Von Mises circular normal distribution. Large kappa makes the distribution very concentrated about the angle, specifically the wind direction specified. If kappa is set to 0 the wind dispersal direction will have no effect on distribution.

r.pops.spread host=host total_plants=all_trees infected=inf_2016 output=spread_sod_k0 wind=N moisture_coefficient_file=precipitation.txt temperature_coefficient_file=temperature.txt start_time=2016 end_time=2021 step=week kappa=0 random_seed=4

If kappa is larger than 2 the distribution becomes very concentrated around the specified wind direction.

r.pops.spread host=host total_plants=all_trees infected=inf_2016 output=spread_sod_k4 wind=N moisture_coefficient_file=precipitation.txt temperature_coefficient_file=temperature.txt start_time=2016 end_time=2021 step=week kappa=4 random_seed=4

Distance

Parameter short_distance_scale decides how far the spores can travel and it is the input to Cauchy distribution.

r.pops.spread host=host total_plants=all_trees infected=inf_2016 output=spread_sod_sc5 wind=N moisture_coefficient_file=precipitation.txt temperature_coefficient_file=temperature.txt start_time=2016 end_time=2021 step=week short_distance_scale=5 random_seed=4
r.pops.spread host=host total_plants=all_trees infected=inf_2016 output=spread_sod_sc30 wind=N moisture_coefficient_file=precipitation.txt temperature_coefficient_file=temperature.txt start_time=2016 end_time=2021 step=week short_distance_scale=30 random_seed=4


Spore rate

The spore production rate per week for each infected tree. This model uses the Poisson distribution to generate spores.

Decreasing the rate down to 1 scales down the spread a great deal. However there are still new areas of spread.

r.pops.spread host=host total_plants=all_trees infected=inf_2016 output=spread_sod_sr1 wind=N moisture_coefficient_file=precipitation.txt temperature_coefficient_file=temperature.txt start_time=2016 end_time=2021 step=week reproductive_rate=1 random_seed=4
r.pops.spread host=host total_plants=all_trees infected=inf_2016 output=spread_sod_sr6 wind=N moisture_coefficient_file=precipitation.txt temperature_coefficient_file=temperature.txt start_time=2016 end_time=2021 step=week reproductive_rate=6 random_seed=4


Treatments

We will treat the area by removing the host. We will develop several scenarios. First, no treatment is applied:

r.pops.spread host=host total_plants=all_trees infected=inf_2016 output=spread_sod_notreatment wind=N moisture_coefficient_file=precipitation.txt temperature_coefficient_file=temperature.txt start_time=2016 end_time=2021 step=week  random_seed=4

We treat the initial infection and a buffer around it. The treatments are applied at the end of the year.

r.buffer -z input=inf_2016 output=buffer_A distances=200
r.mapcalc "treatment_A = if (isnull(buffer_A), 0, 1)"
r.pops.spread host=host total_plants=all_trees infected=inf_2016 output=spread_sod_treatA wind=N moisture_coefficient_file=precipitation.txt temperature_coefficient_file=temperature.txt start_time=2016 end_time=2021 step=week  treatments=treatment_A treatment_year=2016 random_seed=4

Here we increase the buffer size:

r.buffer -z input=inf_2016 output=buffer_B distances=500
r.mapcalc "treatment_B = if (isnull(buffer_B), 0, 1)"
r.pops.spread host=host total_plants=all_trees infected=inf_2016 output=spread_sod_treatB wind=N moisture_coefficient_file=precipitation.txt temperature_coefficient_file=temperature.txt start_time=2016 end_time=2021 step=week  treatments=treatment_B treatment_year=2016 random_seed=4

Finally, we use the buffer from last example and create a large 1km wide barrier in an attempt to stop the spread. Inspect the annual results to see how effective the solution is:

r.mapcalc "barrier = if (y() > 4684000 && y() <4685000, 1, 0 )"
r.pops.spread host=host total_plants=all_trees infected=inf_2016 output=spread_sod_treatB_barrier output_series=spread_sod_treatB_barrier wind=N moisture_coefficient_file=precipitation.txt temperature_coefficient_file=temperature.txt start_time=2016 end_time=2021 step=week  treatments=treatment_B,barrier treatment_year=2016,2018 random_seed=4