Skip to content

r.pi.energy.pr

Individual-based dispersal model for connectivity analysis (energy based) using iterative patch removal.

r.pi.energy.pr [-abrp] input=name [costmap=string] [suitability=string] output=name keyval=integer step_length=integer [perception=integer] [multiplicator=float] n=integer energy=float percent=float stats=string [,string,...] [out_freq=integer] [seed=integer] [title="phrase"] [--overwrite] [--verbose] [--quiet] [--qq] [--ui]

Example:

r.pi.energy.pr input=name output=name keyval=integer step_length=integer n=integer energy=float percent=float stats=string

grass.script.run_command("r.pi.energy.pr", input, costmap=None, suitability=None, output, keyval, step_length, perception=None, multiplicator=None, n, energy, percent, stats, out_freq=None, seed=None, title=None, flags=None, overwrite=False, verbose=False, quiet=False, superquiet=False)

Example:

gs.run_command("r.pi.energy.pr", input="name", output="name", keyval=integer, step_length=integer, n=integer, energy=float, percent=float, stats="string")

Parameters

input=name [required]
    Name of input raster map
costmap=string
    Name of the costmap
suitability=string
    Name of the suitability raster with values from 0-100
output=name [required]
    Name for output raster map
keyval=integer [required]
    Category value of the patches
step_length=integer [required]
    Length of a single step measured in pixels
perception=integer
    Perception range
multiplicator=float
    Attractivity of patches [1-inf]
n=integer [required]
    Number of individuals
energy=float [required]
    Initial energy of the individuals
percent=float [required]
    Percentage of finished individuals desired before simulation ends
stats=string [,string,...] [required]
    Statistical method to perform on the pathlengths of the individuals
    Allowed values: average, variance, standard deviation, median, min, max
out_freq=integer
    Output an intermediate state of simulation each [out_freq] steps
seed=integer
    Seed for random number generator
title="phrase"
    Title for resultant raster map
-a
    Set for 8 cell-neighbors. 4 cell-neighbors are default
-b
    Set if individuals should be set back after leaving area
-r
    Set to remove individuals which start in the deleted patch
-p
    Set to output values as percentual of the value from the reference run
--overwrite
    Allow output files to overwrite existing files
--help
    Print usage summary
--verbose
    Verbose module output
--quiet
    Quiet module output
--qq
    Very quiet module output
--ui
    Force launching GUI dialog

input : str, required
    Name of input raster map
    Used as: input, raster, name
costmap : str, optional
    Name of the costmap
    Used as: input, raster
suitability : str, optional
    Name of the suitability raster with values from 0-100
    Used as: input, raster
output : str, required
    Name for output raster map
    Used as: output, raster, name
keyval : int, required
    Category value of the patches
step_length : int, required
    Length of a single step measured in pixels
perception : int, optional
    Perception range
multiplicator : float, optional
    Attractivity of patches [1-inf]
n : int, required
    Number of individuals
energy : float, required
    Initial energy of the individuals
percent : float, required
    Percentage of finished individuals desired before simulation ends
stats : str | list[str], required
    Statistical method to perform on the pathlengths of the individuals
    Allowed values: average, variance, standard deviation, median, min, max
out_freq : int, optional
    Output an intermediate state of simulation each [out_freq] steps
seed : int, optional
    Seed for random number generator
title : str, optional
    Title for resultant raster map
    Used as: "phrase"
flags : str, optional
    Allowed values: a, b, r, p
    a
        Set for 8 cell-neighbors. 4 cell-neighbors are default
    b
        Set if individuals should be set back after leaving area
    r
        Set to remove individuals which start in the deleted patch
    p
        Set to output values as percentual of the value from the reference run
overwrite: bool, optional
    Allow output files to overwrite existing files
    Default: False
verbose: bool, optional
    Verbose module output
    Default: False
quiet: bool, optional
    Quiet module output
    Default: False
superquiet: bool, optional
    Very quiet module output
    Default: False

DESCRIPTION

This function is based on r.pi.energy but adds the functionality of iterative patch removal for testing of patch relevance to maintain the landscape connectivity integrity. Isolation or connectivity of singular patches of a defined landcover class are analysed using individual-based dispersal models. This functions uses a maximum amount of energy for each individuals dispersing through the landscape which is deminished by a fricition or cost map. Unlike the related function r.pi.energy does this function allows individuals to stay or move within a patch until the energy is depleted.

NOTES

Amount of successful immigrants or emigrants are not taken individual into account which emigrated from and immigrated into the same patch (pseudo immigration).

The suitability matrix impacts the step direction, while the costmap relates to the depletion of assigned energy.

EXAMPLE

An example for the North Carolina sample dataset: The amount (average) and variance with or without the respective patch of successful emigrants (*_emi), immigrants (*_imi), the percentage of immigrants per patch (*_imi_percent), the amount of lost indivuals (*_lost), the amount of migrants (*_mig), successful (*_mig_succ) and unsuccessful migrants (_mig_unsucc) can be retrieved using this command:

r.pi.energy.pr input=landclass96 output=energyiter1 keyval=5 n=1000 step_length=5 energy=10 percent=80 stats=average,variance

introducing costs for movement results in different immigration counts:

r.mapcalc "cost_raster = if(landclass96==5,1,if(landclass96 == 1, 10, if (landclass96==3,2, if(landclass96==4,1,if(landclass96==6,100)))))"
r.pi.energy.pr input=landclass96 output=energy1 keyval=5 n=1000 step_length=5 energy=10 percent=80 stats=average costmap=cost_raster

introducing a suitability for the movement:

# the suitability for the next step selection is defined as:
# class 5 and 3 (forest and grassland) have a high suitability,
# while shrubland (class 4) only a moderate and water and developed
# areas (class 6 and 1) have a very low suitability:

r.mapcalc "suit_raster = if(landclass96==5,100,if(landclass96 == 3, 100, if (landclass96==1,1, if(landclass96==6,1,if(landclass96==4,50)))))"
r.pi.energy.pr input=landclass96 output=energyiter3 keyval=5 n=1000 step_length=5 energy=10 percent=80 suitability=suit_raster stats=average,variance

further settings can be changed and information retrieved: setting the perception range to 10 pixel:

r.pi.energy.pr input=landclass96 output=energyiter keyval=5 n=1000 step_length=5 energy=10 percent=80 perception=10 stats=average

increasing the attraction to move towards patches to 10:

r.pi.energy input=landclass96 output=energyiter keyval=5 n=1000 step_length=5 energy=10 percent=80 stats=average multiplicator=10

output of each movement location for a defined step frequency. Here every 10th step is provided as output raster:

r.pi.energy input=landclass96 output=energyiter keyval=5 n=1000 step_length=5 energy=10 percent=80 stats=average out_freq=10

SEE ALSO

r.pi.energy, r.pi.searchtime, r.pi

AUTHORS

Programming: Elshad Shirinov
Scientific concept: Dr. Martin Wegmann
Department of Remote Sensing
Remote Sensing and Biodiversity Unit
University of Wuerzburg, Germany

Port to GRASS GIS 7: Markus Metz

SOURCE CODE

Available at: r.pi.energy.pr source code (history)
Latest change: Thursday Feb 20 13:02:26 2025 in commit 53de819