Last data update: 2014.03.03

R: Night and Day Boundary Computation Function
NightDayR Documentation

Night and Day Boundary Computation Function

Description

Calculates the declination of the sun, the greenwhich hour angle and the latitudes of the of the sun movements throughout one day.

Usage

NightDay(time, timezone)

Arguments

time

needs to be of following format: %Y-%m-%d (%Y Year with century, %m Month as decimal number (01-12), %d Day of the month as decimal number (01-31)), %H:%M:%S (%H Hours as decimal number (00-23), %M Minute as decimal number (00-59), %S Second as decimal number (00-61)

timezone

has to be an integer, e.g. a number between -11 and +11 (0 for GMT, +1 for CMT, etc.)

Value

Time

is an object of class 'POSIXlt' representing the input time.

tz

is an integer representing the input timezone

Latitude

is a vector fo doubles containing the Latitudes of the night and day boundary.

Declination

returns a double of the sun declination.

GHA

returns a double of the greenwhich hour angle.

Note

The function NightDay can be used in combination with your own maps and plot functions.

Author(s)

Max Hughes-Brandl

Examples

Time <- Sys.time()
timezone <- 1

NightDay(Time, timezone)

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(NightDay)
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/NightDay/NightDay.Rd_%03d_medium.png", width=480, height=480)
> ### Name: NightDay
> ### Title: Night and Day Boundary Computation Function
> ### Aliases: NightDay
> 
> ### ** Examples
> 
> Time <- Sys.time()
> timezone <- 1
> 
> NightDay(Time, timezone)
$Time
[1] "2016-07-04 21:01:01 JST"

$tz
[1] 1

$Latitude
  [1] -67 -67 -67 -67 -67 -67 -67 -67 -67 -67 -67 -67 -67 -67 -67 -66 -66 -66
 [19] -66 -66 -66 -66 -65 -65 -65 -65 -65 -65 -64 -64 -64 -64 -63 -63 -63 -63
 [37] -62 -62 -62 -61 -61 -61 -60 -60 -59 -59 -58 -58 -57 -57 -56 -56 -55 -54
 [55] -54 -53 -52 -52 -51 -50 -49 -48 -47 -46 -45 -44 -43 -42 -40 -39 -38 -36
 [73] -35 -33 -32 -30 -28 -26 -24 -22 -20 -18 -16 -14 -12  -9  -7  -5  -2   0
 [91]   2   5   7   9  12  14  16  18  20  22  24  26  28  30  32  33  35  36
[109]  38  39  40  42  43  44  45  46  47  48  49  50  51  52  52  53  54  54
[127]  55  56  56  57  57  58  58  59  59  60  60  61  61  61  62  62  62  63
[145]  63  63  63  64  64  64  64  65  65  65  65  65  65  66  66  66  66  66
[163]  66  66  67  67  67  67  67  67  67  67  67  67  67  67  67  67  67  67
[181]  67  67  67  67  67  67  67  67  67  67  67  67  67  67  67  66  66  66
[199]  66  66  66  66  65  65  65  65  65  65  64  64  64  64  63  63  63  63
[217]  62  62  62  61  61  61  60  60  59  59  58  58  57  57  56  56  55  54
[235]  54  53  52  52  51  50  49  48  47  46  45  44  43  42  40  39  38  36
[253]  35  33  32  30  28  26  24  22  20  18  16  14  12   9   7   5   2   0
[271]  -2  -5  -7  -9 -12 -14 -16 -18 -20 -22 -24 -26 -28 -30 -32 -33 -35 -36
[289] -38 -39 -40 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -52 -53 -54 -54
[307] -55 -56 -56 -57 -57 -58 -58 -59 -59 -60 -60 -61 -61 -61 -62 -62 -62 -63
[325] -63 -63 -63 -64 -64 -64 -64 -65 -65 -65 -65 -65 -65 -66 -66 -66 -66 -66
[343] -66 -66 -67 -67 -67 -67 -67 -67 -67 -67 -67 -67 -67 -67 -67 -67 -67

$Declination
[1] 22.77939

$GHA
[1] 119.1378

attr(,"class")
[1] "NightDay"
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>