Learn R Programming

climdex.pcic (version 0.7-2)

climdexInput: climdexInput

Description

The climdexInput class contains all the data necessary to compute the climdex indices.

Arguments

Details

The climdexInput class consists of all the data necessary to compute the climdex indices. Users will not need to modify any of the slots in this class. That being said, users may want or need to repurpose this data for further analysis. The following description of the data is aimed at that audience. The tmax, tmin, tavg, and prec slots are time series of daily data of equal length and without any missing days, with NAs in place of data where no data was present. The dates slot is the corresponding series of dates (of type PCICt) for the daily data. To ease computation of monthly and annual data, monthly.factor and annual.factor are slots in the data structure. They are also of the same length as the time series. These can be reused for computation of any annual or monthly aggregates. The climdexInput class also includes NA masks for both monthly (namask.mon) and annual (namask.ann) data. These masks consist of a vector of numbers of the same length as the monthly or annual output data. The values used are 1 to signify that the data meets the QC criteria, and NA to signify it does not. Years with more than 15 days missing, and months with more than 3 days missing, are considered to be of poor quality and are masked here with NA. The base.range slot contains vector of type PCICt containing the first and last day included in the baseline. The northern.hemisphere slot contains a boolean indicating whether the data came from the northern hemisphere. If FALSE, data is assumed to have come from the southern hemisphere. This is used when computing growing season length; if the data is from the southern hemisphere, growing season length is the growing season starting in the beginning of July of the year indicated, running to the end of June of the following year. The pctile slot contains the 95th and 99th percentile values for the precipitation percentiles, computed on the base period. The running.pctile.notbase slot contains the data necessary for computing temperature based percentiles outside of the base period. This consists of one percentile for each day of the year, computed using an n-day (default is 5-day) running window surrounding that day. These percentiles are computed for both the 10th and 90th percentile for daily maximum and minimum temperature. The running.pctile.base slot contains the data necessary for computing temperature based percentiles inside the base period. As this is a somewhat unpleasant operation, so are the data requirements. Given n years of data to use as the base period, there are n * (n - 1) sets of daily quantiles of the same type as those for running.pctile.notbase.

See Also

climdexInput.csv, climdexInput.raw.

Examples

Run this code
## Parse the dates into PCICt.
tmax.dates <- as.PCICt(do.call(paste, ec.1018935.tmax[,c("year",
"jday")]), format="%Y %j", cal="gregorian")
tmin.dates <- as.PCICt(do.call(paste, ec.1018935.tmin[,c("year",
"jday")]), format="%Y %j", cal="gregorian")
prec.dates <- as.PCICt(do.call(paste, ec.1018935.prec[,c("year",
"jday")]), format="%Y %j", cal="gregorian")

## Load the data in.
ci <- climdexInput.raw(ec.1018935.tmax$MAX_TEMP,
ec.1018935.tmin$MIN_TEMP, ec.1018935.prec$ONE_DAY_PRECIPITATION,
tmax.dates, tmin.dates, prec.dates, base.range=c(1971, 2000))

Run the code above in your browser using DataLab