Severe weather warnings back

Posted & filed under Weather.

Following on from the previous post, I sat down and rewrote the weather.php script for parsing the Met Office’s severe weather warning page for Highland and Eilean Siar. It took a bit of effort to figure out what was going on in their javascript but it was worth it as the warnings are back and I now have a much better record of the storms, as I can now get access to the messages that accompany the warnings. So I’ve retired the v1 record of storms and moved on to the v2 one, which contains a lot more information. At some point I’ll publish these storm information records on the wiki.

Met Office severe weather warning data structures

Posted & filed under howTo, Weather.

So following on from the previous post about the severe weather warnings broken, I sat down to have a good look at what they did to the site. I used to parse the raw HTML of the page detailing the severe weather warnings for the Highlands and Islands but now it seems that they’ve moved all the warning data into javascript files and the HTML pages just process this and display it. The upshot is that all the processing is now client-side, in the browser, rather than the previous server-side. So just reading the URL using PHP doesn’t work any more as you can’t invoke the client-side javascript.

So after much trawling through HTML and script links in HEAD, I found the two files that matter:

The javascript processing page that displays the warning data:
http://www.metoffice.gov.uk/weather/javascript/warncontrol.js
The javascript file that holds the actual warning data:
http://www.metoffice.gov.uk/weather/javascript/warndata.js

To parse that lot to find out if there are any severe weather warnings for an area of the UK, it’s best to do a worked example. Let’s try and find out if there are any warnings for the Highlands and Eilean Siar area:

http://www.metoffice.gov.uk/weather/uk/he/he_forecast_warnings.html

The first thing to do is look at the source of this page and find the script variable that defines the regionnumber for Highland and Eilean Siar:

<script type=”text/javascript”>regionnumber=2</script>

as you can see, we have a regionnumber of 2 for this area. Next we must look in warncontrol.js to find out what sub regions this region contains, using the wlocations array:

wlocations[2]=["Eilean Siar|1","Highland|2"]

so we have two sub regions in Highland and Eilean Siar, each with their own sub_regionnumber:

Eilean Siar = 1
Highland = 2

So now we have enough information to proceed with the severe weather warning search and to do this, we must now delve into warndata.js. What we have to do is cycle through the wcity array to satisfy the condition:

wcity[c][regionnumber] & sub_regionnnumber > 0

i.e.

for (c=0; c < wcity.length; c++) {
if (wcity[c][regionnumber] & sub_regionnnumber > 0) {
warningName = wname[c]
warningMessage = message[c]
}
}

Let’s see how that applies to our two sub regions. Here’s some real data from a real warndata.js. I’ve truncated the message[0] for clarity:

wname[0] = “Severe Gales & Heavy Rain”
message[0] = “The Met Office is still predicting very windy weather … ”
wcity[0] = ["65534","0","2","3","4095","127","63","63","4194303","511","255","255","255","511","1023","32767","1048575",]

Do we have any warnings for Eilean Siar?
wcity[0][2] = 2

so severe weather for Eilean Siar = (1 & 2) = 0 = no warning

and severe weather for Highland = 2 & 2 = 2 = there is a warning, in this case:
wname[0] = “Severe Gales & Heavy Rain”
message[0] = “”The Met Office is still predicting very windy weather … ”

So we can apply those rules to warndata.js based on the regionnumber for the HTML page for the main area and the sub regions for that area which are defined in warncontrol.js

Now all I have to do is code it!

Winter weather warning stopped

Posted & filed under The Rantorium, Weather.

The winter weather warning parser I wrote in PHP, to load the Met office’s severe weather warning web page has stopped working. So I took a look and they’ve redesigned the page. Not to worry, I’ll just adjust the greps for the new layout. Nope. They’ve trashed it completely. It’s now machine unreadable as it’s all MM_this and MM_that and divs and layers that are auto populated by javascript. So it’s completely useless from a machine’s point of view.

So it got me thinking. How on earth is one to trawl the Semantic Web, looking for interesting content when there is none, as far as a machine is concerned. Seems the combination of Macromedia and Javascript has put the “No Entry” sign up on this particular stretch of the information highway.

Just as the all powerful Daleks were stopped by stairs, so the semantic web grinds to a halt at the foot of the javascript steps.

Phenominal snow

Posted & filed under Weather.

We were at the Orion Mountaineering Club dinner at the weekend and had a mass ascent of the corbett Sgurr nan Eugallt at the head of Loch Hourn. The road over Glen Garry was quite bad with the snow and it was down to one lane at the viewpoint. We’d also had a near miss with a gigantic stag just before Clunie but we were going slow due to the snow and had time to brake and swerve to avoid it. Superb specimen it was too.

Anyway, we made it to the Tomdoun Hotel for the dinner and we all had a mass ascent of Sgurr nan Eugallt. Wading through, in places, waist deep snow. There was even some ice here and there. The amount of snow on the hills was incredible. here’s a pick of Loch Quoich from Spidean Mialach (I think) that a friend took the same day:

As you can see there’s a lot of snow for November in Scotland!

The snow came and the snow went

Posted & filed under Weather.

So yesterday it snowed on Cairngorm. Today it’s all gone and the forecast is for milder weather. They’re forecasting a wet and mild winter this year.

Cairngorm

The snow has arrived!

Posted & filed under Weather.

The mountain forecast has been forecasting snow for the last couple of weeks. It’s now arrived on Cairngorm:

Cairngorm snow

Weather confusion

Posted & filed under Weather.

Well the weather warnings have started again for the winter. Today we’ve had severe gales and torrential rain, enough to fill Dingwall’s streets to 6 feet! Broadford bay was very impressive with huge white breakers rolling in from an angry grey sea and it looked truly wild out beyond the islands.

However, it seems no-one can forecast the weather any more. With this month being the warmest since ninteen-canteen, today’s forecast, according to the main BBC news was southerly gales. BBC Scotland said northerly gales. Both said mild with rain. The mountain forecast said snow to 700m! So take your pick.

It was actually northerly gales and torrential rain. I checked the Cairngorm and Buachaille Etive M??r webcams (see the front page of the blog) but no sign of snow. I even checked the Snowdon one too.
The mountain forecast has been predicting snow for the last week or so but it’s never materialised.

Here’s a composite image I made from the weather charts:

Weather chat

The Redwings finally arrive

Posted & filed under Weather.

The redwings were overdue this year and we were wondering what had happened to them. They normally descend on the rowan tree and eat it clean of berries. We were watching autumnwatch on the telly and it was suggested this year’s delayed redwings were waiting for an east wind to help them over from Scandinavia. Sure enough, we’ve just had a couple of days of strong south easterly winds and this morning they turned up!

The first of the roaring stags

Posted & filed under Weather.

Yesterday was the start of Autumn I think. It was the first day that actually felt cold after the superb summer we’ve had. The leaves were blowing off the trees although mostly they’re not turning yet. The Sound of Sleat was boisterous in a northerly wind. Very autumnal indeed.

This morning about 6am, just as it was getting light there was a cloud inversion over the loch and the peaks of Beinn Sgritheall and Ladhar Bheinn poked high above the layer of grey shifting mists. Everywhere was damp after yesterday’s rain. The light was ochre brown and the loch still and calmn. Then I heard the first stag roar of the rutting season. Sends a shiver down your spine.