zenaz: Calculates position of the sun

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

View source: R/zenaz.R

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

1
2
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)

Note

This routine is no doubt less accurate that the NOAA routines provided by the solarpos function in the maptools package. It is easier to use, though.

Author(s)

Remko Duursma, based mostly on original FORTRAN code by Belinda Medlyn.

References

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

See Also

setHemi

Examples

1
2
3
4
5
6
# 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))))

YplantQMC documentation built on May 29, 2017, 7:02 p.m.

Related to zenaz in YplantQMC...