bgctw / solartime

Utilities to work with solar time, i.e. where noon is exactly when sun culminates.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CRAN_Status_Badge R-CMD-check

Overview

The solartime package provides utilities to work with solar time, i.e. where noon is exactly when sun culminates. It provides functions to compute

  • difference between local time zone and solar time
  • sun position
  • sunrise, sunset, daylength, and daytime flags

Installation

# From CRAN (in future)
#install.packages("solartime")

# Or the the development version from GitHub:
# install.packages("devtools")
devtools::install_github("bgctw/solartime")

Usage

The city of Jena is located west of the timezone’s meridian. Hence, the sun culminates around 13 minutes later.

The time difference shifts during the year because of earth orbit’s eccentricity.

require(solartime, quietly = TRUE)
latDeg <- 50.93; longDeg <- 11.57
doy <- 1:366
locaDiffMin <- 60 * computeSolarToLocalTimeDifference(
  longDeg, timeZone = 1L, doy = doy)
plot(locaDiffMin  ~ doy, ylab = "time difference solar - local time (min)")
abline(h = localDiff); abline(h = 0, lty = "dotted")

See the package vignettes (*.md) for further examples.

About

Utilities to work with solar time, i.e. where noon is exactly when sun culminates.


Languages

Language:R 100.0%