Calculate thermal time using cardinal temperatures

thermalTime(weather, x_temp, y_temp, method = NULL)

Arguments

weather

WeaAna object

x_temp

The cardinal temperatures

y_temp

The effective thermal time

method

The method to calculate thermal time. The default method is ( maxt + mint ) / 2 - base. The three hour temperature methods will be used if method = '3hr'

Value

A data.frame with three columns: year, day and thermalTime.

Examples

met_file <- system.file("extdata/WeatherRecordsDemo1.met", package = "weaana")
records <- readWeatherRecords(met_file)
x_temp <- c(0, 26, 34)
y_temp <- c(0, 26, 0)
res <- thermalTime(records, x_temp, y_temp)
head(res)
#>   year day thermalTime
#> 1 1981   1     19.5500
#> 2 1981   2     20.8000
#> 3 1981   3     23.8875
#> 4 1981   4     22.6500
#> 5 1981   5     25.3000
#> 6 1981   6     24.0000
res <- thermalTime(records, x_temp, y_temp, method = "3hr")
head(res)
#>   year day thermalTime
#> 1 1981   1    19.55000
#> 2 1981   2    17.77214
#> 3 1981   3    14.70688
#> 4 1981   4    21.76661
#> 5 1981   5    21.36310
#> 6 1981   6    19.09683