ts2daytime: Calculate solar elevation or daytime.

View source: R/ts2daytime.R

ts2daytimeR Documentation

Calculate solar elevation or daytime.

Description

ts2daytime calculates solar elevation or daytime for a given timestamp and location on earth.

Usage

ts2daytime(long, lat, ts, dawn_degree = 12, type = "daytime")

Arguments

long

A vector with longitude coordinates in WGS84.

ts

A vector with timestamps in POSIXct.

dawn_degree

A integer defining sun elevation below the horizon at start of dawn and end of dusk (12 refers to a sun elevation of -12 degree)

type

Either "daytime" or "elevation".

long

A vector with latitude coordinates in WGS84.

Value

A vector with daytimes ("night", "dawn", "day", "dusk") when type = "daytime" or a vector with sun elevation in degrees when type = "elevation".

Examples

 ts2daytime(lon = 7.82,
             lat = 48.00,
             ts = as.POSIXct("2017-01-01 12:00:00"),
             type = "daytime",
             dawn_degree = 12)


maxkroeschel/activitytools documentation built on July 31, 2023, 1:34 p.m.