spatial_swei: Snow Water Equivalent Index (SWEI)

View source: R/Hydrological_drought.R

spatial_sweiR Documentation

Snow Water Equivalent Index (SWEI)

Description

Snow Water Equivalent Index (SWEI)

Usage

spatial_swei(
  SWE_data,
  scale,
  start_month = NULL,
  end_month = NULL,
  missing_ratio = 0.2,
  ...
)

Arguments

SWE_data

'SpatRaster' object that contains spatially-distributed snow water equivalent data that will be used to calculate the SWEI. This 'SpatRaster' must include the time that corresponds to the dates of the respective layers. They can be set with the function time of the terra package.

scale

Integer value that represents the time scale at which the ESSMI will be computed.

start_month

Optional value that represents the starting point of the period that will be returned from the Index. The idea is not to return periods where SWE is not present. The date should be introduced as '%m-%d'. For example: "02-01". The default is NULL, which indicates that the first layer in the 'SpatRaster' will be used as starting point.

end_month

Optional value that represents the ending point of the period that will be returned from the Index. The idea is not to return periods where SWE is not present. The date should be introduced as '%m-%d'. For example: "02-01". The default is NULL, which indicates that the last layer in the 'SpatRaster' will be used as ending point.

missing_ratio

Ratio of missing data that is acceptable for the computation. Set to 0.2 by default (20%).

...

Additional variables that can be used for the 'density' function.

Value

Spatially-distributed SWEI values.


obaezvil/SpatIndex documentation built on Aug. 9, 2024, 3:42 p.m.