Debian Codegraph @

raster/r.li/r.li.shannon/r.li.shannon.md

raw
1 ## DESCRIPTION
2
3 *r.li.shannon* calculates the "Shannon's diversity index" as:
4 ![r.li.shannon formula](r_li_shannon_formula.png)
5 with:
6
7 - *i*: patch type
8 - *m*: number of different patch types
9 - *p_i*: proportional abundance of patch type *i*
10
11 ## NOTES
12
13 Do not use absolute path names for the **config** and **output**
14 file/map parameters. If the "moving window" method was selected in
15 **g.gui.rlisetup**, then the output will be a raster map, otherwise an
16 ASCII file will be generated in the folder
17 `C:\Users\userxy\AppData\Roaming\GRASS8\r.li\output\` (MS-Windows) or
18 `$HOME/.grass8/r.li/output/` (GNU/Linux).
19
20 If the input raster map contains only NULL values then *r.li.shannon*
21 returns NULL.
22
23 ## EXAMPLES
24
25 To calculate Shannon's diversity index on map *my_map*, using *my_conf*
26 configuration file (previously defined with *g.gui.rlisetup*) and saving
27 results in *my_out*, run:
28
29 ```sh
30 r.li.shannon input=my_map conf=my_conf output=my_out
31 ```
32
33 Forest map (Spearfish sample dataset) example:
34
35 ```sh
36 g.region raster=landcover.30m -p
37 r.mapcalc "forests = if(landcover.30m >= 41 && landcover.30m <= 43,1,null())"
38 r.li.shannon input=forests conf=movwindow7 out=forests_shannon_mov7
39 r.univar forests_shannon_mov7
40 ```
41
42 Forest map (North Carolina sample dataset) example:
43
44 ```sh
45 g.region raster=landclass96 -p
46 r.mapcalc "forests = if(landclass96 == 5, 1, null() )"
47 r.li.shannon input=forests conf=movwindow7 out=forests_shannon_mov7
48
49 # verify
50 r.univar forests_shannon_mov7
51 r.to.vect input=forests output=forests type=area
52 d.mon wx0
53 d.rast forests_shannon_mov7
54 d.vect forests type=boundary
55 ```
56
57 ## SEE ALSO
58
59 *[r.li](r.li.md) (package overview),
60 [g.gui.rlisetup](g.gui.rlisetup.md)*
61
62 ## REFERENCES
63
64 McGarigal, K., and B. J. Marks. 1995. FRAGSTATS: spatial pattern
65 analysis program for quantifying landscape structure. USDA For. Serv.
66 Gen. Tech. Rep. PNW-351. ([PDF](https://doi.org/10.2737/PNW-GTR-351))
67
68 ## AUTHORS
69
70 Serena Pallecchi, student of Computer Science University of Pisa
71 (Italy).
72 Commission from Faunalia Pontedera (PI), Italy (<www.faunalia.it>)