PecanProject / pecan

The Predictive Ecosystem Analyzer (PEcAn) is an integrated ecological bioinformatics toolbox.

Home Page:www.pecanproject.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Broken link and missing documentation for `cos_solar_zenith_angle()`

Aariq opened this issue · comments

Bug Description

The documentation for cos_solar_zenith_angle(), an exported function in PEcAn.data.atmosphere has only a 1 sentence description that points the user to what is now a spam gambling website. The arguments are not well explained and there is no example. For example, I don't understand what the difference between dt (Timestep) and hr (Hours timestep) is.

Expected behavior

Use the @references roxygen2 tag to add a reference
Use @examples to add examples (required by CRAN I think)

OR make this a non-exported, internal function.

can you assign me this?

This issue is stale because it has been open 365 days with no activity.

I see the issue is still open and still requires attention. i wanted to proceed with this and fix it and would propose the following changes for now :

#' 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.
#'
#' @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) {
  # Function implementation (remains the same)
}

Any recommendation @Aariq ?
We can also proceed with adding documentations for other similar functions too which have low descriptions.

I'm not an expert at this kind of thing, but the documentation is clear to me

@Sweetdevil144 I agree, that looks clear. Feel free to submit a PR