twilightCalc: Calculate twilight events (sunrise/sunset) from light...

twilightCalcR Documentation

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).

Note

Depending on shading during light intensity measurements (e.g. due to vegetation, weather, etc., see Lisovski et al. 2012) the light intensities may pass the light intensity threshold several times during the day, resulting false sunrises and sunsets. It is highly recommended to check the derived events visually (ask=TRUE).Twilight events can be deleted and undeleted by clicking the (first) mouse button at the particular position in the graph. The second mouse buttom (or esc) moves the time series forward. Note, that a backward option is not included.

Author(s)

Simeon Lisovski


slisovski/GeoLight documentation built on June 5, 2024, 4:24 p.m.