si | R Documentation |
Function to compute the seasonality index defined by Walsh and Lawler (1981) to classify the precipitation regime.
si(x, na.rm=TRUE, from=start(x), to=end(x), date.fmt="%Y-%m-%d", start.month=1)
x |
zoo object with daily or subdaily precipitation data. |
na.rm |
Logical. Should missing values be removed? |
from |
OPTIONAL, used for extracting a subset of values. |
to |
OPTIONAL, used for extracting a subset of values. |
date.fmt |
Character indicating the format in which the dates are stored in dates, from and to. See |
start.month |
[OPTIONAL]. Only used when the (hydrological) year of interest is different from the calendar year. numeric in [1:12] indicating the starting month of the (hydrological) year. Numeric values in [1, 12] represents months in [January, December]. By default |
The seasonality index is computed as following:
si = (1/R) *sum(i=1, i=12, abs(xi - R/12) )
where:
-) xi: mean monthly precipitation for month i
-) R: mean annual precipitation
This index can theoretically vary from 0 (when all months have the same rainfall) to 1.83 (when all the rainfall ocurrs in a single month).
A qualitative classification of degrees of seasonality is the following:
——————————————————–
si values | Rainfall regime
——————————————————–
<= 0.19 | Very equable
0.20 - 0.39 | Equable but with a definite wetter season
0.40 - 0.59 | Rather seasonal with a short drier season
0.60 - 0.79 | Seasonal
0.80 - 0.99 | Markedly seasonal with a long drier season
1.00 - 1.19 | Most rain in 3 months or less
>= 1.20 | Extreme, almost all rain in 1-2 months
numeric with the seasonality index
Mauricio Zambrano-Bigiarini, mzb.devel@gmail
Walsh, R. and Lawler, D. (1981). Rainfall seasonality: Description, spatial patterns and change through time (British Isles, Africa). Weather, 36(7), 201-208. doi:10.1002/j.1477-8696.1981.tb05400.x.
subdaily2daily
############################
## Ex 1: Seasonality index for a rain gauge with equable precipitation ,
## but with a definite wetter season
## Loading daily precipitation data at the station San Martino di Castrozza,
## Trento Province, Italy, from 01/Jan/1921 to 31/Dec/1990.
data(SanMartinoPPts)
x <- SanMartinoPPts
## Amount of years in 'x' (needed for computations)
( nyears <- yip(from=start(x), to=end(x), out.type="nmbr" ) )
## Boxplot of monthly values, to look at the seasonal cycle
## Daily to Monthly
m <- daily2monthly(x, FUN=sum, na.rm=TRUE)
## Mean monthly values at the station
monthlyfunction(m, FUN=sum, na.rm=TRUE) / nyears
## Vector with the three-letter abbreviations of the month names
cmonth <- format(time(m), "%b")
## Creating ordered monthly factors
months <- factor(cmonth, levels=unique(cmonth), ordered=TRUE)
## Boxplot of the monthly values of precipitation
boxplot( coredata(m) ~ months, col="lightblue",
main="Monthly precipitation, [mm]", ylab="P, [mm]")
# computing seasonality index
( si(x) )
############################
## Ex 2: Seasonality index for a rain gauge with markedly seasonal regime
## with a long dry season
## Loading daily precipitation data at the station Cauquenes en El Arrayan,
## Maule Region, Chile, from 01/Jan/1979 to 31/Dec/2020.
data(Cauquenes7336001)
x <- Cauquenes7336001[, 1] # P is the first column
## Boxplot of monthly values, to look at the seasonal cycle
## Daily to Monthly
m <- daily2monthly(x, FUN=sum, na.rm=TRUE)
## Mean monthly values at the station
monthlyfunction(m, FUN=sum, na.rm=TRUE) / nyears
## Vector with the three-letter abbreviations of the month names
cmonth <- format(time(m), "%b")
## Creating ordered monthly factors
months <- factor(cmonth, levels=unique(cmonth), ordered=TRUE)
## Boxplot of the monthly values of precipitation
boxplot( coredata(m) ~ months, col="lightblue",
main="Monthly precipitation, [mm]", ylab="P, [mm]")
# computing seasonality index
( si(x) )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.