This function creates a new virtual sensor for each locality within myClim data object. The new virtual sensor provides values of GDD (Growing Degree Days) in degees Celsius for each time step in the original timeseries.

mc_calc_gdd(data, sensor, output_prefix = "GDD", t_base = 5, localities = NULL)

Arguments

data

cleaned myClim object see myClim-package

sensor

name of temperature sensor used for GDD calculation e.g. TMS_T3 see names(mc_data_sensors)

output_prefix

name prefix of new GDD sensor (default "GDD" -> "GDD5_TMS_T3") name of output sensor consists of output_prefix and value t_base e.g. GDD5

t_base

base temperature for calculation of GDD (default 5°C)

localities

list of locality_ids for calculation; if NULL then all (default NULL)

Value

The same myClim object as input but with added virtual GDD sensor

Details

Function calculates growing degree days as follows: GDD = max(0;(T - Tbase)) . period(days) The maximum allowed time step length for GDD calculation is one day. Function creates a new virtual sensor with the same time step as input data. For shorter time steps than one day, the GDD value is the contribution of the interval to the growing degree day, assuming constant temperature over this period. Be careful while aggregating growing degree days to longer periods, because only meaningful aggregation function here is sum, but myClim let you apply any aggregation function see mc_agg().

Examples

gdd_data <- mc_calc_gdd(mc_data_example_agg, "TMS_T3", localities = c("A2E32", "A6W79"))
gdd_agg <- mc_agg(gdd_data, list(TMS_T3=c("min", "max"), GDD5="sum"), period="day")