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 4017) - 17 March 2024

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 drop-down menus to 2030)

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

CloudBase script for Cumulus Ver CU1.5

Discussion of Ken True's web site templates

Moderator: saratogaWX

Post Reply
BCJKiwi
Posts: 1255
Joined: Mon 09 Jul 2012 8:40 pm
Weather Station: Davis VP2 Cabled
Operating System: Windows 10 Pro
Location: Auckland, New Zealand
Contact:

CloudBase script for Cumulus Ver CU1.5

Post by BCJKiwi »

18 November 2013
VERSION CU1.5 - see Edits below for update information

23rd Sep 2013
VERSION CU1.4d - see Edits below for update information
This is a completely new script for Cumulus and only Cumulus.
It requires Cumulus 1.9.3 (ver b1059) or later (changed in ver CU1.2).
It is adapted directly from the original Ver2.1 script by Rainer Finkeldeh (rainer@bashewa.com).
All changes and adaptations have been made without reference to any other cloud base script.
It does not, to the best of my knowledge, contain any code from any other cloud base script (apart, of course, from Rainer's original).
It retains all the original credits, copyrights and GNU licence etc.
It has been some 3 months in use with subsequent on-going refinements and testing.
It is offered for use, as is, without any commitment of support but I am open to constructive suggestions and will assist as and when I have the time and inclination.

It utilises a specific tag file for this script delivering only the required tags in the format to suit the script.
It will work with the Saratoga template system or any other website/page provided the server supports a recent version of PHP with GD2 graphics (i.e. pretty much any Apache based webserver).
If using the Saratoga template system, translation is handled as it is for other parts of your website. You will need to add the relevant translation blocks (from samples in cloudbaseCUlang.txt) to suit the languages your site supports.
If not using the Saratoga template system, you may want to check out the HowTo and the ...WinDir.txt and ...lang.txt files which provide for alternative translation methods.

Edit 1, 8th Aug 2013 - have updated the HowTo as I had left out the requirement for the folder ./cache/ in which the metar files are saved.
zip file updated.
(12 downloads)

Edit 2, 8th Aug 2013 - It seems I may not have been clear on the Saratoga translations.
"If using the Saratoga template system, translation is handled as it is for other parts of your website."
This does mean you will have to add the translation blocks for the languages you have set up in Saratoga from the attached cloudbaseCUlang.txt file. Please let me know of additional translations and any errors so this file may be properly maintained.
I have updated some of the translations in the zip package.
(6 downloads)

Edit 3, 9th Aug 2013 - added missing Humidity data! Now Ver CU1.1
If you have already installed Ver CU1.0, you need only replace the cloudbaseCUT.txt file in Cumulus\web, and, the cloudbaseCU.php file on your website.
(14 downloads)

Edit 4, 15th Aug 2013 Now Version CU1.2
NEW cloudbaseCU.php
NEW cloudbaseCUT.txt
Further general code refinements
Updated Timezone handling (only affected non-Saratoga users with server in different timezone from station).
Fixed Windsock (was not changing).
Reworked Latitude handling to provide for Cumulus ver 1.9.3 (b1059) and later.
Improved spacing of caption & Temp, Humidity & Baro text - Thanks Gluepack.
Added text color options - suggested by Beau.
(7 full and 5 update downloads)

Edit 5 25th Aug 2013 Now Version CU1.3
NEW cloudbaseCU.php
NEW cloudbaseCUT.txt
Further general code refinements including
Better layout, bug fix and instructions in the script to handle caption and Wind direction translations for users with $translate = false;
Change windir delivery by Cumulus from compass to degrees to provide for windir translation handling in script

There are now two attachments;
1. For new users:- cloudbaseCU13_Full.zip (updated default configuration 26 Aug 2013 - 6 downloads)
complete verCU1.3 package includes complete system with instructions, script, data file, images, and sample language files.
2. for users of ver 1.0, 1.1 or 1.2:- cloudbaseCU13_Upd.zip (updated default configuration 26 Aug 2013 - 5 downloads)
update package including all files except the images

Edit 6 27th Aug 2013 Now Version CU1.4
NEW cloudbaseCU.php
Updates to Metar decoding to cater for ICAO, and for strings which are not used but may contain substrings which are used for cloud and precipitation.
There are two attachments;
1. For new users:- cloudbaseCU14a_Full.zip (4 more downloads)
complete package includes complete system with instructions, script, data file, images, and sample language files.
2. for users of ver 1.0, 1.1, 1.2 or 1.3:- cloudbaseCU14a_Upd.zip (8 more downloads)
update package including all files except the images.

May I suggest , if you don't already use it or have a tool that does the same thing, that you consider downloading diffmerge as it makes updating existing files with changes from another file very easy.

Edit 7 31st August 2013 ver CU14a
Minor change to re-instate default English windir translations - only relevant when $translate = false; So, unless you are having trouble with the wrong language displaying for Wind direction and don't want to edit the script, no need to download 1.4a to replace 1.4
Also a bit more info in ?html=1
Minor revisions to HowTo file.

Edit 8 1st September 2013 ver CU14b
Minor change to correct line 353 - changes $mostlycloudyCap = 'Scattered'; to $mostlycloudyCap = 'Mostly Cloudy';
You may edit the script directly, or download Update 1.4b to apply this fix.
(4 downloads full, 1 download upd)

Edit 9 9th September 2013 Ver CU14c
Minor bugfix for wxrain test; < 0.1 should be < 0.01 @ line 436 - line numbers may vary with different versions!- only affects non-metric systems.
You may edit the 1.4b script directly, or download Update 1.4c to apply this fix.

Edit 10 23rd September 2013 Ver CU14d
Further bugfix for wxrain test - wrong version posted in ver CU14c - Thanks to Beau (n9mfk) for detailing this issue.
Download Update 1.4d to apply this fix to existing working ver CU1.4c systems.

Edit 11 - 18 November 2013 Ver CU 1.5
Numerous minor refinements
update from version 1.4c or d else download Full package.

Edit 12 - 19 Nov 2013
Added missing ...HowTo to both _Full and _Upd packages plus made available separately for those who are new to the script.

Edit 23 August 2015
NOTE:-
Info just come to light of a bug affecting cloudbaseCU v1.5 for some MX users of ver3.0.0 build 3008 and below;
The users affected are all those in the Northern Hemisphere and those in the Southern hemisphere who have a single digit latitude.
This has been around since this script was first developed and only just now been fully identified - thanks to gluepack and Steve.
The fix is discussed here https://cumulus.hosiene.co.uk/viewtopic.p ... 03#p110303 and in the few posts above along with the easiest solution - a replacement tag file. Steve has changed the code to address this in later builds of MX.

Edit 26 May 2016
If using the Metar option, $getmetar = true; then line 1126 in cloudbaseCU.php should be changed;
from $rawfile = 'http://weather.noaa.gov/pub/data/observ ... /stations/' . $icao . '.TXT';
to $rawfile = 'http://tgftp.nws.noaa.gov/data/observat ... /stations/' . $icao . '.TXT';


Enjoy ;)
You do not have the required permissions to view the files attached to this post.
Last edited by BCJKiwi on Mon 12 Sep 2016 8:29 pm, edited 30 times in total.
n9mfk
Posts: 845
Joined: Sun 10 May 2009 8:52 pm
Weather Station: davis vp2 Serial datalogger
Operating System: Windows 7 64-bit
Location: Springfield, IL

Re: CloudBase script for Cumulus Ver CU1.0

Post by n9mfk »

hi BCJKiwi,
have you thought on inter-grading cutags.php for people that wet to use it with ken's template?
Beau
BCJKiwi
Posts: 1255
Joined: Mon 09 Jul 2012 8:40 pm
Weather Station: Davis VP2 Cabled
Operating System: Windows 10 Pro
Location: Auckland, New Zealand
Contact:

Re: CloudBase script for Cumulus Ver CU1.0

Post by BCJKiwi »

Beau
My personal preference is to create self-contained scripts when they may be used in multiple systems.
i.e. if the script will only work in Saratoga - I will use/extend the CUtags file but if able to be used in other places, then a simple very small file which is standard for all users is my preferred method.
Apart from anything else this means there is a single set of code to maintain.

As this script can be used almost anywhere (not just in a weather website!) it uses its own data file.
User avatar
Werk_AG
Posts: 198
Joined: Sun 13 Jan 2013 8:04 pm
Weather Station: WeatherDuino 4Pro
Operating System: Windows 7
Location: Cercal CDV - Portugal
Contact:

Re: CloudBase script for Cumulus Ver CU1.0

Post by Werk_AG »

Thanks for your work.

It's working fine on my saratoga template.
Image
The freedom to choose the weather instruments you want
User avatar
gluepack
Posts: 460
Joined: Tue 22 Jan 2013 9:20 pm
Weather Station: PCE-FWS 20
Operating System: Win 7 Pro
Location: Zlatina, Bulgaria

Re: CloudBase script for Cumulus Ver CU1.0

Post by gluepack »

Yes, thanks for that, I think. That's what I said about the last one I used and it got dumped pretty quick.

It worked first time, although I was a bit disappointed that there was no cloud showing, despite the fact I could count a thousand out there, but making alwaysShowCloud true displayed some. Just hope it is valid.

Now, I just have to find somewhere to put it. And, it is a pity that these things are always so small, particularly the added data text.

Thanks again, I always appreciate someone doing the leg work.

oh, the humidity is showing (incorrectly) as 0% but then there doesn't appear to be a parameter for it in the txt file

edited to add:
I've added a bit of code to suit my own purposes, in as much as Cumulus reports height in ft and I would rather see in m.
It may not suit the picky but, if you want to use it, you're welcome or modify to your heart's content...

Have added

Code: Select all

$heightUnit         = false;          // true = use the file unit otherwise swap i.e. ft converted to m or m converted to ft
at the end of the variables and...

Code: Select all

if ($heightUnit) {
	} else {
	if ($uomAlt === "m") {
		$cldhgtCU = $cldhgtCU * 3.28084;
		$uomAlt = "ft";
	} else {
		$cldhgtCU = $cldhgtCU * 0.3048;
		$uomAlt = "m";
		}
	}
immediately following...

Code: Select all

// determine cloud height and temp
Lol, on reflection, did I miss a setting in Cumulus?
Image

PWS links: WundergroundIVARNAPR3CWOP/APRSE(W)2048PWSWeatherZLATINABGAwekas10631Twitter@Zlatina_weather
Station type: PCE-FWS 20…Webcam link: View south to edge of Provadisko plateau
User avatar
steve
Cumulus Author
Posts: 26702
Joined: Mon 02 Jun 2008 6:49 pm
Weather Station: None
Operating System: None
Location: Vienne, France
Contact:

Re: CloudBase script for Cumulus Ver CU1.0

Post by steve »

gluepack wrote:Lol, on reflection, did I miss a setting in Cumulus?
If you mean a setting to display cloud base in metres, it's on the display settings screen.
Steve
User avatar
gluepack
Posts: 460
Joined: Tue 22 Jan 2013 9:20 pm
Weather Station: PCE-FWS 20
Operating System: Win 7 Pro
Location: Zlatina, Bulgaria

Re: CloudBase script for Cumulus Ver CU1.0

Post by gluepack »

Of course, you're right. Oh well, it exercised the brain for a few seconds writing the code. A moot point I guess but I would have thought it would have been better with all the other imperial/metric settings in Station Settings. There is enough room there, if you reduced the space between the others.
Image

PWS links: WundergroundIVARNAPR3CWOP/APRSE(W)2048PWSWeatherZLATINABGAwekas10631Twitter@Zlatina_weather
Station type: PCE-FWS 20…Webcam link: View south to edge of Provadisko plateau
BCJKiwi
Posts: 1255
Joined: Mon 09 Jul 2012 8:40 pm
Weather Station: Davis VP2 Cabled
Operating System: Windows 10 Pro
Location: Auckland, New Zealand
Contact:

Re: CloudBase script for Cumulus Ver CU1.0

Post by BCJKiwi »

Gluepack
Thanks for noting the Humidity omission.
I don't usually run with all the variables showing so never noticed it was missing!
If you don't show all the caption data you will find the text size adjusts to fill the available space.
The reason I don't have a lot of variables displayed in the cloudbase graphic is that as I use the Saratoga template and most of the data is displayed elsewhere on the dashboard.
As to where to put it - I replaced the outlook panel with the cloudbase graphic as the outlook is covered by the WU forecast below.
Had to adjust that column width slightly.

Steve
Thanks for answering the Q re cloud height units.
The whole concept of this script is to fully utilise the rich flexibility of Cumulus tags to eliminate unnecessary code in the script.
As a result this script is significantly smaller than the original as using the data directly available from Cumulus means it does not need to do as much work as the original.

zip Package updated in first post.
Last edited by BCJKiwi on Thu 08 Aug 2013 10:27 pm, edited 2 times in total.
User avatar
gluepack
Posts: 460
Joined: Tue 22 Jan 2013 9:20 pm
Weather Station: PCE-FWS 20
Operating System: Win 7 Pro
Location: Zlatina, Bulgaria

Re: CloudBase script for Cumulus Ver CU1.1

Post by gluepack »

Thanks.

I ran up (well purloined components of) a quick dissertation on clouds and incorporated it into that...
http://jerbils.info/saratoga/wxcloudbase.php


btw...
you need only replace ..... the cloudbaseCU.php file on your website.
I think you are oversimplifying it, there are parameters to change, at least.
Last edited by gluepack on Thu 08 Aug 2013 10:34 pm, edited 1 time in total.
Image

PWS links: WundergroundIVARNAPR3CWOP/APRSE(W)2048PWSWeatherZLATINABGAwekas10631Twitter@Zlatina_weather
Station type: PCE-FWS 20…Webcam link: View south to edge of Provadisko plateau
BCJKiwi
Posts: 1255
Joined: Mon 09 Jul 2012 8:40 pm
Weather Station: Davis VP2 Cabled
Operating System: Windows 10 Pro
Location: Auckland, New Zealand
Contact:

Re: CloudBase script for Cumulus Ver CU1.1

Post by BCJKiwi »

Gluepack,
Looks good, the graphic is not as sharp but does work better than I expected when enlarged - it looks bad if reduced.

Did you change the cloudbaseCUT.txt file? - your season is not correct as the latitude is N 43° 14' 15". The tag is <#latitude dp=0> which should deliver the number 43. It's only purpose is to determine N or S hemisphere. The script will not work properly with the format you have but I guess it could be changed to accommodate it if the different format is caused by something else.
User avatar
gluepack
Posts: 460
Joined: Tue 22 Jan 2013 9:20 pm
Weather Station: PCE-FWS 20
Operating System: Win 7 Pro
Location: Zlatina, Bulgaria

Re: CloudBase script for Cumulus Ver CU1.1

Post by gluepack »

I haven't touched the ...CUT.txt file.

You can determine season from that image? lol

Content of server txt file...
19.2 17.5 0.0 2 1018.6 90 0.0 N 207 C mm hPa km/h m N&nbsp;43&deg;&nbsp;14'&nbsp;15" 1 0 0.0 0.0
Image

PWS links: WundergroundIVARNAPR3CWOP/APRSE(W)2048PWSWeatherZLATINABGAwekas10631Twitter@Zlatina_weather
Station type: PCE-FWS 20…Webcam link: View south to edge of Provadisko plateau
BCJKiwi
Posts: 1255
Joined: Mon 09 Jul 2012 8:40 pm
Weather Station: Davis VP2 Cabled
Operating System: Windows 10 Pro
Location: Auckland, New Zealand
Contact:

Re: CloudBase script for Cumulus Ver CU1.1

Post by BCJKiwi »

No, but from cloudbaseCU.php?html=1
The data file should read
19.2 17.5 0.0 2 1018.6 90 0.0 N 207 C mm hPa km/h m 43 1 0 0.0 0.0
not
19.2 17.5 0.0 2 1018.6 90 0.0 N 207 C mm hPa km/h m N&nbsp;43&deg;&nbsp;14'&nbsp;15" 1 0 0.0 0.0
mine reads
15.8 11.8 0.0 8 1018.73 77 6 E 498 C mm hPa km/h m -37 1 1 1528 0.0 0.0
as we are in the southern hemisphere.
wiki says <#latitude dp=5> gives "59.24250", the tag in use is <#latitude dp=0>
This feature has been in effect since b1076 at least b1070 and we are now at b1082. However I see you are still running b1059 - maybe its time to update?
User avatar
PaulMy
Posts: 3775
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: CloudBase script for Cumulus Ver CU1.1

Post by PaulMy »

I have it working http://www.komokaweather.com/weather/cl ... php?html=1 and all seems ok except that in the .php?html=1 view it displays:
"Date/Time : Thu, 08 Aug 2013 17:51:07 (day)
TZ : America/Phoenix (GMT-7 hours)"

where it should be:
Date/Time : Thu, 08 Aug 2013 20:51:07 (day)
TZ : America/Toronto (GMT-4 hours)

I have the settings in cloudbase.php as: "$tz = 'America/Toronto'; // change to suit your local time zone" which is the same as I have for the Saratoga templates Settings.

Thanks for your work and sharing the script,
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
BCJKiwi
Posts: 1255
Joined: Mon 09 Jul 2012 8:40 pm
Weather Station: Davis VP2 Cabled
Operating System: Windows 10 Pro
Location: Auckland, New Zealand
Contact:

Re: CloudBase script for Cumulus Ver CU1.1

Post by BCJKiwi »

Where is the server?
The time appears to be taken from the server.

This is how it worked in the original, I may have to look at how to cater for that difference (assuming the server is in Phoenix!).
User avatar
PaulMy
Posts: 3775
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: CloudBase script for Cumulus Ver CU1.1

Post by PaulMy »

Yes you are right, I am with Godaddy and I think their server is in Arizona.

Thanks,
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
Post Reply