get_sun_position: Extract sun position at given location in specific date and...

Description Usage Arguments Value

View source: R/get_sun_position.R

Description

The function is a wrapper around getSunlightPosition function. It performs several validy checks on inputs to ensure that they are logically valid. It also allows specification of time as and as an solar event.

Usage

1
2
3
4
5
6
7
get_sun_position(
  date = lubridate::ymd(Sys.Date()),
  time = "noon",
  tzone = "UTC",
  lat,
  lon
)

Arguments

date

Date specified as character in form YYYY-MM-DD. Default value is Sys.Date.

time

Either character representation of time (in format HH:MM:SS), or hms class, or one of text values: "noon", "sunrise", "sunset", "goldenHour", "goldenHourEnd". The textual representation is used to determine sun elevation using function getSunlightPosition. Value "sunrise" represents end of sunrise, while "sunset" represents start of sunset. Default value is "noon".

tzone

a character string that specifies which time zone to parse the date with. The string must be a time zone that is recognized by the user's OS. If no time zone is given the default value "UTC" is used. Default value "UTC".

lat

latitude of the location. Numeric from range -90,90. Positive values are north of the Equator.

lon

longtitude of the location. Numeric from range -180,180. Positive values are east of the central meridian.

Value

data.frame with one row and two columns sun_azimuth and sun_elevation indicating sun position on the sky. Both values are in degrees. Sun azimuth value 0 is pointing towards North and in rises clockwise direction. Sun elevation 0 means that sun is exactly on the horizon, value 90 means that sun is exactly az zenith.


JanCaha/rasterShade documentation built on Dec. 16, 2019, 3:46 p.m.