sunvector: Solar vector

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

Description

Calculates a unit vector in the direction of the sun from the observer position.

Usage

1
sunvector(jd, latitude, longitude, timezone)

Arguments

jd

Julian Day and decimal fraction.

latitude

Latitude of observer in degrees and decimal fraction.

longitude

Longitude of observer in degrees and decimal fraction.

timezone

Time zone, west is negative.

Details

To calculate the sunvector to the nearest hour, give the Julian Day with a precission better than 1/24; to approximate it to the nearest minute use decimal fractions smaller than 1/(24*60), and so on.

Value

3 column matrix with the x, y , z coordinates of the sun vector.

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

sunpos

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
# Current solar vector at Greenwich observatory
sunvector(JD(Sys.time()),51.4778,-0.0017,0)

juneday = JD(seq(ISOdate(2019,6,21,0),ISOdate(2019,6,21,23,30),by='30 min'))
## Not run:  
# Path of the sun over Greenwich in summer
require(scatterplot3d)
scatterplot3d(sunvector(juneday,51.4778,-0.0017,0),
	ylim=c(-1,1),zlim=c(0,1),pch=8,color='orange')

## End(Not run)	
# print values 
options(digits=12)		# make sure decimals are printed
sunvector(juneday,51.4778,-0.0017,0)

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