pick: Choose twilight segments interactively from light data.

View source: R/picksegs.R

pickR Documentation

Choose twilight segments interactively from light data.

Description

pick plots up series of light data agains record ID, allowing the user to click on the beginnings and ends of twilight in sequence. picksegs generates a vector of segment IDs for each record.

Usage

pick(id, val, nsee = 10000)

picksegs(twind, n)

Arguments

id

index vector to identify records

val

sequence of data (light levels) to choose segments from

nsee

number of points to plot per screen

twind

vector of index pairs generated by pick

n

Number of segments values required - length of record

Value

pick returns a vector where each value (obtained using locator is the x coordinate for the begin or end of a twilight.

picksegs uses these paired indexes to return a vector of segment IDs, with NAs for non-twilight periods.

Warning

Segments are expected to be chosen as non-overlapping.

Note

It seems best to choose more of the light data than less, using the ekstrom keyword to solar.model we can limit the solar elevation used.

Author(s)

Michael D. Sumner

Examples

 d <- sin(seq(0, 10, by = 0.01))
 id <- 1:length(d)
 ## choose a series of start-begin pairs
 if (interactive()) {
 pk <- pick(id, d, 1000)
 ## your start/ends should be marked as blue versus red
 plot(id, d, col = c("red", "blue")[is.na(picksegs(pk, 1000))+1])
 }

tripEstimation documentation built on April 22, 2023, 1:11 a.m.