Solar in stats

Forum for english speaking users
Répondre
fikkaud
Membre
Messages : 34
Inscription : lun. févr. 05, 2007 10:22 pm

Solar in stats

Message par fikkaud »

Hi,
I believe that the hours of sunshine to be overcalculated.

Is there a probe that will make a tweak to adjust this?

I'm using this formula in my perl scripts to calculate solar criteria

Code : Tout sélectionner

$solarcriteria=sin($solarangle*$pi/180)/sin(55.3*$pi/180)*55; 	
#Hey the sun is shining within the next ifstatement
if ($solarcriteria < $solarenergy/10.24){	
		$soltimer+=$updaterate;} #just counting up seconds of sunshine
#dividing $solarenergy by 10.24 since max output is 1024 w/m2 for my 1-wire sensor 
Today GW reports close to 5hrs of sunshine on an overall overcast day. Some sunny spells occationally. My script says 1hr
I set the factor in the solarcriteria to 55% of expected energy. The factor of 55.3 is the max possible solarheight in degrees above the horizon at my latitude.

What is your criteria based on? I could multiply my solar readings to better match a Davis sensor. But a probe for this would maybe be better.

regards
Audun
http://vindkast.no
Pidou
Membre
Messages : 478
Inscription : dim. juil. 27, 2008 6:06 pm
Contact :

Re: Solar in stats

Message par Pidou »

Hi,

You can change the parameters of this, in "Preferencies"/"Probes"/"Statistics" (I don't know if they are the good menus names I use the French version).
Here you can change "Minimal solar radiation" and "Duration for a day". Default values are 100 W/m² and 75%.
Ma station => http://www.meteo-boisney.fr
Image
--- Station Vantage Pro 2 - Plugin VantagePro.dll ---
--- GraphWeather Version 2.0.312b ---
fikkaud
Membre
Messages : 34
Inscription : lun. févr. 05, 2007 10:22 pm

Re: Solar in stats

Message par fikkaud »

I appreciate pointing out that option in the probes.

For the future Antoine, you might consider a sinus() function that takes into account the height of the sun at any given time of day and time of year. Comparing actual solar reading with a theoretical maximum.
I can provide the rest of the code I'm using to calculate the 'solar criteria'

Since my solar time (in seconds) is already in my database I guess I could use a spare probe and see if $cumul will work with a factor of 1/3600 to get hours of sunshine from that sql record.

Let me know what you think.

Audun
http://vindakst.no
Pidou
Membre
Messages : 478
Inscription : dim. juil. 27, 2008 6:06 pm
Contact :

Re: Solar in stats

Message par Pidou »

On my side the value given by GW are fully in agreement with those computed by WeatherLink (the Davis Vantage software), but they may be use the same calculation method.
Ma station => http://www.meteo-boisney.fr
Image
--- Station Vantage Pro 2 - Plugin VantagePro.dll ---
--- GraphWeather Version 2.0.312b ---
Avatar de l’utilisateur
TiToine
Site Admin
Messages : 3356
Inscription : lun. mars 20, 2006 11:16 am
Localisation : Montréal
Contact :

Re: Solar in stats

Message par TiToine »

Fikkuad,

It should work in reading the value from your mysql database and apply a cumul.

Can you post your algo for the solar criteria? Is your or a well-known model?
fikkaud
Membre
Messages : 34
Inscription : lun. févr. 05, 2007 10:22 pm

Re: Solar in stats

Message par fikkaud »

My code is based on this http://answers.google.com/answers/threa ... 82886.html

PERL:

Code : Tout sélectionner

$lat=58.939 # Latitude in decimal form. Negative in southern hemisphere.
$gmtoffset=1; # Offset from GMT
@lokal = localtime(time);		
$N = $lokal[7]; #Day of year
$t= $lokal[2]-$gmtoffset-$lokal[8]+($lokal[1]/60);#Hour of day -GMTOFFSET Subtracting DSToffset (if any) Add minute fraction

$g = (2*$pi/365.25)*($N+($t/24)); #Fraction of Year in degrees

$declination=0.396372-22.91327*cos($g)+4.02543*sin($g)-0.387205*cos(2*$g)+0.0501967*sin(2*$g)-0.154527*cos(3*$g)+0.084798*sin(3*$g);

$TC=0.004297+0.107029*cos($g)-1.837877*sin($g)-0.837378*cos(2*$g)-2.340475*sin(2*$g);
$SHA =($t-12)*15+$long+$TC;
if ($SHA>180){$SHA-=360;}
if ($SHA<-180) {$SHA+=360;}
$cosSZA=sin(deg_to_rad($lat))*sin(deg_to_rad($declination))+cos(deg_to_rad($lat))*cos(deg_to_rad($declination))*cos(deg_to_rad($SHA));
if ($cosSZA>1){$cosSZA=1;}
if ($cosSZA<-1){$cosSZA=-1;}
$SZA=rad_to_deg(acos($cosSZA));

$solarangle=90-$SZA; #THE ONE WE NEED

$solarcriteria=sin($solarangle*$pi/180)/sin(55*$pi/180)*55;# Can't remember the logic anymore besides it's threshold is at 55% of max solar energy. This EQ provided by Steinar Midtskogen http://voksenlia.net
Hope this helps. I did some translation for the code to be readable, so the code might not run

regards
Audun
http://vindkast.no
Pidou
Membre
Messages : 478
Inscription : dim. juil. 27, 2008 6:06 pm
Contact :

Re: Solar in stats

Message par Pidou »

I don't know how is made your solar probe, but on my Vantage station is made of a small disk (around one square centimeter) with as to be perfectly horizotally align (there is a bubble level and 3 screws to adjust this).
Then I am wondering if it really necessary to consider the sun light angle depending on the latitude of the place as the power of the incident light on the disk probably already take in account this angle.

What do you think ?
Ma station => http://www.meteo-boisney.fr
Image
--- Station Vantage Pro 2 - Plugin VantagePro.dll ---
--- GraphWeather Version 2.0.312b ---
Avatar de l’utilisateur
TiToine
Site Admin
Messages : 3356
Inscription : lun. mars 20, 2006 11:16 am
Localisation : Montréal
Contact :

Re: Solar in stats

Message par TiToine »

I agree with Pidou, the interesting measure is the energy received by the ground, different in winter/summer (the declination of the sun is different).
fikkaud
Membre
Messages : 34
Inscription : lun. févr. 05, 2007 10:22 pm

Re: Solar in stats

Message par fikkaud »

Antoine, Pidou.

I'll try to explain the reason I go trough all this trouble calculating expexted energy.
This might not be as important closer to the equator, but here the length of the day changes soo much over the year. In summer we have midnight sun, and winter no sun at all. If I set my sunshine criteria to 100 w/m2 it's obviously not valid for each day of the year. In winter it barely reaches this amount on a sunny day, due to the sun beeing so close to the horizon. And ofcourse in summer the energy seen by the detector is far above this amount even with skies covering the sun.
Midsummer my sunny criteria will be >500W/m2 with sun at zenith and >20 w/m2 before it sets at 11pm.

Remember, I try to accurately count every second of detected sun to have a database with hours of sunshine.

Another thing not taken into account in my code, is that it assumes a flat horizon. Another part is needed in addition to compensate for obstructions (ie. forest, mountains, buildings). To get this absolutely perfect yo'd have to measure the horizon with a 'Teodolitt' and come up with a compensating algorithm. (Don't know the english word so I'm posting an image).
teodolitt.jpg
My experince is that setting the criteria to 55% of expected radiation you get a cutoff when the sun doesn't cast distinct shadows anymore. If you want to elaboarte on this you could do all sorts of 'binning' of these data, monitoring different thresholds. Clear, Haze, Light overcast, Heavy overcast. Monitor for broken clouds and so further (I'm not there yet :wink: )

This way I always have an accurate percentage of sunshine compared to the length of the day. So far today It's been sunny 70% of the time :mrgreen:

Hope this explanation is worth something to somebody.
Regards
Audun
http://vindkast.no
Vous ne pouvez pas consulter les pièces jointes insérées à ce message.
Répondre