Description Usage Arguments Details Value Note Author(s) References Examples
The function local2Solar
converts the time zone of a POSIXct
object to
the mean solar time and set its time zone to UTC as a synonym of mean
solar time. It includes two corrections:
the difference of longitudes between the location and the time zone, and
the daylight saving time.
The function CBIND
combines several objects (zoo
,
data.frame
or matrix
) preserving
the index
of the first of them or asigning a new one with the
index
argument.
The function lonHH
calculates the longitude (radians) of a time zone.
1 2 3 |
x |
a |
lon |
A numeric value of the longitude (degrees) of the
location. If |
... |
A set of |
index |
A |
tz |
A character, a time zone as documented in https://en.wikipedia.org/wiki/List_of_tz_database_time_zones. |
Since the result of local2Solar
is the mean solar time, the
Equation of Time correction is not calculated with this function. The
fSolI
function includes this correction if desired.
If the index
argument of CBIND
is NULL
(default)
the first object of ...
must be a zoo
object.
The function local2Solar
produces a POSIXct
object
with its time zone set to UTC.
The function CBIND
produces a zoo
object.
The function lonHH
gives a numeric value.
It is important to note that the solaR
package sets the system
time zone to UTC
with Sys.setenv(TZ = 'UTC')
.
Every zoo
object created by the package will have an index with this
time zone and will be supposed to be mean solar time.
Oscar Perpiñán Lamigueiro.
Perpiñán, O, Energía Solar Fotovoltaica, 2015. (https://oscarperpinan.github.io/esf/)
Perpiñán, O. (2012), "solaR: Solar Radiation and Photovoltaic Systems with R", Journal of Statistical Software, 50(9), 1-32, doi: 10.18637/jss.v050.i09
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 | t.local <- as.POSIXct("2006-01-08 10:07:52", tz = 'Europe/Madrid')
##The local time zone and the location have the same longitude (15 degrees)
local2Solar(t.local)
##But Madrid is at lon = -3
local2Solar(t.local, lon = -3)
##Daylight saving time
t.local.dst <- as.POSIXct("2006-07-08 10:07:52", tz = 'Europe/Madrid')
local2Solar(t.local.dst)
local2Solar(t.local.dst, lon = -3)
## Not run:
##Extracted from an example of calcG0
##NREL-MIDC
##La Ola, Lanai
##Latitude: 20.76685o North
##Longitude: 156.92291o West
##Time Zone: -10.0
NRELurl <- 'http://goo.gl/fFEBN'
dat <- read.table(NRELurl, header = TRUE, sep = ',')
names(dat) <- c('date', 'hour', 'G0', 'B', 'D0', 'Ta')
##B is direct normal. We need direct horizontal.
dat$B0 <- dat$G0-dat$D0
##http://www.nrel.gov/midc/la_ola_lanai/instruments.html:
##The datalogger program runs using Greenwich Mean Time (GMT),
##data is converted to Hawaiin Standard Time (HST) after data collection
idxLocal <- with(dat, as.POSIXct(paste(date, hour), format = '%m/%d/%Y %H:%M', tz = 'HST'))
head(idxLocal)
idx <- local2Solar(idxLocal, lon = -156.9339)
head(idx)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.