pecan icon indicating copy to clipboard operation
pecan copied to clipboard

Broken link and missing documentation for `cos_solar_zenith_angle()`

Open Aariq opened this issue 3 years ago • 2 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.

Aariq avatar Jan 09 '23 16:01 Aariq

can you assign me this?

deep-poharkar avatar Feb 05 '23 18:02 deep-poharkar

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

github-actions[bot] avatar Feb 07 '24 00:02 github-actions[bot]

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.

Sweetdevil144 avatar Mar 10 '24 07:03 Sweetdevil144

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

Aariq avatar Mar 11 '24 16:03 Aariq

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

dlebauer avatar Mar 11 '24 18:03 dlebauer