r.li.testing_sp_mov.sh 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  1. #!/bin/sh
  2. #========================
  3. #Spearfish tests
  4. # 7x7 moving window test
  5. # Brute-force testing in a loop
  6. # TODO: change to/add 3x3 example
  7. # created conf file as described in EXAMPLES, moving window,
  8. # see gui/wxgui/rlisetup/g.gui.rlisetup.html
  9. echo "SAMPLINGFRAME 0|0|1|1
  10. SAMPLEAREA -1|-1|0.015021459227467811|0.011058451816745656
  11. MOVINGWINDOW" > $HOME/.grass7/r.li/movwindow7
  12. export GRASS_OVERWRITE=1
  13. g.region raster=landcover.30m -p
  14. r.mapcalc "forests = if(landcover.30m >= 41 && landcover.30m <= 43,1,null())"
  15. MEASURE="dominance edgedensity mpa mps padcv padrange padsd patchdensity patchnum pielou richness shannon shape simpson"
  16. for mymeasure in $MEASURE ; do
  17. echo "====== $mymeasure: ========================"
  18. r.li.${mymeasure} forests conf=movwindow7 output=forests_${mymeasure}_mov7
  19. r.univar -g forests_${mymeasure}_mov7
  20. done
  21. # here also alpha:
  22. mymeasure=renyi
  23. echo "====== $mymeasure: ========================"
  24. r.li.renyi forests conf=movwindow7 output=forests_renyi_mov7_a06 alpha=0.6
  25. r.univar -g forests_renyi_mov7_a06
  26. echo "====== End of r.li tests ========================"