Welcome to the Cumulus Support forum.

Latest Cumulus MX release 3.9.6 (build 3101) - 20 January 2021 (please see announcement regarding releases since 3.5.0)
Legacy Cumulus 1 release v1.9.4 (build 1099) - 28 November 2014 (a patch is available for 1.9.4 build 1099 that extends the date range of the NOAA report and Snow Index drop-down menus to 2030)

Use this Wiki link to Download the Software (Cumulus MX / Cumulus 1 and other related items).

Sun Plot

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

Moderator: daj

User avatar
beteljuice
Posts: 3100
Joined: Tue 09 Dec 2008 1:37 pm
Weather Station: None !
Operating System: W10 - Threadripper 16core, etc
Location: Dudley, West Midlands, UK

Re: Sun Plot

Post by beteljuice »

I think there maybe other errors in your script ??

Yes - without sunshine you get a daylight graph, but whilst nighttime is a nice curve, daytime is a sharp triangle.
Image
......................Imagine, what you will KNOW tomorrow !

Matt.j5b
Posts: 495
Joined: Mon 28 Nov 2011 2:13 am
Weather Station: Davis VP2 with DFARS
Operating System: RPi Raspbian (Buster)
Location: Ferny Grove, Brisbane, Australia
Contact:

Re: Sun Plot

Post by Matt.j5b »

Maybe the script doesn't like my latitude at 27 S., because if I try the script with a higher latitude it has a nicer curve to it. I am not seeing any php error. The peak solar elevation at this time of year is about 85 degrees, so the solar elevation increases pretty quickly during the day. The sharp triangle is not far off from reality however.

Regarding the sunshine, I have sunshine data available in the MySql realtime table and we been getting sunshine. But when I enable the plotting of this sunshine the image won't render at all. The script works fine if I don't enable the plotting of sunshine, as I have on the website homepage.
Regards, Matt of Brisbane, Australia
Ferny Grove Weather
Image

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

Re: Sun Plot

Post by mcrossley »

If you run this query against your realtime SQL tabe, what do you get?...

Code: Select all

SELECT DATE_FORMAT(LogDateTime, '%H%i'), IsSunny
FROM Realtime
WHERE LogDateTime >= CURRENT_DATE() AND IsSunny = 1
ORDER BY LogDateTime ASC

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

Re: Sun Plot

Post by mcrossley »

Ah! I just spotted in my copy of the script, at line 60...

Code: Select all

$blEnabled = true;
That should only be set if you are using a Blake-Larsen sun recorder file.

EDIT: The download copy has it set to false - panic over!

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

Re: Sun Plot

Post by mcrossley »

I just set a copy of the script on my server to be 27.5 South. Here is the result...
sunplot-27.jpg
It plots the sunshine OK, but as the beteljuice pointed out the curve is all wrong :(
You do not have the required permissions to view the files attached to this post.

Matt.j5b
Posts: 495
Joined: Mon 28 Nov 2011 2:13 am
Weather Station: Davis VP2 with DFARS
Operating System: RPi Raspbian (Buster)
Location: Ferny Grove, Brisbane, Australia
Contact:

Re: Sun Plot

Post by Matt.j5b »

I get no data from that query because the sun hasn't risen yet here yet.

If I instead run to grab yesterday numbers:

Code: Select all

SELECT DATE_FORMAT(LogDateTime, '%H%i'), IsSunny
FROM Realtime
WHERE LogDateTime >= DATE_ADD(CURDATE(), INTERVAL -1 DAY) AND IsSunny = 1
ORDER BY LogDateTime ASC
I get:

Code: Select all

0734	1
0735	1
0736	1
0737	1
0740	1
0741	1
0743	1
0743	1
0744	1
0745	1
0746	1
0747	1
0748	1
0749	1
0750	1
0926	1
0934	1
0935	1
0936	1
0937	1
0954	1
0955	1
0956	1
0957	1
1005	1
1006	1
1007	1
1008	1
1009	1
1010	1
1011	1
1012	1
1013	1
1014	1
1015	1
1016	1
1017	1
1018	1
1019	1
1020	1
1021	1
1022	1
1023	1
1024	1
1025	1
1026	1
1027	1
1028	1
1029	1
1030	1
1031	1
1032	1
1033	1
1034	1
1035	1
1036	1
1037	1
1038	1
1039	1
1040	1
1041	1
1042	1
1043	1
1044	1
1045	1
1046	1
1047	1
1048	1
1049	1
1050	1
1051	1
1057	1
1058	1
1059	1
1100	1
1101	1
1102	1
1103	1
1104	1
1105	1
1106	1
1107	1
1108	1
1230	1
1231	1
1232	1
1233	1
1234	1
1235	1
1400	1
1401	1
1402	1
1403	1
1404	1
1405	1
1406	1
1407	1
1439	1
1440	1
1441	1
1442	1
1443	1
1444	1
1445	1
1446	1
1447	1
1448	1
1620	1
1621	1
1622	1
1708	1
1709	1
1714	1
1803	1
1804	1
Regards, Matt of Brisbane, Australia
Ferny Grove Weather
Image

Matt.j5b
Posts: 495
Joined: Mon 28 Nov 2011 2:13 am
Weather Station: Davis VP2 with DFARS
Operating System: RPi Raspbian (Buster)
Location: Ferny Grove, Brisbane, Australia
Contact:

Re: Sun Plot

Post by Matt.j5b »

Mark, Just wondering but does that SQL output I provided help with working out why the script doesn't work for me?
Regards, Matt of Brisbane, Australia
Ferny Grove Weather
Image

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

Re: Sun Plot

Post by mcrossley »

Sorry for the late reply - but no it doesn't, that is what I expected :(

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

Re: Sun Plot

Post by mcrossley »

The plot is going wrong in the southern hemisphere though, but only during daylight hours! I can't see why at the moment.

Matt.j5b
Posts: 495
Joined: Mon 28 Nov 2011 2:13 am
Weather Station: Davis VP2 with DFARS
Operating System: RPi Raspbian (Buster)
Location: Ferny Grove, Brisbane, Australia
Contact:

Re: Sun Plot

Post by Matt.j5b »

Thanks for the update anyway.

Let me know if you need anything else or if you want any testing, if you manage to figure out what happening here.
Regards, Matt of Brisbane, Australia
Ferny Grove Weather
Image

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

Re: Sun Plot

Post by mcrossley »

I don't have a lot of time to look at this at the moment. But it appears to be a problem in astro calculation.

What the problem with the sunshine plot is, I have no idea at the moment.

Matt.j5b
Posts: 495
Joined: Mon 28 Nov 2011 2:13 am
Weather Station: Davis VP2 with DFARS
Operating System: RPi Raspbian (Buster)
Location: Ferny Grove, Brisbane, Australia
Contact:

Re: Sun Plot

Post by Matt.j5b »

Thanks Mark.

For me, showing the sunshine on the plot is more of a nice to have.

So I am fine with whenever you may get the time to figure this one out, hopefully.:)
Regards, Matt of Brisbane, Australia
Ferny Grove Weather
Image

Post Reply