# NOT RUN {
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)
# }
Run the code above in your browser using DataLab