Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Documentation for cos_solar_zenith_angle Function #3276

Merged
merged 4 commits into from
Mar 12, 2024
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 18 additions & 7 deletions modules/data.atmosphere/R/solar_angle.R
Original file line number Diff line number Diff line change
@@ -1,14 +1,25 @@
#' Cosine of solar zenith angle
#' Cosine of Solar Zenith Angle
#'
#' Calculates the cosine of the solar zenith angle based on the given parameters.
#' This angle is crucial in determining the amount of solar radiation reaching a point on Earth.
#'
#' For explanations of formulae, see https://web.archive.org/web/20180307133425/http://www.itacanet.org/the-sun-as-a-source-of-energy/part-3-calculating-solar-angles/
#'
#' @author Alexey Shiklomanov
#' @param doy Day of year
#' @param lat Latitude
#' @param lon Longitude
#' @param dt Timestep
#' @param hr Hours timestep
#' @return `numeric(1)` of cosine of solar zenith angle
#' @param doy Day of year. Integer representing the day of the year (1-365).
#' @param lat Latitude in degrees. Positive for the Northern Hemisphere and negative for the Southern Hemisphere.
#' @param lon Longitude in degrees. Positive for East and negative for West.
#' @param dt Time interval in seconds. Represents the duration over which the measurement is averaged or integrated.
#' @param hr Hour of the day (0-23). Specifies the specific hour for which the calculation is made.
#'
#' @return Numeric value representing the cosine of the solar zenith angle.
#'
#' @references
#' "Understanding Solar Position and Solar Radiation" - RAMMB: [Link](https://rammb.cira.colostate.edu/wmovl/vrl/tutorials/euromet/courses/english/nwp/n5720/n5720005.htm)
#'
#' @examples
#' cos_solar_zenith_angle(doy = 150, lat = 45, lon = -93, dt = 3600, hr = 12)
#'
#' @export
cos_solar_zenith_angle <- function(doy, lat, lon, dt, hr) {
et <- equation_of_time(doy)
Expand Down
Loading