H.Earth.solar {widals}R Documentation

Solar Radiation

Description

Calculate Incident Solar Area (ISA)

Usage

H.Earth.solar(x, y, dateDate)

Arguments

x

Longitude. Numeric vector of length n.

y

Latitude. Numeric vector of length n.

dateDate

Posix date. Numeric vector of length \tau.

Details

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.

Value

An unnamed list of length \tau, each element of which is an n x 1 matrix.

Examples


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)
  }

[Package widals version 0.6.1 Index]