Package 'solrad'

Title: Calculating Solar Radiation and Related Variables Based on Location, Time and Topographical Conditions
Description: For surface energy models and estimation of solar positions and components with varying topography, time and locations. The functions calculate solar top-of-atmosphere, open, diffuse and direct components, atmospheric transmittance and diffuse factors, day length, sunrise and sunset, solar azimuth, zenith, altitude, incidence, and hour angles, earth declination angle, equation of time, and solar constant. Details about the methods and equations are explained in Seyednasrollah, Bijan, Mukesh Kumar, and Timothy E. Link. 'On the role of vegetation density on net snow cover radiation at the forest floor.' Journal of Geophysical Research: Atmospheres 118.15 (2013): 8359-8374, <doi:10.1002/jgrd.50575>.
Authors: Bijan Seyednasrollah
Maintainer: Bijan Seyednasrollah <[email protected]>
License: AGPL-3 | file LICENSE
Version: 1.0.0
Built: 2025-01-06 05:02:54 UTC
Source: https://github.com/bbcrown/solrad

Help Index


Solar Altitude Angle

Description

This function solar altitude angle (in degrees) for a given day of year and location.

Usage

Altitude(DOY, Lat, Lon, SLon, DS)

Arguments

DOY

Day of year

Lat

Latitude in degrees

Lon

Longitude in degrees

SLon

Standard longitude (based on time zone) in degrees

DS

Daylight saving in minutes

Examples

#Calculating solar altitude angle for two consecutive days

DOY <- seq(0, 2, .05)

alpha <- Altitude(DOY, Lat = 45, Lon=0, SLon=0, DS=60)
#Note: only the difference between Lon and SLon matters not each value

plot(DOY, alpha)

Apparent Solar Time

Description

This function returns the apparent solar time (in minutes) for a given day of year and location.

Usage

AST(DOY, Lon, SLon, DS)

Arguments

DOY

Day of year

Lon

Longitude in degrees

SLon

Standard longitude (based on time zone) in degrees

DS

Daylight saving in minutes

Examples

#Calculating apparent solar time for two consecutive days

DOY <- seq(0, 2, .05)

ast <- AST(DOY, Lon=0, SLon=0, DS=60)
#Note: only the difference between Lon and SLon matters not each value

plot(DOY, ast)

Solar Azimuth Angle

Description

This function returns solar azimuth angle (in degrees) for a given day of year and location. The solar azimuth angle is the angle of sun's ray measured in the horizental plane from due south

Usage

Azimuth(DOY, Lat, Lon, SLon, DS)

Arguments

DOY

Day of year

Lat

Latitude (in degrees)

Lon

Longitude in degrees

SLon

Standard longitude (based on time zone) in degrees

DS

Daylight saving in minutes

Examples

#Calculating solar azimuth angle for two consecutive days on 45 degree lat and 10 degree lon

DOY <- seq(0, 2, .05)

Az <- Azimuth(DOY, Lat = 45, Lon=10, SLon=10, DS=0)
#Note: only the difference between Lon and SLon matters not each value

plot(DOY, Az)

Day Length

Description

This function estimates day length (in hours) for a given day of year and latitude.

Usage

DayLength(DOY, Lat)

Arguments

DOY

Day of year

Lat

Latitude (in degrees)

Examples

#Calculating day length for 365 day of the year for 45 degree latitude

DOY <- 1:365

Lat = 45

dl <- DayLength(DOY, Lat)

plot(DOY, dl)

Day of year

Description

This function returns a continuous the day of year value (as integer value 1:365) for a given date-time in "POSIXlt" "POSIXct" format.

Usage

DayOfYear(DateTime)

Arguments

DateTime

DateTime object

Examples

#Calculating day of year for now

DayOfYear(Sys.time())

Declination Angle

Description

This function calculates solar declination angle for a given day of year.

Usage

Declination(DOY)

Arguments

DOY

Day of year

Examples

#Calculating solar declination angle for 365 day of the year

DOY <- 1:365

delta <- Declination(DOY)

plot(DOY, delta)

Solar Diffuse Radiation on a Surface

Description

This function returns solar diffuse dadiation (in W/m2) for a given day of year, location and topography.

Usage

DiffuseRadiation(DOY, Lat, Lon, SLon, DS, Elevation, Slope)

Arguments

DOY

Day of year

Lat

Latitude (in degrees)

Lon

Longitude in degrees

SLon

Standard longitude (based on time zone) in degrees

DS

Daylight saving in minutes

Elevation

Elevation of the site in meters

Slope

Site slope in degrees

Examples

#Calculating atmospheric transmittance coefficient for two consecutive days on 45 degree
# latitude and 10 degree longitude and at 100 m altitude.

DOY <- seq(0, 2, .05)

Sdifopen <- DiffuseRadiation(DOY, Lat = 45, Lon=10, SLon=10, DS=0, Elevation = 100, Slope = 0)
#Note: only the difference between Lon and SLon matters not each value

plot(DOY, Sdifopen)

Atmospheric Diffusion Factor

Description

This function returns atmospheric diffusion factor for a given day of year, location and topography.

Usage

DiffusionFactor(DOY, Lat, Lon, SLon, DS, Elevation)

Arguments

DOY

Day of year

Lat

Latitude (in degrees)

Lon

Longitude in degrees

SLon

Standard longitude (based on time zone) in degrees

DS

Daylight saving in minutes

Elevation

Elevation of the site in meters

Examples

#Calculating atmospheric diffusion factor for two consecutive days on 45 degree
# latitude and 10 degree longitude and at 100 m altitude.

DOY <- seq(0, 2, .05)

td <- DiffusionFactor(DOY, Lat = 45, Lon=10, SLon=10, DS=0, Elevation = 100)
#Note: only the difference between Lon and SLon matters not each value

plot(DOY, td)

Solar Direct Beam Radiation on Surface

Description

This function returns solar open direct beam dadiation (in W/m2) for a given day of year, location and topography.

Usage

DirectRadiation(DOY, Lat, Lon, SLon, DS, Elevation, Slope, Aspect)

Arguments

DOY

Day of year

Lat

Latitude (in degrees)

Lon

Longitude in degrees

SLon

Standard longitude (based on time zone) in degrees

DS

Daylight saving in minutes

Elevation

Elevation of the site in meters

Slope

Site slope in degrees

Aspect

Site aspect with respect to the south in degrees

Examples

#Calculating atmospheric transmittance coefficient for two consecutive days on 45 degree
#latitude and 10 degree longitude and at 100 m altitude.

DOY <- seq(0, 2, .05)

Sopen <- OpenRadiation(DOY, Lat = 45, Lon=10, SLon=10, DS=0, Elevation = 100)
#Note: only the difference between Lon and SLon matters not each value

plot(DOY, Sopen)

Equation of time

Description

This function approximates the value of equation of time for a given day of year

Usage

EOT(DOY)

Arguments

DOY

Day of year

Examples

#Calculating equaiton of time for 365 day of the year

DOY <- 1:365

eot <- EOT(DOY)

plot(DOY, eot)

Solar Extraterrestrial Radiation

Description

This function calculates solar extraterrestrial radiation (in W/m2) for a given day of year.

Usage

Extraterrestrial(DOY)

Arguments

DOY

Day of year

Examples

#Calculating solar extraterrestrial radiation for 365 day of the year

DOY <- 1:365

Sextr <- Extraterrestrial(DOY)

plot(DOY, Sextr)

Normal Extraterrestrial Solar Radiation

Description

This function calculates extraterrestrial solar radiation normal to surface (in W/m2) for a given day of year, location and topogrpahy.

Usage

ExtraterrestrialNormal(DOY, Lat, Lon, SLon, DS, Slope, Aspect)

Arguments

DOY

Day of year

Lat

Latitude (in degrees)

Lon

Longitude in degrees

SLon

Standard longitude (based on time zone) in degrees

DS

Daylight saving in minutes

Slope

Site slope in degrees

Aspect

Site aspect with respect to the south in degrees

Examples

#Calculating solar incidence angle for two consecutive days on 45 degree latitude and
# 10 degree longitude

DOY <- seq(0, 2, .05)

SextrNormal <- ExtraterrestrialNormal(DOY, Lat = 45, Lon=10, SLon=10, DS=0, Slope = 10, Aspect = 0)
#Note: only the difference between Lon and SLon matters not each value

plot(DOY, SextrNormal)

Solar Hour Angle

Description

This function returns solar hour angle for a given day of year, and location.

Usage

HourAngle(DOY, Lon, SLon, DS)

Arguments

DOY

Day of year

Lon

Longitude in degrees

SLon

Standard longitude (based on time zone) in degrees

DS

Daylight saving in minutes

Examples

#Calculating solar hour angle for two consecutive days

DOY <- seq(0, 2, .05)

h <- HourAngle(DOY, Lon=0, SLon=0, DS=60)
#Note: only the difference between Lon and SLon matters not each value

plot(DOY, h)

Solar Incidence Angle

Description

This function returns solar incidence angle (in degrees) for a given day of year and location and site slope and aspect. The solar incidence angle is the angle between sun's ray and the normal on a surface.

Usage

Incidence(DOY, Lat, Lon, SLon, DS, Slope, Aspect)

Arguments

DOY

Day of year

Lat

Latitude (in degrees)

Lon

Longitude in degrees

SLon

Standard longitude (based on time zone) in degrees

DS

Daylight saving in minutes

Slope

Site slope in degrees

Aspect

Site aspect with respect to the south in degrees

Examples

#Calculating solar incidence angle for two consecutive days on 45 degree latitude and
# 10 degree longitude

DOY <- seq(0, 2, .05)

theta <- Incidence(DOY, Lat = 45, Lon=10, SLon=10, DS=0, Slope = 10, Aspect = 0)
#Note: only the difference between Lon and SLon matters not each value

plot(DOY, theta)

Local Standard Time

Description

This function returns local standard time (in minutes) given a day of the year value.

Usage

LST(DOY)

Arguments

DOY

Day of year

Examples

#Calculating  local standard time for two consecutive days

DOY <- seq(0, 2, .05)

lst <- LST(DOY)

plot(DOY, lst)

Open Sky Solar Radiation

Description

This function returns open sky solar radiation (in W/m2) for a given day of year and location.

Usage

OpenRadiation(DOY, Lat, Lon, SLon, DS, Elevation)

Arguments

DOY

Day of year

Lat

Latitude (in degrees)

Lon

Longitude in degrees

SLon

Standard longitude (based on time zone) in degrees

DS

Daylight saving in minutes

Elevation

Elevation of the site in meters

Examples

#Calculating open sky solar radiation for two consecutive days on 45 degree latitude and
# 10 degree longitude and at 100 m altitude.

DOY <- seq(0, 2, .05)

Sopen <- OpenRadiation(DOY, Lat = 45, Lon=10, SLon=10, DS=0, Elevation = 100)
#Note: only the difference between Lon and SLon matters not each value

plot(DOY, Sopen)

Calculating Solar Variables

Description

This function calculates solar variables including radiation components, solar angles and positions and day length.

Usage

Solar(DOY, Lat, Lon, SLon, DS, Elevation, Slope, Aspect)

Arguments

DOY

Day of year

Lat

Latitude (in degrees)

Lon

Longitude in degrees

SLon

Standard longitude (based on time zone) in degrees

DS

Daylight saving in minutes

Elevation

Elevation of the site in meters

Slope

Site slope in degrees

Aspect

Site aspect with respect to the south in degrees

Examples

#Calculating solar variables and angles

DOY <- seq(0, 2, .05)

solar <- Solar(DOY, Lat = 45, Lon=10, SLon=10, DS=0, Elevation = 1000, Slope = 10, Aspect = 0)
#Note: only the difference between Lon and SLon matters not each value

par(mfrow=c(3,1))
plot(DOY, solar$Altitude, ylim = c(-90,90))
plot(DOY, solar$Azimuth, col= 'red')

plot(DOY, solar$Sdiropen)
lines(DOY, solar$Sdifopen, col='red')

Solar Constant

Description

This constant value returns solar constant in Watt per meter squared

Usage

SolarConstant

Format

An object of class numeric of length 1.

Examples

#Printing Solar Constant

print(SolarConstant)

Sunrise Time

Description

This function estimates sunrise time (in continuous hour values) for a given day of year and latitude.

Usage

Sunrise(DOY, Lat)

Arguments

DOY

Day of year

Lat

Latitude (in degrees)

Examples

#Calculating sunrise time for 365 day of the year for 45 degree latitude

DOY <- 1:365

Lat = 45

sunrise <- Sunset(DOY, Lat)

plot(DOY, sunrise)

Sunset Time

Description

This function estimates sunset time (in continuous hour values) for a given day of year and latitude.

Usage

Sunset(DOY, Lat)

Arguments

DOY

Day of year

Lat

Latitude (in degrees)

Examples

#Calculating sunset time for 365 day of the year for 45 degree latitude

DOY <- 1:365

Lat = 45

sunset <- Sunset(DOY, Lat)

plot(DOY, sunset)

Atmospheric Transmittance

Description

This function returns atmospheric transmittance coefficient for a given day of year and location.

Usage

Transmittance(DOY, Lat, Lon, SLon, DS, Elevation)

Arguments

DOY

Day of year

Lat

Latitude (in degrees)

Lon

Longitude in degrees

SLon

Standard longitude (based on time zone) in degrees

DS

Daylight saving in minutes

Elevation

Elevation of the site in meters

Examples

#Calculating atmospheric transmittance coefficient for two consecutive days on 45 degree
# latitude and 10 degree longitude and at 100 m altitude.

DOY <- seq(0, 2, .05)

tb <- Transmittance(DOY, Lat = 45, Lon=10, SLon=10, DS=0, Elevation = 100)

#Note: only the difference between Lon and SLon matters not each value

plot(DOY, tb)