我试图根据水平表面的辐射计算倾斜表面上的辐射。我发现了另一个问题solaR timestamp for radiation on a tilted surface,但不幸的是,它对我没有帮助。这是我的尝试(有一些假数据):
library("solaR")
# example how the G0 data (radiation on horizontal surface) should look like
G0 = c( 0, 0, 0, 0, 0, 0, 2, 78, 152, 182, 239, 547, 624, 383, 312, 273, 241, 195, 145, 90, 29, 0, 0, 0)
B0 = c(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.6, 62.4,121.6,145.6,191.2,437.6,499.2,306.4,249.6,218.4,192.8,156.0,116.0, 72.0, 23.2, 0.0, 0.0, 0.0)
D0 = G0-B0
Ta = c(4.4,3.2,2.8,2.7,2.6,2.4,2.6,2.6,2.6,2.7,3.7,4.4,4.8,5.8,6.3,6.7,6.8,6.9,6.7,6.7,6.4,4.8,3.2,1.2);
timestamp = seq(from = as.POSIXct("2016-04-21 00:00", tz="UTC"), to = as.POSIXct("2016-04-22 23:00", tz="UTC"), by = "hour")
df = data.frame(timestamp = as.character(timestamp), G0=rep(G0,2), B0=rep(B0,2), D0=rep(D0,2), Ta=rep(Ta,2))
bdi = dfI2Meteo(df, time.col = 'timestamp', lat=42, source='', format='%Y-%m-%d %H:%M:%S')
summary(getData(bdi))
xyplot(bdi)
# transform it to effective irradiation
gef = calcGef(42,
modeTrk='fixed',
modeRad='bdI',
bdi,
keep.night=TRUE,
sunGeometry='michalsky',
beta=30, alfa=0,
iS=2,
alb=0.2
)
xyplot(gef)
结果只显示每日平均值,但我想得到每小时的值。我错过了什么?
答案 0 :(得分:0)
好吧,我自己找到了灵魂,只是一个愚蠢的事情,最后一行应该是
xyplot(as.zooI(gef))
而不是
xyplot(gef)