Closed StanislawSwierc closed 9 years ago
Hi,
I think it's a problem related to your data. Please, paste a link to the channels_solar_30_fixed.csv
file so I can play with it.
Best.
I just published part of the data set and created a gist which loads it. I hope this will make it easy for you to see what is wrong with the data:
https://gist.github.com/StanislawSwierc/2acc1d57eb2bf24e243e
You can also access the data file directly at:
Kind regards, Stan
Thanks.
The problem is in the mutate
section: it sets the variables to the global maximum value, instead of the row wise maximum value. You should use the rowwise()
function (although I am not sure because I am not a dplyr
user). However, I would use something like:
idx <- with(channels_solar, glob0 < indr0)
channels_solar[idx, -1] <- NA
On the other hand, you can use only the global irradiation measurements without setting the corr
argument:
gef <- calcGef(lat, dataRad=meteo_zoo,
modeRad='bdI',
beta=30, alfa=0)
Yes! That was silly mistake rowwise
solves the problem of having max for glob0
channels_solar <- channels_solar %>%
rowwise() %>%
mutate(
glob0 = max(glob0, indr0),
glob30 = max(glob30, indr30))
However after making the change I'm still seeing some NA values for effective global irradiation.
channels_solar[which(is.na(gef_df$Gef)), ]
It seems this happens for samples where global (glob0
) and indirect (indr0
) irradiation match or are very close to each other. I will create smaller example with one of these samples tomororw.
time glob0 indr0 glob30 indr30
706 2009-01-15 16:30:00 15.3450000 14.200000 2.180833e+01 14.01666667
754 2009-01-16 16:30:00 11.9150000 11.766667 1.436167e+01 11.48333333
802 2009-01-17 16:30:00 12.6466667 11.620000 1.229833e+01 12.29833333
1074 2009-01-23 08:30:00 3.7916667 3.501667 8.425000e+00 5.93333333
1619 2009-02-03 17:00:00 23.7550000 23.161667 3.785833e+01 37.21333333
2965 2009-03-03 18:00:00 12.3866667 12.161667 1.034667e+01 9.38333333
3013 2009-03-04 18:00:00 14.0083333 14.008333 2.451333e+01 19.45666667
3231 2009-03-09 07:00:00 4.4416667 4.156667 6.146667e+00 4.63000000
3734 2009-03-19 18:30:00 12.6183333 12.286667 1.147833e+01 9.96500000
5320 2009-04-21 19:30:00 6.9716667 6.971667 5.068333e+00 4.77000000
6185 2009-05-09 20:00:00 11.5266667 11.526667 7.051667e+00 7.05166667
6233 2009-05-10 20:00:00 19.6900000 19.690000 1.362500e+01 13.52333333
6281 2009-05-11 20:00:00 16.3633333 16.363333 1.192833e+01 11.92833333
6329 2009-05-12 20:00:00 23.5750000 23.575000 1.386167e+01 13.86166667
6490 2009-05-16 04:30:00 0.9483333 0.700000 9.033333e-01 0.87500000
6538 2009-05-17 04:30:00 0.0000000 0.000000 1.500000e-02 0.01500000
7098 2009-05-28 20:30:00 13.6733333 13.673333 9.076667e+00 9.07666667
7146 2009-05-29 20:30:00 7.6566667 7.656667 6.286667e+00 6.28666667
7335 2009-06-02 19:00:00 290.6466667 290.646667 1.527950e+02 148.52666667
7337 2009-06-02 20:00:00 201.8033333 186.468333 9.824667e+01 88.73333333
7338 2009-06-02 20:30:00 56.8766667 52.658333 4.248167e+01 37.73333333
The most likely cause is that global irradiance on the horizontal plane is greater than the extra-terrestrial irradiance (here).
Hi Oscar, Thank you for creating this package! By its description it seems as if it can solve a lot of the problems I will need to deal with in my research on PV systems. I installed your package version 0.41 from CRAN. I wanted to use
calcGef
to calculate global irradiation on the generator plane from the values of intradaily global and diffuse irradiation on the horizontal plane. When I started using the package with my data I ran into some problems with NA values forGef
.Could you help me understand if this is a problem in the package itself, or the way I use it?
Please notice that I do not have ambient temperature, but from what I know global and diffuse irradiation should be sufficient for this calculation. That's why I ignored the following warning:
Here is the code I used:
Here is the result for a single day which shows
NA
values.Kind regards, Stan