insolation: Direct and diffuse solar radiation.

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/insolation.R

Description

Computes direct and diffuse solar irradiance perpendicular to the beam, for a given zenith angle, Julian Day, altitude and atmospheric conditions.

Usage

1
insolation(zenith, jd, height, visibility, RH, tempK, O3, alphag)

Arguments

zenith

Zenith angle in degrees.

jd

Julian Day.

height

Altitude above sea level.

visibility

Visibility [km].

RH

Relative humidity [%].

tempK

Air temperature [K].

O3

Ozone thickness [m].

alphag

Albedo of the surrounding terrain [0 to 1].

Details

See http://disc.sci.gsfc.nasa.gov/Aura/data-holdings/OMI/omto3_v003.shtml for ozone data.

Value

Returns a two column matrix of irradiance values. The first column is direct radiation, the second is diffuse radiation.

Author(s)

Javier G. Corripio

References

Bird, R. E. and Hulstrom, R. L. (1981a) Review, evaluation and improvements of direct irradiance models, Trans. ASME J. Solar Energy Eng. 103, 182-192.

Bird, R. E. and Hulstrom, R. L. (1981b) A simplified clear sky model for direct and diffuse insolation on horizontal surfaces, Technical Report SERI/TR-642-761, Solar Research Institute, Golden, Colorado.

Iqbal, M. (1983) An Introduction to Solar Radiation, Academic Press, Toronto.

See Also

doshade, hillshading, sunvector

Examples

  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
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
insolation(30,2456007,3200,28,60,278.15,0.02,0.2)
insolation(30,JDymd(2012,6,21),3200,28,60,278.15,0.02,0.2)

# Compare measured and modelled insolation

# load data from automatic weather station in the Andes
data(meteoandes)

# Get zenith angle for every time step
meteodate=as.POSIXct(strptime(paste(meteoandes$year,meteoandes$doy,
	meteoandes$hh,meteoandes$mm),format="%Y %j %H %M"))
metjd=JD(meteodate)


sunv = sunvector(metjd,-33.695,-70.0033,-4) 
zenith = sunpos(sunv)[,2]

# Compute direct and diffuse beam irradiance 
Idirdif = insolation(zenith,metjd,4640,90,
	meteoandes$RH,meteoandes$Tair+273.15,0.02,0.55)

# modify for angle of incidence on horizontal surface (pyranometer)
cos_inc_sfc=sunv%*%as.vector(normalvector(0,0)) ## or sum(sunv*normalvector(0,0))

# set to zero values with no indicent light
cos_inc_sfc[cos_inc_sfc<0]=0

# Add direct and diffuse simulated radiation on horizontal surface
Isim  = Idirdif[,1] * cos_inc_sfc + Idirdif[,2]

# plot the measured insolation
plot(meteodate,meteoandes$pyra1,'l',col=2)

# add a shaded polygon corrresponding to 10% accuracy in the measurements
polygon(c(meteodate, rev(meteodate)), c(meteoandes$pyra1*(1+0.1),
	rev(meteoandes$pyra1*(1-0.1))),col = "#ff000033", border = NA)

# add the simulated insolation
lines(meteodate,Isim,col=4)

# We measured that diffuse reflected solar radiation from the surrounding mountains 
# covered in snow could be up to 10% of total incoming radiation. 
# There is one hour of shadows early in the morning (not simulated)
# Add 10% diffuse reflected radiation
lines(meteodate,1.1*Isim,col=3)


## Calculate insolation on the island of La Palma, Spain on the 21.03.2013
## reduced resolution DEM from SRTM, http://www2.jpl.nasa.gov/srtm/
zipfile=tempfile()
download.file("http://www.meteoexploration.com/R/insol/data/demlapalma.asc.zip",zipfile)
header=read.table(unz(zipfile,'demlapalma.asc'),nrows=6)
dem = read.table(unz(zipfile,'demlapalma.asc'),skip=6)
dem=as.matrix(dem)
unlink(zipfile)
cellsize=header[5,2]
cgr=cgrad(dem,cellsize)
height=750
visibility=30
RH=80
tempK=288
tmz=0
year=2013
month=3
day=21
timeh=12
jd=JDymd(year,month,day,hour=timeh)
Iglobal=array(0,dim=dim(dem))
deltat=0.5
lat=28.135
lon=-17.247
dayl=daylength(lat,lon,jd,0)
for (srs in seq(dayl[1],dayl[2],deltat)){
	jd=JDymd(year,month,day,hour=srs)
	sv=sunvector(jd,lat,lon,tmz)
	hsh=hillshading(cgr,sv)
	sh=doshade(dem,sv,cellsize)
	zenith=sunpos(sv)[2]
	Idirdif = insolation(zenith,jd,height,visibility,RH,tempK,0.002,0.15)
	## direct radiation modified by terrain + diffuse irradiation (skyviewfactor ignored)
	## values in J/m^2
	Iglobal = Iglobal + (Idirdif[,1] * hsh + Idirdif[,2] )*3600*deltat	
}

## dispaly results
image(t(Iglobal[nrow(Iglobal):1,]),col=grey(1:100/100))
contour(t(dem[nrow(dem):1,]),lwd=.5,col='sienna1',add=TRUE,levels=seq(0,2500,500))
contour(t(dem[nrow(dem):1,]),lwd=.25,col='sienna1',add=TRUE,levels=seq(0,2500,50),drawlabels=FALSE)

## Not run: 
## The same using raster
require(rgdal)
require(raster)
demfile=tempfile()
download.file("http://www.meteoexploration.com/R/insol/data/demlapalma.tif",demfile)
dem=raster(demfile)
plot(dem)
cgr=cgrad(dem)
demm=raster:::as.matrix(dem)
dl=res(dem)[1]
## Isolation at 30 min interval over the length of the day
## RH and temp would cahnge over the dy, here we use a constant value for simplicity
height=750
visibility=30
RH=80
tempK=288
tmz=0
year=2013
month=3
day=21
timeh=12
jd=JDymd(year,month,day,hour=timeh)
Iglobal=array(0,dim=dim(demm))
deltat=0.5
lat=28.135
lon=-17.247
dayl=daylength(lat,lon,jd,0)
for (srs in seq(dayl[1],dayl[2],deltat)){
	jd=JDymd(year,month,day,hour=srs)
	sv=sunvector(jd,lat,lon,tmz)
	hsh=hillshading(cgr,sv)
	sh=doshade(demm,sv,dl)
	zenith=sunpos(sv)[2]
	Idirdif = insolation(zenith,jd,height,visibility,RH,tempK,0.002,0.15)
	## direct radiation modified by terrain + diffuse irradiation (skyviewfactor ignored)
	## values in J/m^2
	Iglobal = Iglobal + (Idirdif[,1] * hsh + Idirdif[,2] )*3600*deltat
}
## rasterize to plot nicely
Iglobal=raster(Iglobal,crs=projection(dem))
extent(Iglobal)=extent(dem)
plot(Iglobal*1e-6,col=grey(1:100/100),
 	legend.args=list(text=expression(paste('Insolation MJ ',m^-2)), side=4,line=2.5))
contour(dem,lwd=.5,col='sienna1',add=TRUE,levels=seq(0,2500,500))
contour(dem,lwd=.25,col='sienna1',add=TRUE,levels=seq(0,2500,50),drawlabels=FALSE)
unlink(demfile)

## End(Not run)

insol documentation built on May 29, 2017, 3:22 p.m.