filter_vpts: Filter a time series of vertical profiles ('vpts') by a start...

View source: R/filter_vpts.R

filter_vptsR Documentation

Filter a time series of vertical profiles ('vpts') by a start and end time. Use argument night = TRUE to select only time stamps between sunset and sunrise, or night = FALSE to select daytime (sunrise to sunset). Selection for night and day uses check_night().

Description

Filter a time series of vertical profiles ('vpts') by a start and end time. Use argument night = TRUE to select only time stamps between sunset and sunrise, or night = FALSE to select daytime (sunrise to sunset). Selection for night and day uses check_night().

Usage

filter_vpts(x, min, max, nearest, night, elev = -0.268, offset = 0)

Arguments

x

A vpts object.

min

POSIXct date or character. Minimum datetime to be included.

max

POSIXct date or character. Datetime up to this maximum included.

nearest

POSIXct date or character. If specified, min and max are ignored and the profile (vp) nearest to the specified datetime is returned that matches the day/night selection criteria.

night

When TRUE selects only nighttime profiles, when FALSE selects only daytime profiles, as classified by check_night().

elev

Numeric (vector). Sun elevation in degrees defining nighttime. May also be a numeric vector of length two, with first element giving sunset elevation, and second element sunrise elevation.

offset

Numeric (vector). Time duration in seconds by which to shift the start and end of nighttime. May also be a numeric vector of length two, with first element added to moment of sunset and second element added to moment of sunrise. See check_night() for details.

Details

Returns profiles for which min <= timestamp profile < max. Selection for night and day occurs by check_night.

Value

A vpts object, or a vp object when nearest is specified.

See Also

  • summary.vpts()

  • check_night()

Examples

# Select profiles later than 02 Sep 2016

# Select the profile nearest to 2016-09-01 03:00 UTC
filter_vpts(example_vpts, nearest = "2016-09-01 03:00")

# Select profiles between than 01:00 and 03:00 UTC on 02 Sep 2016
filter_vpts(example_vpts, min = "2016-09-02 01:00", max = "2016-09-02 03:00")

# Select daytime profiles (i.e. profiles between sunrise and sunset)
filter_vpts(example_vpts, night = FALSE)

# Select nighttime profiles, with nights starting and ending at
# civil twilight (when the sun is 6 degrees below the horizon)
filter_vpts(example_vpts, night = TRUE, elev = -6)

# Select nighttime profiles from 3h after sunset to 2h before sunrise
filter_vpts(example_vpts, night = TRUE, offset = c(3, -2)*3600)


bioRad documentation built on Oct. 20, 2023, 5:06 p.m.