Any of tmin (daily minimum temperature), tmax (daily maximum temperature),
tavg (daily mean temperature), and prec (daily precipitation) can be passed
in. tavg will be derived from the mean of tmax and tmin if it is not
supplied. If any of tmin, tmax, and prec are not supplied, the set of
indices which can be calculated will be limited to indices which do not
involve the missing variables.
For all data supplied, the associated dates must also be supplied.
This function takes input climate data at daily resolution, and produces as
output a ClimdexInput data structure. This data structure can then be passed
to any of the routines used to compute the Climdex indices. The indices
themselves are specified on the webpage cited in the references section.
The base.range
argument is a pair of 4 digit years which bound the
data on which the base percentiles are calculated.
The tmax
, tmin
, and prec
arguments are numeric vectors
containing the data on which the indices are to be computed. The units are
assumed to be degrees C for temperature, and mm/day for precipitation.
The tmax.dates
, tmin.dates
, and prec.dates
arguments
are vectors of type PCICt
.
The n
argument specifies the size of the window used when computing
the percentiles used in climdex.tx10p
,
climdex.tn10p
, climdex.tx90p
, and
climdex.tn90p
.
The northern.hemisphere
argument specifies 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 quantiles
argument allows the user to supply pre-computed quantiles.
This is a list consisting of quantiles for each variable.
For each temperature variable, there are separate lists of quantiles for
inbase and outbase, with these names. In both cases, quantiles within these
lists are named q10 for the 10th percentile and q90 for the 90th percentile.
Other percentiles would be named qnn for the nnth percentile. For the
outbase quantiles, each element in the list is a vector of length 365 (or 360
in the case of 360-day calendars), corresponding to one value for each day of
the year. For the inbase quantiles, each element in the list is an array of
dimensions [365 or 360, nyr, nyr - 1], where nyr is the number of years in
the base period. Each value corresponds to a quantile for each day, for each
year, with a particular year replaced.
For precipitation variables, there is a named vector of quantiles, consisting
of at least q95 and q99.
The temp.qtiles
and prec.qtiles
arguments allow the user to
modify the quantiles calculated. For example, specifying
temp.qtiles=c(0.10, 0.50, 0.90) would calculate the 10th, 50th, and 90th
percentiles for temperature.
The min.base.fraction.present
argument specifies the minimum fraction
of data which must be present for a quantile to be calculated for a
particular day. If the fraction of data present is less than this threshold,
the quantile for that day will be set to NA.
The max.missing.days
argument is a vector consisting of 'annual'
(the number of days that can be missing in a year) and 'monthly' (the
number of days that can be missing in a month. If one month in a year fails
the test, the corresponding year will be omitted.