Last data update: 2014.03.03

R: Calculate the appropriate sun elevation angle for known...
getElevationR Documentation

Calculate the appropriate sun elevation angle for known location

Description

Function to calculate the median sun elevation angle for light measurements at a known location and the choosen light threshold.

Usage

getElevation(tFirst, tSecond, type, twl, known.coord, plot = TRUE,
  lnorm.pars = FALSE)

Arguments

tFirst

vector of sunrise/sunset times (e.g. 2008-12-01 08:30).

tSecond

vector of of sunrise/sunset times (e.g. 2008-12-01 17:30).

type

vector of either 1 or 2, defining tFirst as sunrise or sunset respectively.

twl

data.frame containing twilights and at least tFirst, tSecond and type (alternatively give each parameter separately).

known.coord

a SpatialPoint or matrix object, containing known x and y coordinates (in that order) for the selected measurement period.

plot

logical, if TRUE a plot will be produced.

lnorm.pars

logical, if TRUE shape and scale parameters of the twilight error (log-normal distribution) will be estimated and included in the output (see Details).

Details

Optionally, shape and scale paramters of the twiligth error (in minutes) can be estimated. The error is assumed to follow a log-normal distribution and 0 (elev0) is set 0.1 below the minimum sun elevation angle of estimated twilight times. Those parameters might be of interest for sensitivity analysis or further processing using the R Package SGAT (https://github.com/SWotherspoon/SGAT).

Author(s)

Simeon Lisovski

References

Lisovski, S., Hewson, C.M, Klaassen, R.H.G., Korner-Nievergelt, F., Kristensen, M.W & Hahn, S. (2012) Geolocation by light: Accuracy and precision affected by environmental factors. Methods in Ecology and Evolution, DOI: 10.1111/j.2041-210X.2012.00185.x.

Examples

data(calib2)
  calib2$tFirst  <- as.POSIXct(calib2$tFirst, tz = "GMT")
  calib2$tSecond <- as.POSIXct(calib2$tSecond, tz = "GMT")
getElevation(calib2, known.coord = c(7.1,46.3), lnorm.pars = TRUE)

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(GeoLight)
Loading required package: maps

 # maps v3.1: updated 'world': all lakes moved to separate new #
 # 'lakes' database. Type '?world' or 'news(package="maps")'.  #


> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/GeoLight/getElevation.Rd_%03d_medium.png", width=480, height=480)
> ### Name: getElevation
> ### Title: Calculate the appropriate sun elevation angle for known location
> ### Aliases: getElevation
> 
> ### ** Examples
> 
> data(calib2)
>   calib2$tFirst  <- as.POSIXct(calib2$tFirst, tz = "GMT")
>   calib2$tSecond <- as.POSIXct(calib2$tSecond, tz = "GMT")
> getElevation(calib2, known.coord = c(7.1,46.3), lnorm.pars = TRUE)
  med.elev      shape      scale 
-6.0803295  1.9853103  0.9464438 
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>