Author Topic: Mesonet - how to amend current conditions tab settings?  (Read 1068 times)

0 Members and 1 Guest are viewing this topic.

Offline Supercell

  • Member
  • *
  • Posts: 35
    • Dublin Weather
Mesonet - how to amend current conditions tab settings?
« on: September 20, 2016, 08:28:11 AM »
I've installed the mesonet scripts from Saratoga-Weather on http://www.loughlinstown.com/wxmesonetmap.php , I'd like to make a couple of changes and need some help figuring out.
My station is part of the European Weather Network which is pretty big with over 600 members currently. This means that when looking at the current conditions tab there is a lot of station reports.
I'd like to filter by country if possible, in this case just show the Irish and UK reports only, does anyone know how I might do that?

Secondly I'd like to put  message below the table with instructions on how to get added to the map, just a couple of sentences, what would be the correct file to put these into and in what format?

Finally, I'd like to replace the network identifier tab, "ZEUR" in my case to something like "Europe" or "Ireland/UK"



Thanks.

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9257
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Mesonet - how to amend current conditions tab settings?
« Reply #1 on: September 20, 2016, 11:36:34 AM »
What you desire is doable, but somewhat complicated.  There are two mesonet map code sets.  The Global map uses data from the rollup of stations from all the regional networks (global-map.php) and so displays all stations (but without rotating conditions .. tried that, had browser(s) lock up from having too many DOM entities to manage).

The mesonet-map.php scripts address ONE network at a time (only) as they fetch data from the regional hub site for that network -- other networks are not included in the display which does include rotating conditions.

The European network (netID=ZEUR) is the only one that includes multiple countries in its data, so it is possible to see all the UK/Ireland members who have signed up for the European network.  That may include stations from the UK network (or not).  At present, there is no Ireland network (there was one associated with the regional networks, but we discontinued collection as it was taking 100sec to get the JSON data from the net, and the admin(s) were unresponsive to fix the issue despite repeated requests).

So, yes, you can modify the mesonet-map-inc.php to filter the data from the European network, and change the tab to display 'Ireland/UK' if you like.. the programming should be reasonably straight-forward.  The data all comes from the JSON which includes country names for each station.

A simple approach to limit the default display to just Ireland/UK would be to set an override map lat/long/zoom to just show the countries with surrounding oceans.. then when the map opens, the main countries of interest would display.

Hope this helps...

Best regards,
Ken
« Last Edit: September 20, 2016, 11:43:02 AM by saratogaWX »
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline Supercell

  • Member
  • *
  • Posts: 35
    • Dublin Weather
Re: Mesonet - how to amend current conditions tab settings?
« Reply #2 on: September 21, 2016, 07:34:53 AM »
Thanks Ken, that really helped, I wasnt sure where to look to make the changes.

I notice that "mostlycloudy" and "fog" current conditions are rendered with a na.png symbol for example:-
Fog :
Code: [Select]
<tr>
  <td>Belgium</td>
  <td><a href="http://www.weerstationmechelen.be" target="_blank">Sint-Katelijne-Waver</a></td>
  <td align="center"><img src="./MESO-images/na.png" height="25" width="25"
alt="fog" title="fog" /></td>
  <td align="center">19.2</td>
  <td align="center">13.8</td>
  <td align="center">71</td>
  <td align="right" style="padding-right: 10px;">SE&nbsp;<img src="./MESO-images/SE.gif" height="14" width="14"
    alt="Wind from SE" title="Wind from SE" />&nbsp;0.6</td>
  <td align="center">0.8</td>
  <td align="center">0.0</td>
  <td align="center"><table class="RMNETtable"><tr><td>1019.0</td><td></td></tr></table></td>
  <td align="center">Steady</td>
  <td align="center"><span style="display:none;">3.5</span><span class="RMNETcbiL" title="CBI=3.5 @ 19.2C/66.6F, 71%">&nbsp;Low&nbsp;</span></td>
  <td align="center">12:05:13</td>
  <!-- NA load time: U='2016-09-21 11:05:13 GMT'='2016-09-21 13:05 CEST' sec -->
</tr>

and "mostlycloudy"

Code: [Select]
<tr>
  <td>Ireland</td>
  <td><a href="http://www.loughlinstown.com" target="_blank">Loughlinstown</a></td>
  <td align="center"><img src="./MESO-images/na.png" height="25" width="25"
alt="mostlycloudy" title="mostlycloudy" /></td>
  <td align="center">15.0</td>
  <td align="center">11.2</td>
  <td align="center">78</td>
  <td align="right" style="padding-right: 10px;">ESE&nbsp;<img src="./MESO-images/ESE.gif" height="14" width="14"
    alt="Wind from ESE" title="Wind from ESE" />&nbsp;2.4</td>
  <td align="center">3.6</td>
  <td align="center">0.0</td>
  <td align="center"><table class="RMNETtable"><tr><td>1011.7</td><td></td></tr></table></td>
  <td align="center">Steady</td>
  <td align="center"><span style="display:none;">0.9</span><span class="RMNETcbiL" title="CBI=0.9 @ 15.0C/59.0F, 78%">&nbsp;Low&nbsp;</span></td>
  <td align="center">12:06:02</td>
  <!-- NA load time: U='2016-09-21 11:06:02 GMT'='2016-09-21 12:06 BST' sec -->
</tr>

Where should I look to fix these? I'm guessing maybe from line 301 in the mesonet-map-inc.php file (no mostly cloudy listed in the array, but there is fog?

I really appreciate the advice you have given so far, sorry for all the questions.

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9257
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Mesonet - how to amend current conditions tab settings?
« Reply #3 on: September 21, 2016, 12:42:01 PM »
Umm... it's not something you can fix.. it's something I'll have to fix in the collector for the European network conditions.

Currently, the rollup data from the European network (ZEUR-conditions.txt in the cache) shows
Code: [Select]
Ireland Galway 1103|14.4,75,W,2.7,3.6,1011.7,Steady,day_partly_cloudy.gif,Partly Cloudy,10,1.8,1474475065,U='2016-09-21 16:24:25 GMT'='2016-09-21 17:24 BST'
Ireland Kilkenny 1139|13.7,96,W,3.1,3.2,1011.6,Steady,day_rain.gif,Rain,13.1,2.8,1474475252,U='2016-09-21 16:27:32 GMT'='2016-09-21 17:27 BST'
Ireland Loughlinstown 2271|14.3,87,SE,2.4,0.0,1011.1,Steady,na.gif,mostlycloudy,12.2,3.6,1474475224,U='2016-09-21 16:27:04 GMT'='2016-09-21 17:27 BST'
Ireland Waterford 1037|14.1,95,S,1.7,8.1,1011.4,Steady,day_rain.gif,Moderate Rain,13.3,0.6,1474475241,U='2016-09-21 16:27:21 GMT'='2016-09-21 17:27 BST'
It's the lowercase 'mostlycloudy' that results in the 'na.gif' designation for the icon.

I pull (via the northamericanweather.net site) from Henkka's http://euweather.eu/ site every 5 minutes from a JSON feed, and format it to use the same structure as the other regional networks -- He has his own collector process for conditions which is not the same collector used by the other networks.  I have a 'shim' program to make that 'translation'.

It's the same issue with the 'fog' instead of 'Fog'.. I'll fix the 'shim' and the conditions should show the correct icon afterwards.
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9257
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Mesonet - how to amend current conditions tab settings?
« Reply #4 on: September 21, 2016, 01:11:04 PM »
Ok.. I fixed the 'shim' program, so the European conditions should have icons instead of 'N/A' :)

Henkka had snuck a few new conditions descriptions into his feed, and now they are accommodated.
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline Supercell

  • Member
  • *
  • Posts: 35
    • Dublin Weather
Re: Mesonet - how to amend current conditions tab settings?
« Reply #5 on: September 21, 2016, 01:13:44 PM »
Thanks Ken,

Can confirm, all looking good here :)

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9257
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Mesonet - how to amend current conditions tab settings?
« Reply #6 on: September 21, 2016, 01:19:54 PM »
Excellent...

If you have contact with Karl or the other admins at http://www.irelandsweather.com/ , let them know if they would kindly fix the slow response of their mesonet map on the homepage, I could add Ireland back into the regional weather network system and there would be more than just 4 stations in Ireland shown on the map :)
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP