Solar position
solar_position(
x,
UTC = "UTC",
yday = "yday",
hour = "hour",
lon = "lon",
lat = "lat",
integral_steps = 1,
keep.all = TRUE,
verbose = getOption("merra2.verbose"),
...
)
data.frame with MERRA-2 subset
name (string) of the column in x with date and time in UTC format
optional name of column in x with the day of the year (consistent with UTC time), will be used if "UTC" is not provided
optional, the name of column with hour of the day (0 to 23, UTC time assumed)
longitude of the location
latitude of the location
integer number of steps for calculation of solar_time, hour_angle, and zenith within an hour, and the logical variable; default is 2 (start and the end of every hour)
if TRUE, the interim variables declination, eq_time, solar_time, and hour_angle will be added to x and returned
List or data.frame with estimated following solar geometry variables:
Solar declination (\(\theta_d\)) \[\theta_d = \frac{23.45\pi}{180}\sin{\big(2\pi\frac{284+n}{365}\big)}\]
Equation of time (\(E_{qt}\)) \[ E_{qt} = \begin{cases} -14.2\sin{\big(\frac{\pi(n+7)}{111}\big)}& & {1 \leq n \leq 106}\newline 4.0\sin{\big(\frac{\pi(n-106)}{59}\big)}& & {107 \leq n \leq 166}\newline -6.5\sin{\big(\frac{\pi(n-166)}{80}\big)}& & {167 \leq n \leq 246}\newline 16.4\sin{\big(\frac{\pi(n-247)}{113}\big)}& & {247 \leq n \leq 365} \end{cases} \]
Apparent solar time (\(T_{solar}\)) \[T_{solar} = T_{UTC}+\frac{E_{qt}}{60}+longitude/15\]
Hour angle (\(\theta_{hr}\)) \[\theta_{hr} = \frac{T_{solar}-12}{12}\pi\]
Zenith angle \[zenith = \arccos\big({\sin{(latitude)}\sin{(\theta_d)}+\cos{(latitude)}\cos{(\theta_d)}\cos{(\theta_{hr})}\big)}\]
Azimuth angle
\[
azimuth = \begin{cases}
\arcsin{(A)}& & {A \geq 0, B \geq 0}\newline
180-\arcsin{(A)}& & {B < 0}\newline
360+\arcsin{(A)}& & {A < 0, B \geq 0}
\end{cases}
\]
where
\(n - \text{day of the year}\)
\(A = \sin{(azimuth)} =
-\frac{\sin{(\theta_{hr})}\cos{(\theta_d)}}{\sin{(zenith)}}\)
\(B = \cos{(azimuth)} = \frac{\sin{(\theta_d)}-
\sin{(latitude)}\cos{(zenith)}}{\cos{(latitude)}\sin{(zenith)}}\)
NA
#> [1] NA