0

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.

dc37
  • 15,840
  • 4
  • 15
  • 32
  • Thank you for the edits to improve my question. How did you get the columns in the data sets to line up? – Kirrilie Rowe Nov 26 '19 at 07:00
  • The zoo2meteo documentation suggests you need to include a Ta field as well for ambient temperatures? – user2474226 Nov 26 '19 at 18:30
  • @user2474226 Yes, if you don't put those values in it provides default values for you. I have run this package before with other data without any problem. This current data set I am using seems fine - I can't work out why calcGef isn't working. – Kirrilie Rowe Nov 26 '19 at 22:22
  • Could it be the value of your `lat`? As I don't know which lat you're running the data for, I looped from -90 to 0 degrees, and I get non-NA values from -90 to -39, but NAs and 0s for lat = 0:-38. I'm no expert on the solaR package though... – user2474226 Nov 27 '19 at 09:06
  • Thanks @user2474226 , good pick up. I am using lat = - 34.9 . I will investigate this further. Perhaps I should use a different sun geometry method for that latitude, or perhaps my timestamp is wrong and the G0 irradiance value I have provided is greater than what the extra-terrestrial irradiance would be at that latitude and time. – Kirrilie Rowe Nov 28 '19 at 03:40
  • Thanks @user2474226, through your detective work on the latitudes I found that I had the timestamp out by an hour, and therefore had irradiance values > 0 where there weren't meant to be any (is greater than terrestrial value) which was giving me NA's and zero's. Thanks for your help. – Kirrilie Rowe Dec 09 '19 at 02:23
  • Ah, glad to be of (indirect) help, heheh. One day perhaps I'll understand what it all means. – user2474226 Dec 09 '19 at 10:54

0 Answers0