IMPORTANT! The server may go down soon - possibly permanently. Please read the latest post in Announcements and News

Please read the posts in the Announcements section about the current status of Cumulus development now that I have retired

Please read this post before posting

Latest Cumulus release v1.9.4 (build 1099) - Nov 28 2014
Latest Cumulus MX release - v3.0.0 build 3043 Jan 20 2017. See this post for download

Sun Plot

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

Moderators: daj, TNETWeather

User avatar
PaulMy
Posts: 1676
Joined: Sun Sep 28, 2008 11:54 pm
Weather Station: Davis Vantage Pro 2 w/Envoy USB
Operating System: Windows-8
Location: Komoka, ON Canada
Contact:

Re: Sun Plot

Postby PaulMy » Fri Aug 26, 2016 12:57 am

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.

User avatar
mcrossley
Posts: 5194
Joined: Thu Jan 07, 2010 9:44 pm
Weather Station: Davis VP2
Operating System: Stretch Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Sun Plot

Postby mcrossley » Fri Aug 26, 2016 4:04 pm

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: 1676
Joined: Sun Sep 28, 2008 11:54 pm
Weather Station: Davis Vantage Pro 2 w/Envoy USB
Operating System: Windows-8
Location: Komoka, ON Canada
Contact:

Re: Sun Plot

Postby PaulMy » Fri Aug 26, 2016 6:03 pm

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

User avatar
kocher
Posts: 67
Joined: Sat Apr 19, 2014 7:57 pm
Weather Station: Davis Vantage Pro2+
Operating System: Windows 10
Location: San Sebastian - Spain
Contact:

Re: Sun Plot

Postby kocher » Mon Aug 29, 2016 7:23 pm

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: 5194
Joined: Thu Jan 07, 2010 9:44 pm
Weather Station: Davis VP2
Operating System: Stretch Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Sun Plot

Postby mcrossley » Mon Aug 29, 2016 7:47 pm

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: 67
Joined: Sat Apr 19, 2014 7:57 pm
Weather Station: Davis Vantage Pro2+
Operating System: Windows 10
Location: San Sebastian - Spain
Contact:

Re: Sun Plot

Postby kocher » Mon Aug 29, 2016 9:57 pm

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: 67
Joined: Sat Apr 19, 2014 7:57 pm
Weather Station: Davis Vantage Pro2+
Operating System: Windows 10
Location: San Sebastian - Spain
Contact:

Re: Sun Plot

Postby kocher » Tue Aug 30, 2016 6:54 am

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: 5194
Joined: Thu Jan 07, 2010 9:44 pm
Weather Station: Davis VP2
Operating System: Stretch Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Sun Plot

Postby mcrossley » Tue Aug 30, 2016 8:28 am

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: 67
Joined: Sat Apr 19, 2014 7:57 pm
Weather Station: Davis Vantage Pro2+
Operating System: Windows 10
Location: San Sebastian - Spain
Contact:

Re: Sun Plot

Postby kocher » Tue Aug 30, 2016 8:50 am

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: 67
Joined: Sat Apr 19, 2014 7:57 pm
Weather Station: Davis Vantage Pro2+
Operating System: Windows 10
Location: San Sebastian - Spain
Contact:

Re: Sun Plot

Postby kocher » Tue Aug 30, 2016 9:47 am

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: 5194
Joined: Thu Jan 07, 2010 9:44 pm
Weather Station: Davis VP2
Operating System: Stretch Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Sun Plot

Postby mcrossley » Tue Aug 30, 2016 10:50 am

Why not just change $colSunOutline ?

User avatar
kocher
Posts: 67
Joined: Sat Apr 19, 2014 7:57 pm
Weather Station: Davis Vantage Pro2+
Operating System: Windows 10
Location: San Sebastian - Spain
Contact:

Re: Sun Plot

Postby kocher » Tue Aug 30, 2016 11:30 am

Because I was not too sure I was afraid to spoil the whole script :roll:
Image

User avatar
kocher
Posts: 67
Joined: Sat Apr 19, 2014 7:57 pm
Weather Station: Davis Vantage Pro2+
Operating System: Windows 10
Location: San Sebastian - Spain
Contact:

Re: Sun Plot

Postby kocher » Tue Aug 30, 2016 11:45 am

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 Aug 30, 2016 7:43 pm, edited 1 time in total.
Image

User avatar
mcrossley
Posts: 5194
Joined: Thu Jan 07, 2010 9:44 pm
Weather Station: Davis VP2
Operating System: Stretch Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Sun Plot

Postby mcrossley » Tue Aug 30, 2016 1:37 pm

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: 67
Joined: Sat Apr 19, 2014 7:57 pm
Weather Station: Davis Vantage Pro2+
Operating System: Windows 10
Location: San Sebastian - Spain
Contact:

Re: Sun Plot

Postby kocher » Tue Aug 30, 2016 4:14 pm

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


Return to “Web site - General”

Who is online

Users browsing this forum: No registered users and 4 guests