getSunlightTimes: Get Sunlight times

View source: R/getSunlightTimes.R

getSunlightTimesR Documentation

Get Sunlight times

Description

Get Sunlight times

Usage

getSunlightTimes(
  date = NULL,
  lat = NULL,
  lon = NULL,
  data = NULL,
  keep = c("solarNoon", "nadir", "sunrise", "sunset", "sunriseEnd", "sunsetStart",
    "dawn", "dusk", "nauticalDawn", "nauticalDusk", "nightEnd", "night", "goldenHourEnd",
    "goldenHour"),
  tz = "UTC"
)

Arguments

date

: Date. Single or multiple Date. YYYY-MM-DD

lat

: numeric. Single latitude

lon

: numeric. Single longitude

data

: data.frame. Alternative to use date, lat, lon for passing multiple coordinates

keep

: character. Vector of variables to keep. See Details

tz

: character. Timezone of results

Details

Available variables are :

  • "sunrise" : sunrise (top edge of the sun appears on the horizon)

  • "sunriseEnd" : sunrise ends (bottom edge of the sun touches the horizon)

  • "goldenHourEnd" : morning golden hour (soft light, best time for photography) ends

  • "solarNoon" : solar noon (sun is in the highest position)

  • "goldenHour" : evening golden hour starts

  • "sunsetStart" : sunset starts (bottom edge of the sun touches the horizon)

  • "sunset" : sunset (sun disappears below the horizon, evening civil twilight starts)

  • "dusk" : dusk (evening nautical twilight starts)

  • "nauticalDusk" : nautical dusk (evening astronomical twilight starts)

  • "night" : night starts (dark enough for astronomical observations)

  • "nadir" : nadir (darkest moment of the night, sun is in the lowest position)

  • "nightEnd" : night ends (morning astronomical twilight starts)

  • "nauticalDawn" : nautical dawn (morning nautical twilight starts)

  • "dawn" : dawn (morning nautical twilight ends, morning civil twilight starts)

Value

data.frame

See Also

getSunlightTimes, getMoonTimes, getMoonIllumination, getMoonPosition,getSunlightPosition

Examples


# one date
getSunlightTimes(date = Sys.Date(), lat = 50.1, lon = 1.83, tz = "CET")

# multiple date + subset
getSunlightTimes(date = seq.Date(Sys.Date()-9, Sys.Date(), by = 1), 
  keep = c("sunrise", "sunriseEnd", "sunset", "sunsetStart"), 
  lat = 50.1, lon = 1.83, tz = "CET")
  
# multiple coordinates
data <- data.frame(date = seq.Date(Sys.Date()-9, Sys.Date(), by = 1), 
    lat = c(rep(50.1, 10), rep(49, 10)), 
    lon = c(rep(1.83, 10), rep(2, 10)))
    
getSunlightTimes(data = data, 
  keep = c("sunrise", "sunriseEnd", "sunset", "sunsetStart"), tz = "CET")
      

suncalc documentation built on Sept. 29, 2022, 5:11 p.m.