Skip to content

Commit

Permalink
rename sunset_angle
Browse files Browse the repository at this point in the history
  • Loading branch information
kongdd committed Dec 25, 2023
1 parent 5f8d238 commit deb209a
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
fail-fast: false
matrix:
config:
- {os: macos-latest, r: 'release'}
# - {os: macos-latest, r: 'release'}
- {os: windows-latest, r: 'release'}
# - {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
- {os: ubuntu-latest, r: 'release'}
Expand Down
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ export(cal_radiation_Ta)
export(cal_rho_a)
export(cal_slope)
export(cal_ssd)
export(cal_sunset_angle)
export(cal_ws)
export(calib_routing_muskingum_nL)
export(celsius.to.fahrenheit)
Expand Down
2 changes: 1 addition & 1 deletion R/cal_radiation.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ cal_Rsi_toa <- function(lat, J) {
dr <- 1 + 0.033 * cos(pi * J / 182.5) # Allen, Eq. 23
sigma <- 0.409 * sin(pi * J / 182.5 - 1.39) # Allen, Eq. 24

ws <- cal_ws(lat, J)
ws <- cal_sunset_angle(lat, J)
# 24 * 60 * 0.082 = 118.08
lat %<>% deg2rad()
Rsi_toa <- 118.08 * dr / pi * (ws * sin(lat) * sin(sigma) + cos(lat) * cos(sigma) * sin(ws)) # Allen, Eq. 21
Expand Down
6 changes: 3 additions & 3 deletions R/cal_sun_angle.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ NULL

#' @rdname cal_ssd
#' @export
cal_ws <- function(lat, J) {
cal_sunset_angle <- function(lat, J) {
lat %<>% deg2rad()
sigma <- 0.409 * sin(pi * J / 182.5 - 1.39) # Allen, Eq. 24

Expand All @@ -25,7 +25,7 @@ ws2ssd <- function(ws) ws / pi * 24 # Ge ChaoXiao, Eq. 2-18

#' @rdname cal_ssd
#' @export
cal_ssd <- function(lat, J) cal_ws(lat, J) %>% ws2ssd()
cal_ssd <- function(lat, J) cal_sunset_angle(lat, J) %>% ws2ssd()

# ------------------------------------------------------------------------------

Expand Down Expand Up @@ -123,7 +123,7 @@ suncalc <- function(time, lon = 114.6053, lat = 30.49694, ...,
angle_elev <- SunAngle_Elevation(lat, angle_sigma, omega)
angle_azimuth <- SunAngle_Azimuth(lat, angle_sigma, omega)

ws <- cal_ws(lat, yday(time))
ws <- cal_sunset_angle(lat, yday(time))
ssd <- ws2ssd(ws)
time_begin <- time_noon - dhours(ssd / 2)
time_end <- time_noon + dhours(ssd / 2)
Expand Down
4 changes: 2 additions & 2 deletions man/cal_ssd.Rd

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

2 changes: 1 addition & 1 deletion man/vapour_press.Rd

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

0 comments on commit deb209a

Please sign in to comment.