climdex.cloud.CCge4: Fraction of days which are within periods of at least n+1...

View source: R/cloud_ind_MCH.R

climdex.cloud.CCge4R Documentation

Fraction of days which are within periods of at least n+1 consecutive day periods op threshold

Description

This function was originally written to calculate CCge4; the fraction of sunny/cloudy days which are within at least 4 consecutive day periods. Sunny days were defined as daily average cloud covers < 3 okta and cloudy days as daily average cloud covers >= 6 okta.

Usage

climdex.cloud.CCge4(ci, freq, threshold, op, n)

Arguments

ci

Object of type climdexInput.

freq

Time frequency/period to aggregate to.

op

Operator that compares cloud.okta with threshold.

n

Maximum number of spell lenghts that should be skipped.

thresh

Threshold value

Value

for each date.factor the fraction of days which are whithin at least n+1 consecutive days which are 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"))

# CCge4 Index
CCge4.2 <- climdex.cloud.CCge4(ci = ci, freq = "seasonal", threshold = 3, op = "<", n = 3)
CCge4.6 <- climdex.cloud.CCge4(ci = ci, freq = "seasonal", threshold = 6, op = ">=", n = 3)


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