Description Usage Arguments Details Value Examples
View source: R/H.Earth.solar.R
Calculate Incident Solar Area (ISA)
1 | H.Earth.solar(x, y, dateDate)
|
x |
Longitude. Numeric vector of length n. |
y |
Latitude. Numeric vector of length n. |
dateDate |
Posix date. Numeric vector of length τ. |
This function returns a spacio-temporal covariate list (Earth's ISA is space-time non-seperable). A negative value indicates that at that time (list index), and at that location (matrix row), the sun is below the horizon all day.
An unnamed list of length τ, each element of which is an n x 1 matrix.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | lat <- c(0, -88)
lon <- c(0, 0)
dateDate <- strptime( c('20120621', '20120320'), '%Y%m%d')
H.Earth.solar(lon, lat, dateDate)
## The function is currently defined as
function (x, y, dateDate)
{
Hst.ls <- list()
n <- length(y)
tau <- length(dateDate)
equinox <- strptime("20110320", "%Y%m%d")
for (i in 1:tau) {
this.date <- dateDate[i]
dfe <- as.integer(difftime(this.date, equinox, units = "day"))
dfe
psi <- 23.5 * sin(2 * pi * dfe/365.25)
psi
eta <- 90 - (360/(2 * pi)) * acos(cos(2 * pi * y/360) *
cos(2 * pi * psi/360) + sin(2 * pi * y/360) * sin(2 *
pi * psi/360))
surface.area <- sin(2 * pi * eta/360)
surface.area
Hst.ls[[i]] <- cbind(surface.area)
}
return(Hst.ls)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.