Page 4 of 6

Re: Sun Plot

Posted: Fri 26 Aug 2016 12:57 am
by PaulMy
A couple of pics of-
http://www.komokaweather.com/weather/su ... unplot.php which uses the MySQL realtime data source
http://www.komokaweather.com/weather/su ... lot-1b.php which uses the B-L Sunrecorder log file data source.

MySQL realtime is a once a minute upload from my B-L Sunrecorder to a file that Cumulus pics up once a minute and incorporates in Cumulus 1 realtime, etc. and then uploaded to MySQL DB

B-L data is the constant sunshine status that is logged for periods of sunshine ON and OFF, this log file is uploaded (once a minute but data is from live data) via FTP.

Interesting...

Thanks again Mark,
Paul

Re: Sun Plot

Posted: Fri 26 Aug 2016 4:04 pm
by mcrossley
Interesting Paul. There will be rounding/sampling errors in both processes, and the plot doesn't display every value (unless you stretched it out to > 1500 pixels wide). It is meant to give a guide to how sunny it is, but I am surprised the two processes are quite so different.

Re: Sun Plot

Posted: Fri 26 Aug 2016 6:03 pm
by PaulMy
I had not previously compared the B-L total sunshine to the Cumulus log but now looking at it it is the same (B-L to 2 dec. and CU to 1 dec.)
Aug 23 B-L 11.45 CU 11.5
Aug 24 B-L 7.92 CU 8.0
Aug 24 B-L 2.50 CU 2.5
and that is expected as Cumulus just gets the sunshine amounts provided by B-L once a minute, so the end of day should be the same.

However during the day sunshine is logged by B-L as it happens, sun ON or OFF and that can be in seconds or several times a minute. The total provided to Cumulus is correct between B-L and CU at whenever that once a minute file is saved but B-L continues to update its sunshine total between the once a minute logging.

Whether the sun is actually shining is included in that once a minute update so to Cumulus for current sunshine it is either sunshine for minimum 1 minute, or no sunshine for minimum 1 minute, The sunplot using the MySQL realtime data is that once a minute update to show whether the sun is shining or not for that 1 minute.

However the B-L data can have several periods of sunshine or no sunshine in that 1 minute interval. The sunplot-1.3 using the B-L data takes those continuous sun ON and OFF periods to indicate whether the sun is shining or not and that can be for less than 1 minute. Then because of limits on how quickly and practical the logged data can be FTP I have it at once a minute. Now I think, for human observation purposes, Mark has cleverly coded to round or ignore the seconds in the logged data so in effect closer to the MySQL realtime source.

I may be wrong in my assumption above as I can't actually understand exactly what the script does to display the yellow sunshine line, but it is fun to see the display and have some information on the source for that. And while the B-L system is a precise device and coding, there can be other factors to limit the accuracy -i.e. a hawk flying over the line of sight between the device and the sun :lol: (actually I have that in the fall when the sun is low and nearby trees with all their leaves obscure the line of sight between the sun and the B-L).
It is meant to give a guide to how sunny it is
and it does that well.
I am enjoying,

Paul

Re: Sun Plot

Posted: Mon 29 Aug 2016 7:23 pm
by kocher
Thank you very much Mark.

I really like this graphic:

http://kocher.es/cumulusMX/sunplot.php

I know another graphic based on bands of Campbell-Stokes heliograph:

http://meteo.aerolugo.com/php/heliograph.php

It provides the same information, but in rectangular format (simulating the paper webs sunburned)

Re: Sun Plot

Posted: Mon 29 Aug 2016 7:47 pm
by mcrossley
kocher wrote:Thank you very much Mark.

I really like this graphic:

http://kocher.es/cumulusMX/sunplot.php

I know another graphic based on bands of Campbell-Stokes heliograph:

http://meteo.aerolugo.com/php/heliograph.php

It provides the same information, but in rectangular format (simulating the paper webs sunburned)
Thanks, the Campbell-Stokes is a pretty good simulation - except it should be black and scorched with smoke coming off it when the sun is shining! :lol:

Re: Sun Plot

Posted: Mon 29 Aug 2016 9:57 pm
by kocher
Thanks, the Campbell-Stokes is a pretty good simulation - except it should be black and scorched with smoke coming off it when the sun is shining! :lol:
:lol: :lol: :lol: :lol: :lol: :lol:

Re: Sun Plot

Posted: Tue 30 Aug 2016 6:54 am
by kocher
Although I know that this topic has been discussed many times, I want to know the configuration you have in Cumulus to sunlight.

My configuration is:

- Sun Threshold (percent): 75
- Solar minimum (W / m2): 50
- Transmission factor: 0.87

Re: Sun Plot

Posted: Tue 30 Aug 2016 8:28 am
by mcrossley
My personal settings are.
SunThreshold=75
RStransfactor=0.85
SolarMinimum=50

But the settings need to be based on your sensor calibration and general sky conditions. It is often hazy even on a clear day around me as I live under flight paths.

Re: Sun Plot

Posted: Tue 30 Aug 2016 8:50 am
by kocher
Understand, thank you very much Mark. :D

One last question:

I see someone has managed to change the border color of the sun.

I'm looking at options GD, but I can not change that border :bash:

Re: Sun Plot

Posted: Tue 30 Aug 2016 9:47 am
by kocher
Solved: ;)

I added a variable "$border":

Code: Select all

$border = imagecolorallocate($img, 255, 0, 0);//// put color to the edge of the circle.
Then, I modified the line:

Code: Select all

imageellipse($img, $plot[$sunPosX][0], $plot[$sunPosX][1], $sunSize, $sunSize, $colSunOutline);
by:

Code: Select all

imageellipse($img, $plot[$sunPosX][0], $plot [$unPosX][1], $sunSize, $sunSize, $border);
http://kocher.es/

Re: Sun Plot

Posted: Tue 30 Aug 2016 10:50 am
by mcrossley
Why not just change $colSunOutline ?

Re: Sun Plot

Posted: Tue 30 Aug 2016 11:30 am
by kocher
Because I was not too sure I was afraid to spoil the whole script :roll:

Re: Sun Plot

Posted: Tue 30 Aug 2016 11:45 am
by kocher
How it would be the SQL query to know the hours / minutes of sunlight? :idea:

Code: Select all

    $query = "SELECT DATE_FORMAT(LogDateTime, '%H%i'), SUM(IsSunny) ".
            "FROM $realtimeTableName " .
            "WHERE LogDateTime >= CURRENT_DATE()";
    $result = $mysqli->query($query);
    if (!$result) {
        die('ERROR - Bad Select Statement (1) - ' . $mysqli->error);
    }

Re: Sun Plot

Posted: Tue 30 Aug 2016 1:37 pm
by mcrossley
I'm not sure I understand the question. The SQL query knows nothing about hours of daylight. It just reads if the sun was shining or not from your realtime table.

Re: Sun Plot

Posted: Tue 30 Aug 2016 4:14 pm
by kocher
Certainly, but ...
Since in realtime table, "IsSunny" field is composed of 0 and 1, I had thought that could be added to the graph, the ability to provide the number of hours/ minutes of sunlight (counting the number of 1).