View source: R/stk_screen_twl.R
| stk_screen_twl | R Documentation |
Removes poor quality data based on twilight heuristics. Allows for quick screening of data containing "false" twilight values.
stk_screen_twl(df, threshold = 1.5, dips = 3, step = 100, filter = TRUE)
df |
A skytrackr data frame. |
threshold |
A twilight threshold (default = 1.5). |
dips |
The allowed number of interruptions during a daylight profile below the twilight threshold before flagging as a poor quality "suspect" day. |
step |
A threshold of the allowed step change in illuminance values between the twilight value and the preceding one. Large jumps and the lack of a smooth transition suggest a false twilight (bird leaving a dark nest site long after or long before dawn or dusk). |
filter |
Logical if to return data pre-filtered, removing all poor quality days or false twilight ones (default = TRUE) |
A skytrackr data frame with poor twilight quality days removed and dusk and dawn timings marked (data is returned as a long format, not a wide format).
# set demo values artificially low as a demonstration
library(dplyr)
df <- cc876 |>
mutate(
value = ifelse(
date_time > "2021-08-15 05:00:00" & date_time < "2021-08-15 12:00:00",
0.1,
value)
)
# screen values and remove them (filter = TRUE)
df <- df |> stk_screen_twl(filter = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.