plot_sensorimage_twilight: Add sunrise and unset to a sensor image

View source: R/plot_sensorimage_twilight.R

plot_sensorimage_twilightR Documentation

Add sunrise and unset to a sensor image

Description

Add sunrise and unset to a sensor image

Usage

plot_sensorimage_twilight(date, offset, ...)

Arguments

date

Date data in POSIXct format, most commonly PAM_data$acceleration$date

offset

This parameter determines where the center of the graph is. When offset = 0, then midday is at the center of the graph. when offset=12 midnight'

...

Any additional parameters taken by graphics::points which the user may want to use to modify the graphic

Value

a plot

Examples

## Not run: 
data(hoopoe)

# Calculate twilights
twilights <- GeoLight::twilightCalc(hoopoe$light$date, hoopoe$light$obs,
LightThreshold = 2, ask = FALSE)

par(mar=c(4,4,4,2),mfrow=c(1,2), oma= c(0,0,0,8))

# Plot daytime in middle
plot_sensorimage(hoopoe$acceleration$date,
          hoopoe$acceleration$act,
          main = "Day in middle",ploty=FALSE,
          offset=0,
          col=c("black",viridis::cividis(90)),
          cex=1.2, cex.main = 2)
#Add sunrises and sunsets
plot_sensorimage_twilight(twilights$tFirst,
       offset=0,
       col= ifelse(twilights$type == 1,
                   "goldenrod","cornflowerblue"),
       pch=16, cex=0.5)

# Plot nightime in the middle
offset=12
plot_sensorimage(hoopoe$acceleration$date,
          hoopoe$acceleration$act,
          main = "Night in middle",ploty=TRUE,
          offset=offset,
          col=c("black",viridis::cividis(90)),
          cex=1.2, cex.main = 2)

plot_sensorimage_twilight(twilights$tFirst,
       offset=offset,
       col= ifelse(twilights$type == 1,
                   "goldenrod","cornflowerblue"),
       pch=16, cex=0.5)


## End(Not run)


KiranLDA/PAMLr documentation built on March 6, 2023, 1:40 p.m.