srw: Radial Wavelength Metrics

View source: R/fourier.R

srwR Documentation

Radial Wavelength Metrics

Description

Calculates the dominant radial wavelength, radial wavelength index, and mean half wavelength of the radial Fourier spectrum. See Kedron et al. (2018) for more detailed description.

Usage

srw(x, create_plot = FALSE, option = c(1, 2, 3))

Arguments

x

A raster or matrix.

create_plot

Logical. If TRUE, returns a plot of the amplitude spectrum with lines showing the radii at which Srw, Srwi, and Shw are calculated.

option

Numeric. Code for which output metric(s) to return. 1 = Srw, 2 = Srwi, 3 = Shw.

Value

A vector containing numeric values for the dominant radial wavelength, radial wavelength index, and mean half wavelength.

Examples

# import raster image
data(normforest)
normforest <- terra::unwrap(normforest)

# calculate metrics
srwvals <- srw(normforest)

# extract each value
Srw <- srwvals[1]
Srwi <- srwvals[2]
Shw <- srwvals[3]

geodiv documentation built on Oct. 6, 2023, 1:07 a.m.