Welcome to the Cumulus Support forum.

Latest Cumulus MX V3 release 3.28.6 (build 3283) - 21 March 2024

Cumulus MX V4 beta test release 4.0.0 (build 4019) - 03 April 2024

Legacy Cumulus 1 release 1.9.4 (build 1099) - 28 November 2014
(a patch is available for 1.9.4 build 1099 that extends the date range of drop-down menus to 2030)

Download the Software (Cumulus MX / Cumulus 1 and other related items) from the Wiki

Sun Plot

Other discussion about creating web sites for Cumulus that doesn't have a specific subforum

Moderator: daj

User avatar
PaulMy
Posts: 3826
Joined: Sun 28 Sep 2008 11:54 pm
Weather Station: Davis VP2 Plus 24-Hour FARS
Operating System: Windows8 and Windows10
Location: Komoka, ON Canada
Contact:

Re: Sun Plot

Post 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
You do not have the required permissions to view the files attached to this post.
Davis Vantage Pro2+
C1 www.komokaweather.com/komokaweather-ca
MX www.komokaweather.com/cumulusmx/index.htm /index.html /index.php
MX www.komokaweather.com/cumulusmxwll/index.htm /index.html /index.php
MX www. komokaweather.com/cumulusmx4/index.htm
Image
User avatar
mcrossley
Posts: 12756
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Sun Plot

Post 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.
User avatar
PaulMy
Posts: 3826
Joined: Sun 28 Sep 2008 11:54 pm
Weather Station: Davis VP2 Plus 24-Hour FARS
Operating System: Windows8 and Windows10
Location: Komoka, ON Canada
Contact:

Re: Sun Plot

Post 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
Davis Vantage Pro2+
C1 www.komokaweather.com/komokaweather-ca
MX www.komokaweather.com/cumulusmx/index.htm /index.html /index.php
MX www.komokaweather.com/cumulusmxwll/index.htm /index.html /index.php
MX www. komokaweather.com/cumulusmx4/index.htm
Image
User avatar
kocher
Posts: 233
Joined: Sat 19 Apr 2014 7:57 pm
Weather Station: Davis Vantage Pro2+
Operating System: Windows 10
Location: San Sebastian - Spain
Contact:

Re: Sun Plot

Post 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)
Image
User avatar
mcrossley
Posts: 12756
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Sun Plot

Post 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:
User avatar
kocher
Posts: 233
Joined: Sat 19 Apr 2014 7:57 pm
Weather Station: Davis Vantage Pro2+
Operating System: Windows 10
Location: San Sebastian - Spain
Contact:

Re: Sun Plot

Post 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:
Image
User avatar
kocher
Posts: 233
Joined: Sat 19 Apr 2014 7:57 pm
Weather Station: Davis Vantage Pro2+
Operating System: Windows 10
Location: San Sebastian - Spain
Contact:

Re: Sun Plot

Post 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
Image
User avatar
mcrossley
Posts: 12756
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Sun Plot

Post 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.
User avatar
kocher
Posts: 233
Joined: Sat 19 Apr 2014 7:57 pm
Weather Station: Davis Vantage Pro2+
Operating System: Windows 10
Location: San Sebastian - Spain
Contact:

Re: Sun Plot

Post 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:
Image
User avatar
kocher
Posts: 233
Joined: Sat 19 Apr 2014 7:57 pm
Weather Station: Davis Vantage Pro2+
Operating System: Windows 10
Location: San Sebastian - Spain
Contact:

Re: Sun Plot

Post 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/
Image
User avatar
mcrossley
Posts: 12756
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Sun Plot

Post by mcrossley »

Why not just change $colSunOutline ?
User avatar
kocher
Posts: 233
Joined: Sat 19 Apr 2014 7:57 pm
Weather Station: Davis Vantage Pro2+
Operating System: Windows 10
Location: San Sebastian - Spain
Contact:

Re: Sun Plot

Post by kocher »

Because I was not too sure I was afraid to spoil the whole script :roll:
Image
User avatar
kocher
Posts: 233
Joined: Sat 19 Apr 2014 7:57 pm
Weather Station: Davis Vantage Pro2+
Operating System: Windows 10
Location: San Sebastian - Spain
Contact:

Re: Sun Plot

Post 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);
    }
Last edited by kocher on Tue 30 Aug 2016 7:43 pm, edited 1 time in total.
Image
User avatar
mcrossley
Posts: 12756
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Sun Plot

Post 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.
User avatar
kocher
Posts: 233
Joined: Sat 19 Apr 2014 7:57 pm
Weather Station: Davis Vantage Pro2+
Operating System: Windows 10
Location: San Sebastian - Spain
Contact:

Re: Sun Plot

Post 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).
Image
Post Reply