Skip to content

Commit

Permalink
Merge pull request #3276 from Sweetdevil144/develop
Browse files Browse the repository at this point in the history
Update Documentation for cos_solar_zenith_angle Function
  • Loading branch information
mdietze authored Mar 12, 2024
2 parents e4e14ae + dc3d443 commit 13afa6c
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 14 deletions.
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
25 changes: 18 additions & 7 deletions modules/data.atmosphere/man/cos_solar_zenith_angle.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 13afa6c

Please sign in to comment.