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 |
This function solar altitude angle (in degrees) for a given day of year and location.
Altitude(DOY, Lat, Lon, SLon, DS)
Altitude(DOY, Lat, Lon, SLon, DS)
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 |
#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)
#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)
This function returns the apparent solar time (in minutes) for a given day of year and location.
AST(DOY, Lon, SLon, DS)
AST(DOY, Lon, SLon, DS)
DOY |
Day of year |
Lon |
Longitude in degrees |
SLon |
Standard longitude (based on time zone) in degrees |
DS |
Daylight saving in minutes |
#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)
#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)
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
Azimuth(DOY, Lat, Lon, SLon, DS)
Azimuth(DOY, Lat, Lon, SLon, DS)
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 |
#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)
#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)
This function estimates day length (in hours) for a given day of year and latitude.
DayLength(DOY, Lat)
DayLength(DOY, Lat)
DOY |
Day of year |
Lat |
Latitude (in degrees) |
#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)
#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)
This function returns a continuous the day of year value (as integer value 1:365) for a given date-time in "POSIXlt" "POSIXct" format.
DayOfYear(DateTime)
DayOfYear(DateTime)
DateTime |
DateTime object |
#Calculating day of year for now DayOfYear(Sys.time())
#Calculating day of year for now DayOfYear(Sys.time())
This function calculates solar declination angle for a given day of year.
Declination(DOY)
Declination(DOY)
DOY |
Day of year |
#Calculating solar declination angle for 365 day of the year DOY <- 1:365 delta <- Declination(DOY) plot(DOY, delta)
#Calculating solar declination angle for 365 day of the year DOY <- 1:365 delta <- Declination(DOY) plot(DOY, delta)
This function returns solar diffuse dadiation (in W/m2) for a given day of year, location and topography.
DiffuseRadiation(DOY, Lat, Lon, SLon, DS, Elevation, Slope)
DiffuseRadiation(DOY, Lat, Lon, SLon, DS, Elevation, Slope)
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 |
#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)
#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)
This function returns atmospheric diffusion factor for a given day of year, location and topography.
DiffusionFactor(DOY, Lat, Lon, SLon, DS, Elevation)
DiffusionFactor(DOY, Lat, Lon, SLon, DS, Elevation)
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 |
#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)
#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)
This function returns solar open direct beam dadiation (in W/m2) for a given day of year, location and topography.
DirectRadiation(DOY, Lat, Lon, SLon, DS, Elevation, Slope, Aspect)
DirectRadiation(DOY, Lat, Lon, SLon, DS, Elevation, Slope, Aspect)
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 |
#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)
#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)
This function approximates the value of equation of time for a given day of year
EOT(DOY)
EOT(DOY)
DOY |
Day of year |
#Calculating equaiton of time for 365 day of the year DOY <- 1:365 eot <- EOT(DOY) plot(DOY, eot)
#Calculating equaiton of time for 365 day of the year DOY <- 1:365 eot <- EOT(DOY) plot(DOY, eot)
This function calculates solar extraterrestrial radiation (in W/m2) for a given day of year.
Extraterrestrial(DOY)
Extraterrestrial(DOY)
DOY |
Day of year |
#Calculating solar extraterrestrial radiation for 365 day of the year DOY <- 1:365 Sextr <- Extraterrestrial(DOY) plot(DOY, Sextr)
#Calculating solar extraterrestrial radiation for 365 day of the year DOY <- 1:365 Sextr <- Extraterrestrial(DOY) plot(DOY, Sextr)
This function calculates extraterrestrial solar radiation normal to surface (in W/m2) for a given day of year, location and topogrpahy.
ExtraterrestrialNormal(DOY, Lat, Lon, SLon, DS, Slope, Aspect)
ExtraterrestrialNormal(DOY, Lat, Lon, SLon, DS, Slope, Aspect)
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 |
#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)
#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)
This function returns solar hour angle for a given day of year, and location.
HourAngle(DOY, Lon, SLon, DS)
HourAngle(DOY, Lon, SLon, DS)
DOY |
Day of year |
Lon |
Longitude in degrees |
SLon |
Standard longitude (based on time zone) in degrees |
DS |
Daylight saving in minutes |
#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)
#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)
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.
Incidence(DOY, Lat, Lon, SLon, DS, Slope, Aspect)
Incidence(DOY, Lat, Lon, SLon, DS, Slope, Aspect)
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 |
#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)
#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)
This function returns local standard time (in minutes) given a day of the year value.
LST(DOY)
LST(DOY)
DOY |
Day of year |
#Calculating local standard time for two consecutive days DOY <- seq(0, 2, .05) lst <- LST(DOY) plot(DOY, lst)
#Calculating local standard time for two consecutive days DOY <- seq(0, 2, .05) lst <- LST(DOY) plot(DOY, lst)
This function returns open sky solar radiation (in W/m2) for a given day of year and location.
OpenRadiation(DOY, Lat, Lon, SLon, DS, Elevation)
OpenRadiation(DOY, Lat, Lon, SLon, DS, Elevation)
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 |
#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 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)
This function calculates solar variables including radiation components, solar angles and positions and day length.
Solar(DOY, Lat, Lon, SLon, DS, Elevation, Slope, Aspect)
Solar(DOY, Lat, Lon, SLon, DS, Elevation, Slope, Aspect)
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 |
#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')
#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')
This constant value returns solar constant in Watt per meter squared
SolarConstant
SolarConstant
An object of class numeric
of length 1.
#Printing Solar Constant print(SolarConstant)
#Printing Solar Constant print(SolarConstant)
This function estimates sunrise time (in continuous hour values) for a given day of year and latitude.
Sunrise(DOY, Lat)
Sunrise(DOY, Lat)
DOY |
Day of year |
Lat |
Latitude (in degrees) |
#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)
#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)
This function estimates sunset time (in continuous hour values) for a given day of year and latitude.
Sunset(DOY, Lat)
Sunset(DOY, Lat)
DOY |
Day of year |
Lat |
Latitude (in degrees) |
#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)
#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)
This function returns atmospheric transmittance coefficient for a given day of year and location.
Transmittance(DOY, Lat, Lon, SLon, DS, Elevation)
Transmittance(DOY, Lat, Lon, SLon, DS, Elevation)
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 |
#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)
#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)