Skip to content

r.pi.corr.mw

Moving window correlation analysis.

r.pi.corr.mw input1=name input2=name output=name size=integer max=integer [title="phrase"] [--overwrite] [--verbose] [--quiet] [--qq] [--ui]

Example:

r.pi.corr.mw input1=name input2=name output=name size=integer max=integer

grass.script.run_command("r.pi.corr.mw", input1, input2, output, size, max, title=None, overwrite=False, verbose=False, quiet=False, superquiet=False)

Example:

gs.run_command("r.pi.corr.mw", input1="name", input2="name", output="name", size=integer, max=integer)

Parameters

input1=name [required]
    Name of input raster map
input2=name [required]
    Name of input raster map
output=name [required]
    Name for output raster map
size=integer [required]
    Neighborhood size
    Allowed values: 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25
max=integer [required]
    In order to receive more information of the decimal places, set it to e.g. 1000
title="phrase"
    Title for resultant raster map
--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

input1 : str, required
    Name of input raster map
    Used as: input, raster, name
input2 : str, required
    Name of input raster map
    Used as: input, raster, name
output : str, required
    Name for output raster map
    Used as: output, raster, name
size : int, required
    Neighborhood size
    Allowed values: 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25
max : int, required
    In order to receive more information of the decimal places, set it to e.g. 1000
title : str, optional
    Title for resultant raster map
    Used as: "phrase"
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

r.pi.corr.mw provides information concerning the correlation of pixels inside a moving window between two raster files.

It calculates correlation of two raster maps by calculating correlation function of two corresponding rectangular areas for each raster point and writing the result into a new raster map.

NOTES

This module computes the correlation between two raster files but unlike r.pi.lm for moving windows of a specific size. This module is partly based on r.neighbors and r.covar.

EXAMPLE

An example for the North Carolina sample dataset: Correlation of all pixels within a 7x7 sized window of two rasters (elevation and slope). The output is multiplied by 10000 for higher precision

g.region rast=elevation -p
r.pi.corr.mw input1=slope input2=elevation output=corrwin1 size=7 max=10000
r.colors corrwin1 col=bgyr

SEE ALSO

r.pi.index, r.pi.lm, 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.corr.mw source code (history)
Latest change: Thursday Feb 20 13:02:26 2025 in commit 53de819