suntimes: Calculates sunrise, sunset and daylength

View source: R/othertools.R

suntimesR Documentation

Calculates sunrise, sunset and daylength

Description

suntimes is used to calculate, sunrise, sunset and daylength on any given data at a specified location.

Usage

suntimes(julian, lat, long, merid = round(long/15, 0) * 15, dst = 0)

Arguments

julian

the Julian day as returned by julday().

lat

latitude of the location for which suntime is required (decimal degrees, -ve south of equator).

long

longitude of the location for which suntime is required (decimal degrees, -ve west of Greenwich meridian).

merid

an optional numeric value representing the longitude (decimal degrees) of the local time zone meridian (0 for GMT). Default is round(long / 15, 0) * 15

dst

an optional numeric value representing the time difference from the timezone meridian (hours, e.g. +1 for BST if merid = 0).

Details

if the sun is above or below the horizon for 24 hours on any days, a warning is given, and the sunrise and sunset returned are the appoximate times at which that the sun is closest to the horizon.

Value

a data.frame with three components:

sunrise a vector of sunrise (hours in 24 hour clock).

sunrise a vector of sunset (hours in 24 hour clock).

sunrise a vector of daylengths (hours).

Examples

jd <- julday(2018, 1, 16)
suntimes(jd, 50.17, -5.12) # Cornwall, UK
suntimes(jd, 78.22, 15.64) # Longyearbyen, Svalbad
suntimes(jd, -54.94, -67.61, merid = -60, dst = 1) # Puerto Williams, Cabo de Hornos, Chile

ilyamaclean/microclima documentation built on Oct. 31, 2023, 11:41 p.m.