this is my first time asking a question on forums like this. I am using the solaR
package. I have created a zoo
object with an index of SolarTime
(using the local2Solar
function), column 1 is the load, column 2 is the G0 (global irradiance) required for the calcGef
function. Both columns 1 and 2 are numeric.
Here is the zoo
object, with index of solar time and 2 columns of numeric data, the zoo
object is called AggSolar
:
AggLoad G0
2017-01-01 04:50:36 12.045 23.85
2017-01-01 04:51:36 11.970 18.33
2017-01-01 04:52:36 13.575 21.43
2017-01-01 04:53:36 13.710 27.65
2017-01-01 04:54:36 14.115 31.40
2017-01-01 04:55:36 12.555 35.11
2017-01-01 04:56:36 11.625 39.03
2017-01-01 04:57:36 11.655 42.94
2017-01-01 04:58:36 12.390 46.22
2017-01-01 04:59:36 11.955 49.48
2017-01-01 05:00:36 12.195 52.79
2017-01-01 05:01:36 11.985 53.44
2017-01-01 05:02:36 12.150 51.37
2017-01-01 05:03:36 11.025 49.33
2017-01-01 05:04:36 11.475 46.35
2017-01-01 05:05:36 14.355 43.22
2017-01-01 05:06:36 16.695 41.27
2017-01-01 05:07:36 15.705 41.46
2017-01-01 05:08:36 12.840 47.04
2017-01-01 05:09:36 17.610 54.82
2017-01-01 05:10:36 17.430 59.16
I put the zoo
object, AggSolar
, into the calGef
function by running the following code:
IrradTiltE<-calcGef(lat=lat, modeRad = 'bdI', modeTrk = 'fixed', dataRad = AggSolar, keep.night = TRUE, beta = 25, alfa = -90)
IrradFromTiltE<-as.zooI(IrradTiltE)
The output, IrradFromTiltE
, is:
Gef Bef Def
2017-01-01 04:50:36 0.0000 0.0000 0.00000
2017-01-01 04:51:36 0.0000 0.0000 0.00000
2017-01-01 04:52:36 0.0000 0.0000 0.00000
2017-01-01 04:53:36 0.0000 0.0000 0.00000
2017-01-01 04:54:36 0.0000 0.0000 0.00000
2017-01-01 04:55:36 NA NA NA
2017-01-01 04:56:36 NA NA NA
2017-01-01 04:57:36 NA NA NA
2017-01-01 04:58:36 NA NA NA
2017-01-01 04:59:36 NA NA NA
2017-01-01 05:00:36 NA NA NA
2017-01-01 05:01:36 NA NA NA
2017-01-01 05:02:36 NA NA NA
2017-01-01 05:03:36 NA NA NA
2017-01-01 05:04:36 NA NA NA
2017-01-01 05:05:36 438.4437 411.0645 27.11184
2017-01-01 05:06:36 375.3661 337.1296 37.98122
2017-01-01 05:07:36 338.4409 293.0288 45.15567
2017-01-01 05:08:36 368.4516 325.6663 42.49433
2017-01-01 05:09:36 415.7088 379.9627 35.40693
2017-01-01 05:10:36 425.7758 391.6909 33.71889
You will see from the input data set that there is always a G0 value (therefore there should be no zero's in Gef, Bef and Def), but there are zero's in the output file and then it appears to randomly put a bunch of NA's into the output as well. I am not sure what I am doing wrong.