Learn R Programming

YplantQMC (version 0.6-6)

zenaz: Calculates position of the sun

Description

Calculates the zenith and azimuth angle of the position of the sun, based mostly on routines from Iqbal (1983).

By default, it is assumed that the time of day is not given in local apparent time (LAT, also known as 'solar time'). To convert the standard time to LAT, the longitude of the location, and the longitude of the nearest time zone border must be given.

Alternatively, use LAT=TRUE to specify that the time of day is in LAT (that is, solar maximum occurs exactly at noon).

The user can specify a number of timesteps (KHRS), so that the solar positions are calculated for the midpoint of each timestep (this is used within YplantQMC). Alternatively, specify timeofday directly.

Usage

zenaz(year = 2012, month = 4, day = 1, lat = -33.6, long = 150.7, tzlong = long, KHRS = 24, timeofday = NA, LAT = FALSE)

Arguments

year
YYYY - to account for eccentricity (small effect).
month
Month number
day
Day of month number
lat
Latitude, degrees.
long
Longitude, degrees. Optional (only used for local apparent time correction.)
tzlong
Longitude of the nearest timezone border
KHRS
Number of timesteps in a day (optional). See Details.
timeofday
Optional, time of day (in hours) (a vector of any length) to calculate the position of the sun
LAT
Logical (default=FALSE). Are the times of day given in 'local apparent time'?

Value

A list with the following components:
list("hour")
Time in decimal hours
list("altitude")
Solar altitude (degrees)
list("azimuth")
Solar azimuth (degrees. N=0, E=90)
list("daylength")
Day length in hours
list("sunset")
Time of sunset (hours)
list("zenrad")
Solar zenith position (radians)

References

Iqbal, B., 1983. An Introduction to Solar Radiation. Academic Press, New York, 386 pp

See Also

setHemi

Examples

Run this code


# Simple use
zenaz(month=8, day=16, timeofday=12, lat=-33)

# Get half-hourly solar positions
hourpos <- zenaz(month=2, day=16, KHRS=48, lat=-33, long=155, tzlong=150)
with(hourpos, plot(hour, altitude, type='o',ylab=expression(Altitude~(degree))))

Run the code above in your browser using DataLab