Difference between revisions of "SOD Spread tutorial"

From GRASS-Wiki
Jump to: navigation, search
(update tutorial)
(workflow)
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 one of our rasters:
+
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:
 
<source lang="bash">
 
<source lang="bash">
g.region vector=EU1_12x8 -p
+
g.region vector=EU1_12x8 align=host -p
 
</source>
 
</source>
  
 
== Create files with lists of input maps ==
 
== Create files with lists of input maps ==
List all maps in the weather mapset in one text file using g.list. Search for ppt for precipitation and tmean or temperature mean for temperature:
+
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.
 +
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* mapset=weather output=precipitation.txt
+
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=*tmean* mapset=weather output=temperature.txt
+
g.list -m type=raster pattern="*tmean_201[6-9]*,*tmean_202[0-2]*" mapset=weather output=temperature.txt
 
</source>
 
</source>
  
 
== Compute the spread of SOD for default values ==
 
== Compute the spread of SOD for default values ==
[[File:Spread sod.png|150px|thumb|Output of SOD spread for default r.spread.sod parameters for the years 2016-2021. Overlaid onto the orthophoto image.]]
+
[[File:Spread sod.png|150px|thumb|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.
 
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.
 
<source lang="bash">
 
<source lang="bash">
r.spread.sod species=lide_den_int lvtree=all_den_int infected=inf_2016 output=spread_sod wind=NE moisture_file=precipitation.txt temperature_file=temperature.txt start_time=2016 end_time=2021 random_seed=4
+
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
 
</source>
 
</source>
  
Add the initial infected area and ortho photo layers to the display to view the spread. Rearrange layers so ortho is on the bottom.
+
Add ortho, spread results, and the initial infected area to the display to view the spread.
 +
Display only values greater than zero.
 
<source lang="bash">
 
<source lang="bash">
d.rast inf_2016_null
 
 
d.rast ortho
 
d.rast ortho
 +
d.rast -i map=inf_2016 values=0
 +
d.rast -i spread_sod values=0
 
</source>
 
</source>
  
Set all spread values of 0 to null to view orthophoto layer underneath. Then add the layer.
+
<!--
 
<source lang="bash">
 
<source lang="bash">
r.null map=spread_sod setnull=0
+
t.create output=SOD semantictype=mean title="SOD spread between 2016 and 2021" description="SOD spread between 2016 and 2021"
d.rast spread_sod
+
g.list type=raster pattern=spread_sod_* output=sod_series.txt
 +
t.register input=SOD file=/home/tangible/Documents/SOD/sod_series.txt start=2016-01-01 increment="1 years"
 
</source>
 
</source>
 +
-->
  
[[File:Spread sodk1.png|150px|thumb|Output of SOD spread for kappa=0 for the years 2016-2021. Overlaid onto the orthophoto image.]]
+
You can visualize the spread series in Animation Tool.
[[File:Spread sodk2.png|150px|thumb|Output of SOD spread for kappa=4 for the years 2016-2021. Overlaid onto the orthophoto image.]]
+
 
 +
[[File:Spread sodk1.png|150px|thumb|Example output of SOD spread for kappa=0. Overlaid onto the orthophoto image.]]
 +
[[File:Spread sodk2.png|150px|thumb|Example output of SOD spread for kappa=4. Overlaid onto the orthophoto image.]]
 
== Working with the optional parameters ==
 
== Working with the optional parameters ==
 
===Kappa(k)===
 
===Kappa(k)===
Line 69: Line 77:
 
If k is set to 0 the wind dispersal will have no effect on distribution.
 
If k is set to 0 the wind dispersal will have no effect on distribution.
 
<source lang="bash">
 
<source lang="bash">
r.spread.sod species=lide_den_int lvtree=all_den_int infected=inf_2016 output=spread_sodk1 wind=NE moisture_file=precipitation.txt temperature_file=temperature.txt start_time=2016 end_time=2021 kappa=0 random_seed=4
+
r.pops.spread species=lide_den_int lvtree=all_den_int infected=inf_2016 output=spread_sodk1 wind=NE moisture_file=precipitation.txt temperature_file=temperature.txt start_time=2016 end_time=2021 kappa=0 random_seed=4
 
</source>
 
</source>
  
 
If k is larger than 2 the distribution becomes very concentrated around the prevailing wind direction.
 
If k is larger than 2 the distribution becomes very concentrated around the prevailing wind direction.
 
<source lang="bash">
 
<source lang="bash">
r.spread.sod species=lide_den_int lvtree=all_den_int infected=inf_2016 output=spread_sodk2 wind=NE moisture_file=precipitation.txt temperature_file=temperature.txt start_time=2016 end_time=2021 kappa=4 random_seed=4
+
r.pops.spread species=lide_den_int lvtree=all_den_int infected=inf_2016 output=spread_sodk2 wind=NE moisture_file=precipitation.txt temperature_file=temperature.txt start_time=2016 end_time=2021 kappa=4 random_seed=4
 
</source>
 
</source>
  
Line 82: Line 90:
 
A parameter between 0 and 1 used in the equation for Bernoulli distribution. This parameter is then factored into the Cauchy distribution model for the probability of using the first model. In this instance, a change in the gamma value doesn’t visually affect the output. An example console input for this factor would be:
 
A parameter between 0 and 1 used in the equation for Bernoulli distribution. This parameter is then factored into the Cauchy distribution model for the probability of using the first model. In this instance, a change in the gamma value doesn’t visually affect the output. An example console input for this factor would be:
 
<source lang="bash">
 
<source lang="bash">
r.spread.sod species=lide_den_int lvtree=all_den_int infected=inf_2016 output=spread_sodg1 wind=NE moisture_file=precipitation.txt temperature_file=temperature.txt start_time=2016 end_time=2021 gamma=0.5 random_seed=4
+
r.pops.spread species=lide_den_int lvtree=all_den_int infected=inf_2016 output=spread_sodg1 wind=NE moisture_file=precipitation.txt temperature_file=temperature.txt start_time=2016 end_time=2021 gamma=0.5 random_seed=4
 
</source>
 
</source>
  
Line 90: Line 98:
 
Decreasing the rate down to 1 scales down the spread a great deal. However there are still new areas of spread.
 
Decreasing the rate down to 1 scales down the spread a great deal. However there are still new areas of spread.
 
<source lang="bash">
 
<source lang="bash">
r.spread.sod species=lide_den_int lvtree=all_den_int infected=inf_2016 output=spread_sodsr1 wind=NE moisture_file=precipitation.txt temperature_file=temperature.txt start_time=2016 end_time=2021 spore_rate=1 random_seed=4
+
r.pops.spread species=lide_den_int lvtree=all_den_int infected=inf_2016 output=spread_sodsr1 wind=NE moisture_file=precipitation.txt temperature_file=temperature.txt start_time=2016 end_time=2021 spore_rate=1 random_seed=4
 
</source>
 
</source>
  
 
Increasing the rate to 10 drastically increases the spread, as to be expected.
 
Increasing the rate to 10 drastically increases the spread, as to be expected.
 
<source lang="bash">
 
<source lang="bash">
r.spread.sod species=lide_den_int lvtree=all_den_int infected=inf_2016 output=spread_sodsr2 wind=NE moisture_file=precipitation.txt temperature_file=temperature.txt start_time=2016 end_time=2021 spore_rate=10 random_seed=4
+
r.pops.spread species=lide_den_int lvtree=all_den_int infected=inf_2016 output=spread_sodsr2 wind=NE moisture_file=precipitation.txt temperature_file=temperature.txt start_time=2016 end_time=2021 spore_rate=10 random_seed=4
 
</source>
 
</source>
  
Line 107: Line 115:
 
Setting scale_1 factor to 1 so it has no effect in the equation.
 
Setting scale_1 factor to 1 so it has no effect in the equation.
 
<source lang="bash">
 
<source lang="bash">
r.spread.sod species=lide_den_int lvtree=all_den_int infected=inf_2016 output=spread_sods1_1 wind=NE moisture_file=precipitation.txt temperature_file=temperature.txt start_time=2016 end_time=2021 scale_1=1 random_seed=4
+
r.pops.spread species=lide_den_int lvtree=all_den_int infected=inf_2016 output=spread_sods1_1 wind=NE moisture_file=precipitation.txt temperature_file=temperature.txt start_time=2016 end_time=2021 scale_1=1 random_seed=4
 
</source>
 
</source>
  
 
Setting scale_1 factor to 50 so it has a greater effect on the spread.
 
Setting scale_1 factor to 50 so it has a greater effect on the spread.
 
<source lang="bash">
 
<source lang="bash">
r.spread.sod species=lide_den_int lvtree=all_den_int infected=inf_2016 output=spread_sods1_2 wind=NE moisture_file=precipitation.txt temperature_file=temperature.txt start_time=2016 end_time=2021 scale_1=50 random_seed=4
+
r.pops.spread species=lide_den_int lvtree=all_den_int infected=inf_2016 output=spread_sods1_2 wind=NE moisture_file=precipitation.txt temperature_file=temperature.txt start_time=2016 end_time=2021 scale_1=50 random_seed=4
 
</source>
 
</source>
  
 
Scale_2 is undefined in the equation when the model is run on default. In this instance scale_2 has no visual effect on the output. An example console input for this factor would be:
 
Scale_2 is undefined in the equation when the model is run on default. In this instance scale_2 has no visual effect on the output. An example console input for this factor would be:
 
<source lang="bash">
 
<source lang="bash">
r.spread.sod species=lide_den_int lvtree=all_den_int infected=inf_2016 output=spread_sods2 wind=NE moisture_file=precipitation.txt temperature_file=temperature.txt start_time=2016 end_time=2021 scale_2=20 random_seed=4
+
r.pops.spread species=lide_den_int lvtree=all_den_int infected=inf_2016 output=spread_sods2 wind=NE moisture_file=precipitation.txt temperature_file=temperature.txt start_time=2016 end_time=2021 scale_2=20 random_seed=4
 
</source>
 
</source>

Revision as of 09:02, 14 March 2019

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 moisture and temperature 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. Launch GRASS GIS and select the unzipped Oregon directory, Location Oregon_spread and create a new Mapset tutorial.


Install addon:

g.extension r.pops.spread

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:

g.region vector=EU1_12x8 align=host -p

Create files with lists of input maps

Here we used already prepared weather coefficients, these can be created using this workflow. We need two text files, one with temperature coefficients and one with precipitation coefficients. 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):

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="*tmean_201[6-9]*,*tmean_202[0-2]*" mapset=weather output=temperature.txt

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.

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.

Working with the optional parameters

Kappa(k)

A measure of concentration, a reciprocal measure of dispersion. For this model the Von Mises circular normal distribution equation was used. The default value of k is 2 so the effect wind dispersal has on the spores shows an average distribution.

If k is set to 0 the wind dispersal will have no effect on distribution.

r.pops.spread species=lide_den_int lvtree=all_den_int infected=inf_2016 output=spread_sodk1 wind=NE moisture_file=precipitation.txt temperature_file=temperature.txt start_time=2016 end_time=2021 kappa=0 random_seed=4

If k is larger than 2 the distribution becomes very concentrated around the prevailing wind direction.

r.pops.spread species=lide_den_int lvtree=all_den_int infected=inf_2016 output=spread_sodk2 wind=NE moisture_file=precipitation.txt temperature_file=temperature.txt start_time=2016 end_time=2021 kappa=4 random_seed=4

Gamma(y)

Output of SOD spread for spore_rate=0 for the years 2016-2021. Overlaid onto the orthophoto image.
Output of SOD spread for spore_rate=10 for the years 2016-2021. Overlaid onto the orthophoto image.

A parameter between 0 and 1 used in the equation for Bernoulli distribution. This parameter is then factored into the Cauchy distribution model for the probability of using the first model. In this instance, a change in the gamma value doesn’t visually affect the output. An example console input for this factor would be:

r.pops.spread species=lide_den_int lvtree=all_den_int infected=inf_2016 output=spread_sodg1 wind=NE moisture_file=precipitation.txt temperature_file=temperature.txt start_time=2016 end_time=2021 gamma=0.5 random_seed=4

Spore_rate

The spore production rate per week for each infected tree. This model uses the Poisson distribution model to determine the spore rate value. At the time of the initial infection the spores were calculated to spread at a rate of 4.4 spores per week.

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

r.pops.spread species=lide_den_int lvtree=all_den_int infected=inf_2016 output=spread_sodsr1 wind=NE moisture_file=precipitation.txt temperature_file=temperature.txt start_time=2016 end_time=2021 spore_rate=1 random_seed=4

Increasing the rate to 10 drastically increases the spread, as to be expected.

r.pops.spread species=lide_den_int lvtree=all_den_int infected=inf_2016 output=spread_sodsr2 wind=NE moisture_file=precipitation.txt temperature_file=temperature.txt start_time=2016 end_time=2021 spore_rate=10 random_seed=4

Updating these calculations on a regular basis can be done quite easily through the model to better monitor the spread. These values can also be adjusted for distinct locations or different forms of sudden oak death.

Output of SOD spread for scale_1=1 for the years 2016-2021. Overlaid onto the orthophoto image.
Output of SOD spread for scale_1=50 for the years 2016-2021. Overlaid onto the orthophoto image.

Scale_1 and Scale_2

Parameters dealing with the Cauchy distribution, which is the equation that calculates the continuous random distribution of the spores based on inputs. These scale factors effect the outcome by increasing or decreasing the distribution of the spores. Scale_1 is default set to 20.57 which was found to be the initial spread scale in the western Oregon SOD case.

Setting scale_1 factor to 1 so it has no effect in the equation.

r.pops.spread species=lide_den_int lvtree=all_den_int infected=inf_2016 output=spread_sods1_1 wind=NE moisture_file=precipitation.txt temperature_file=temperature.txt start_time=2016 end_time=2021 scale_1=1 random_seed=4

Setting scale_1 factor to 50 so it has a greater effect on the spread.

r.pops.spread species=lide_den_int lvtree=all_den_int infected=inf_2016 output=spread_sods1_2 wind=NE moisture_file=precipitation.txt temperature_file=temperature.txt start_time=2016 end_time=2021 scale_1=50 random_seed=4

Scale_2 is undefined in the equation when the model is run on default. In this instance scale_2 has no visual effect on the output. An example console input for this factor would be:

r.pops.spread species=lide_den_int lvtree=all_den_int infected=inf_2016 output=spread_sods2 wind=NE moisture_file=precipitation.txt temperature_file=temperature.txt start_time=2016 end_time=2021 scale_2=20 random_seed=4