climdex.cloud.CC98: Quantile of lengths of spells op threshold

View source: R/cloud_ind_MCH.R

climdex.cloud.CC98R Documentation

Quantile of lengths of spells op threshold

Description

This function was originally written to calculate the 98th quantile of the lenghts of sunny/cloudy spells per season. However, any quantile can be chosen. The center of the spell determines to which date.factor the spell is counted to and theoretically, spells can last longer than the duration of a date.factor.

Usage

climdex.cloud.CC98(ci, threshold, op, q)

Arguments

ci

Object of type climdexInput.

op

Operator that compares cloud.okta with threshold.

q

Quantile that should be calculated.

thresh

Threshold value

Value

for each date.factor the quantile of the spell lenghts op threshold

Examples

# example date.series
date.series <- seq(as.POSIXct("2017/01/01", tz="UTC"), as.POSIXct("2017/12/31", tz = "UTC"), by = "day")

# example cloud.okta
sam <- rep(c(runif(300,0,3),runif(10,3,6), runif(500,6,8)), 1000)
cloud.okta <- sample(sam,length(date.series))

# climdexInput object
ci <- climind::climdexInput.raw(cloud = cloud.okta,
                                     cloud.dates = PCICt::as.PCICt.POSIXct(date.series, cal="gregorian"))

# CC98 Index
CC98.2 <- climdex.cloud.CC98(ci = ci, threshold = 3, op = "<", q = 0.98)
CC98.6 <- climdex.cloud.CC98(ci = ci, threshold = 6, op = ">=", q = 0.98)


ECA-D/climind documentation built on Nov. 26, 2022, 10:20 a.m.