sunpos: Azimuth and zenith of the Sun

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

View source: R/sunpos.R

Description

Returns a matrix of azimuth and zenith angles of the sun given the unit vectors from the observer to the direction of the sun.

Usage

1
sunpos(sunv)

Arguments

sunv

coordinates x, y, z of the unit vector in the direction of the sun.

Value

A matrix of azimuth and zenith angles.

Author(s)

Javier G. Corripio

References

Corripio, J. G.: 2003, Vectorial algebra algorithms for calculating terrain parameters from DEMs and the position of the sun for solar radiation modelling in mountainous terrain, International Journal of Geographical Information Science 17(1), 1-23.

See Also

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
## Julian Day hourly intervals at spring equinox
jd = JD(seq(ISOdate(2019,3,20,0),ISOdate(2019,3,20,23),by="hour"))

## sun position
sp = sunpos(sunvector(jd,46.813,9.844,1))

## daylight zenith<=90
sp = sp[which(sp[,2]<=90),]

## Plot the apparent solar path at Davos on the spring equinox
ramp = colorRamp(c("red", "orange","yellow"))
crmp = c(rgb(ramp(seq(1/6,1,1/6)), max = 255),rgb(ramp(seq(1,1/6,-1/6)), max = 255))
plot(sp[,1],90-sp[,2],xlab='Azimuth',
	ylab='Elevation',main='Apparent solar path at Davos on the spring equinox',
	pch=20,col=crmp,cex=(300-sp[,2])/90)
	
## Not run: 
require(plotrix)
polar.plot(90-sp[,2],sp[,1],start=90,clockwise=TRUE,rp.type='s',
	point.symbols=20,point.col=2,cex=2,radial.lim=c(0,90),
	main='Apparent solar path at Davos on the spring equinox')

## End(Not run)

Example output

Loading required package: plotrix

insol documentation built on Feb. 10, 2021, 5:08 p.m.