seasonal: Uni-modal seasonality

Description Usage Arguments Value Note Author(s) Examples

Description

Approximation of seasonal variation by a (possibly asymmetric) sine function

Usage

1
seasonal(daynum, day1, day2, y1, y2)

Arguments

daynum

Day of the year (value in range 1:366). Can be a vector.

day1

First day with fixed value, scalar.

day2

Second day with fixed value, scalar. Must be > day1.

y1

Value at day1, scalar.

y2

Value at day2, scalar.

Value

Numeric vector of the same length as daynum.

Note

A year is assumed to consist of 365 days. The result for day 366 is the same as for day 365. See the example for how this function can be used with values of class POSIXct.

Author(s)

David Kneis david.kneis@tu-dresden.de

Examples

1
2
3
4
5
# Lake temperature: min. of 3 degree C at day 20, max. 23 degree C at day 210
times= seq(from=ISOdatetime(2000,1,1,0,0,0),
  to=ISOdatetime(2002,1,1,0,0,0), by=3600)
dayofyear= as.integer(format(times, "%j"))
plot(times, seasonal(dayofyear, 20, 210, 3, 23), type="l", ylab="Temperature")

dkneis/diatools documentation built on May 15, 2019, 9:12 a.m.