findTwilights: Search for twilight times

View source: R/TwGeos.R

findTwilightsR Documentation

Search for twilight times

Description

Search for pairs of twilights spanning night.

Usage

findTwilights(tagdata, threshold, include, exclude = NULL, extend = 0,
  dark.min = 0)

Arguments

tagdata

a dataframe with columns Date and Light that are the sequence of sample times (as POSIXct) and light levels recorded by the tag.

threshold

the light threshold that defines twilight.

include

a vector of times as POSIXct. Nights that span these times are included in the search.

exclude

a vector of POSIXct times. Nights that span these times are excluded from the search.

extend

a time in minutes. The function seeks periods of darkness that differ from one another by 24 hours plus or minus this interval.

dark.min

a time in minutes. Periods of darkness shorter than this interval will be excluded.

Details

Search for sunset, sunrise pairs that correspond to a given light threshold.

Given a set of times (include) known to fall in the night, findTwilights determines the twilights that span these times, and computes the corresponding midnights. It then searches for periods of darkness that lie approximately 24 hours from these midnights, repeating the process until no new twilight pairs are found.

If interleave=TRUE, the sunrise and sunset times are interleaved andreturned as a single sequence of twilights, otherwise sunset and sunrise times are returned separately. The function interleave.twilights takes a dataframe of separate sunset and sunrise times and interleaves them to form a sequence of twilight times.

Value

A dataframe with columns

Twilight

times of twilight

Rise

logical indicating sunrise

where each row corresponds to a single twilight.


slisovski/TwGeos documentation built on Jan. 27, 2024, 10:43 a.m.