Cloud Height Graphic v2.1

Bashy change the lines at 640 to the code below and it will work so long as you do not need language translations


// Add wind direction text
if ($showWindDir) {
   $txtD  = (windDEGtoDIR($winddir));
  //   $txtD  = ($winddir);          //gives wid dir by angle
   $sizD = strlen($txtD)*imagefontwidth(3);
   imagestring ( $slate, 3, 86-round($sizD/2), 174, $txtD, $white);
}

You will have to translate the strings below if WD reports the conditions in any other language other than English.
Look at your WD Solar/UV setup description for the actual strings. $sunny = 'clear,sunny'; // for sunny $partlycloudy = 'partly cloudy,mostly clear'; // for some clouds $scattered = 'scattered'; // for clouds $mostlycloudy = 'mostly cloudy,stopped raining'; // for many clouds $overcast = 'cloudy,overcast,recent rain'; // for overcast $thunderclouds = 'cumulonimbus,cumulus'; $drizzle = 'drizzle,shower'; $raining = 'rain,thunderstorm'; $snowing = 'snow,flurries'; $misty = 'mist,fog'; $rainstopped = 'recent rain,stopped raining,recent showers';

Thanks. I will look at it.

VERSION HISTORY: 02 May 2009 V1.0 First release. 02 May 2009 V1.1 Fixed translation issue for non-multilingual web sites. 02 May 2009 V1.2 Added "dry" to the "clear,sunny" match string. Added German match strings ... please un-comment to use.
Grab the latest release for cloud-base.php below.


cloud-base-update.zip (12 KB)

TRANSLATIONS FOR THE CLOUD MATCH
I have translated the following cloud condition match strings into German.
The best way to see what WD reports is in your clientraw.txt file.
If anybody does another language translation could you please post it here.

GERMAN TRANSLATION for the cloud condition match:`
$sunny = ‘klar,sonnig,trocken’; // for sunny
$partlycloudy = 'teilweise bewölkt,grö

[quote author=gorpett link=topic=39180.msg323772#msg323772 date=1241254738]
Hi Rainer

Very nice script indeed.

But I get an error message about a “cb.jpeg” image that I can not find.

See here > http://www.goranpettersson.se/cloud-base.php?uom=M&html=1

Regards
G

Working fine here (http://www.harpersferry-weather.com/cloud-base.php?uoe=M&html=1). Thanks for the script. I would love to get this into the dashboard in the Snow section (http://www.harpersferry-weather.com/wxindex.php). I’ve tried several different things but I’m not very savy with php. Can anyone provide me with the code needed to add into this area and what I would need to remove?

Thanks,

John

Rainer

Fantastic script easy to setup, now I have find a place to put it :slight_smile:
I went to your site and was amazed at the WMR200 console (http://www.bashewa.com/wxconsoleWMR200.php)
As WMR200 owner I love that script I think most WMR200 owners would love that script too
Great work Thanks

John,

You need to put

<img src="cloud-base.php?uom=E" height="200" width="100" border="0" />

where you want to have the image located on your page.

If you want to replace the “Snow” section of your dashboard, find

  if ($useSNOW) {  //  Show Snow
?>
              <tr>
                <td class="data1">Today: </td>
                <td style="text-align: right;" class="data1">
                   <?php
                      if ($useCM) 
                          echo $snowtodaycm . " CM";
                      else    
                          echo $snowtodayin . $uomRain;
                   ?> 
				</td>
              </tr>
              <tr>
                <td class="data1">Yesterday:</td>
                <td style="text-align: right;" class="data1">
                    <?php
                      if ($useCM) 
                          echo $snowyesterday . " CM";
                      else    
                          echo $snowyesterday . $uomRain;
                   ?> 
				 </td>
              </tr>
              <tr>
                <td class="data1"><?php  echo $monthname . ":" ?> </td>
                <td style="text-align: right;" class="data1">
                   <?php
                      if ($useCM) 
                          echo $snowmonthcm . "CM";
                      else    
                          echo $snowmonthin . $uomRain;
                   ?> 
                </td>
              </tr>
              <tr>
                <td class="data1">Season Total:<sup>2</sup></td>
                <td style="text-align: right;" class="data1">
                   <?php
                      if ($useCM) 
                          echo $snowseasoncm . " CM";
                      else    
                          echo $snowseasonin . $uomRain;
                   ?> 
				</td>
              </tr>
              <tr>
                <td class="data1">Snow Depth: </td>
                <td style="text-align: right;" class="data1">
                   <?php
                      if ($useCM) 
                          echo $snownowcm . " CM";
                      else    
                          echo $snownowin . $uomRain;
                   ?>
				</td>
              </tr>
              <tr>
                <td class="data1" colspan="2" style="text-align: center;">
				  <?php echo "$snowdaysthismonth snow day";
					   $t = ($snowdaysthismonth > 1)? 's':'';
					   print "$t in " . $monthname;
					   ?>
                </td>
              </tr>
              <tr>
                <td class="data1" colspan="2" style="text-align: center;">
				  <?php echo "$snowdaysthisyear snow day";
					   $t = ($snowdaysthisyear > 1)? 's':'';
					   print "$t in all " . $date_year .".";
					   ?>
                </td>
              </tr>
<?php } // end $useSNOW  ---------------------------------------- ?>

and replace it with something like

  if ($useSNOW) {  //  Show Snow
?>
              <tr>
                   <td><img src="cloud-base.php?uom=E" height="200" width="100" border="0" />
                   </td>
              </tr>
<?php } // end $useSNOW  ---------------------------------------- ?>

Thanks for the update, now working, although i aint overly keen on having to have my root
set to write so i will move it to another dir update the settings to suit,

I aint sure but the my current conditions are showing as overcast, yet the image is mostly
cloudy, METAR is turned off as well so i aint sure where its getting mostly cloudy from?
http://www.northantsweather.com/cloud-base.php?uom=M&html=1

Create a file gb.jpeg in the same directory as your could-base.php "touch gb.jpeg" You may also have to set the permissions for the file depending on your server "chmod 644 gb.jpeg" Also you may have to the file cb.jpeg to the name.group the httpd is running under.

Hi jmoriartey

I don’t seem to solve this.
I have tried what you suggested but no change.
It shows all the data except cloud height.

I have a different meter for cloud height and that one works well.

http://www.goranpettersson.se/wxgauges.php

G

[quote author=gorpett link=topic=39180.msg323798#msg323798 date=1241277496]
Hi jmoriartey

I don’t seem to solve this.
I have tried what you suggested but no change.
It shows all the data except cloud height.

I have a different meter for cloud height and that one works well.

http://www.goranpettersson.se/wxgauges.php

G

I let the problem be for a few hours and when I returned to continue debugging, it worked.
So everything is okay now,

thanks jmoriartey

G

I’ve still got lots of work to do on the WMR200 Console script.
I’ll release it when I’ve got it completely done.

Hi Bashy,
Try pressing CTRL-F5 or add a buster like this:
http://www.northantsweather.com/cloud-base.php?uom=M&html=1&buster=123

The mostly cloudy is appended from this tag in testtags.php: $weatherreport = ‘%weatherreport%’;

Hi Rainer,

Thanks for the script, I have it running on my dashboard, however there doesn’t seem to be an arrow showing the cloud height?

If I use the test page http://wx.theshackbythebeach.com/wx/cloud-base.php?uom=M&html=1&test=1
it works Ok. If I used the prior code I could also see cloud height, but not now:

Old code:

<div style="position: relative;  width: 50px;">
                  <span class="ajax" id="ajaxcloudheight" style="position: absolute; top:45px; left: 11px; color: black; font-size: 9px; font-weight: bold;" ><?php echo $cloudheightfeet; ?>&nbsp;ft</span>
                  <span class="ajax" id="ajax_CBH_last_arrow" style="position: absolute; top:35px; left: 22px; " ></span>
                  <img src="/wx/cloud-height.png" alt="Min. possible Cloud Base Height Above Ground Level" title="Min. possible Cloud Base Height Above Ground Level" />
                                   
			      </div>

Any ideas why I can’t see the cloud height?
Cheers

If your weather report is “clear, sunny or dry” there will be no cloud and cloud height arrow.
What I can add is something like this:

$alwaysShowCloud = true;

… an then use the “cb-cld-cloudband.png” for the cloud like WD does.

That would be good … cheers

Hi Rainer, thanks, that makes sense and its looking ok good today :slight_smile:

I do have one other question that might be difficult…

I like to see my Temps in Celsius but when you set that the wind then shows in
kmh, but i prefer the wind in mph, is there a way to add a setting so the wind
can be in mph and the temp in C please?

Also, if the Metar is not used would it be possible to have it so it dont say Metar at all please?

Sorry for being a pain…

Changes/additions requested by Bashy and vk2him.

OPTIONAL PARAMETERS ADDED: uom= [ M | E] .................... set units-of-measure (M)etric or (E)glish wind= [ kts | mph | kph | km/h ] .. set uom for wind alti= [ ft | m ] .................. set uom for cloud altitude rain= [ mm | in ] ................. set uom for rain baro= [ hPa | kPa | inHg ] ......... set uom for barometer temp= [ C | F ] ................... set uom for temperature humi= [ 0 | 1 ] ................... 1=show humidity cond= [ 0 | 1 ] ................... 1=show conditions cloud=[ 0 | 1 ] ................... 1=always show clouds when sunny or clear. metar=[ <code> | empty ] .......... get NOAA METAR for given code. Disable if empty. WDlang= [ en | de ] ............... language in WD clientraw.txt file test= [ 1..5 ] ..................... use preset conditions for drawing picture html= [ 0 | 1 ] .................... 1=output html code for testing, 0=save picture only [color=red][i]PS: passing any of the above parameters will always override the internal settings.[/i][/color]
VERSION HISTORY: 02 May 2009 V1.0 First release. 02 May 2009 V1.1 Fixed translation issue for non-multilingual web sites. 02 May 2009 V1.2 Added "dry" to the "clear,sunny" match string. Added German match strings ... select with [color=blue][i]$WDLanguage=de[/i][/color] or [color=blue][i]?WDlang=de[/i][/color] parameter. 03 May 2009 V1.3 Added extra parameters for overriding specific UOM's. Added [color=blue][i]$alwaysShowCloud[/i][/color] when conditions are sunny or clear. Added [color=blue][i]$alwaysShowMPH[/i][/color] if wind speed should be in MPH for metric UOM.

LATEST UPDATE FOR cloud-base.php BELOW


cloud-base-update.zip (13.2 KB)