Learn R Programming

GeoLight (version 2.0.0)

twilightCalc: Calculate twilight events (sunrise/sunset) from light intensity measurements over time

Description

Defines twilight events (sunrise/sunset) at times when the light intensity measurements (light) pass the defined light intensity threshold. An interactive plot can be drawn to assess the calculations and improve e.g. select only the realistic events.

Usage

twilightCalc(datetime, light, LightThreshold = TRUE, preSelection = TRUE, maxLight = NULL, ask = TRUE, nsee = 500, allTwilights = FALSE)

Arguments

datetime
date and time of light intensity measurements e.g. 2008-12-01 08:30 "UTC" (see: as.POSIXct,time zones).
light
numerical value of the light intensity (usually arbitrary units).
LightThreshold
the light intensity threshold for the twilight event calibration. If Default, it will be set slightly above (3 units) the baseline level (measurement during the night).
preSelection
codelogical, if TRUE a pre selection of all calculated twiligth events will be offered within the interactive process (ask=TRUE).
maxLight
if the geolocator record the maximum light value of a certain time span, give the interval of maximum recordings in minutes (e.g. 5).
ask
logical, if TRUE the interactive plot will start after the calculation.
nsee
number of points to plot per screen.
allTwilights
logical, if TRUE the function returns a list with two tables

Value

if allTwilights=FALSE, a data frame. Each row contains two subsequent twilight events (tFirst, tSecond) and type defining wether tFirst refers to sunrise (1) or sunset (2). If allTwilights=TRUE, a list with the data frame described in the previous sentence and a data frame with all light intensities and a column describing whether each row refers to sunrise (1), sunset (2) or to none of these categories (0).