A Zambretti weather forecaster

When I was recovering from my stem cell transplant last year, I built a weather forecaster. It uses a Raspberry Pi, a BME280 sensor and a 20×4 character LCD screen. The forecasting algorithm I’d written for it was rudimentary, to say the least. However, earlier on this year I came across a device known as a Zambretti forecaster. These were made by Negretti and Zambra for the UK market in the 1920s.

The Zambretti device uses air pressure, the direction of change, season and wind direction to make a forecast. Depending on what you believe on t’internet, a forecast accuracy of 90% is possible. You can buy replicas from a popular forest-based e-commerce site if you want to. I didn’t, but with the help of a search engine and a number of people who’ve been down this route before, wrote my own Zambretti forecasting algorithm. In FORTRAN 77 naturally.

The results so far have been encouraging. However, I’m of the opinion that the accuracy I’m perceiving may be due to the Forer effect, rather than the goodness of the algorithm. It’s true that different barometric conditions do produce different forecasts. However, I remain unsure as to the real difference between Fine : showers possible, Fair : showers likely and Fairly fine : showers. Not much I suspect.  

Anyway, it was producing good enough results to invest a few more pounds in a second LCD display. This retrieves the forecast made by the Raspberry Pi and sensor covered in cobwebs in the garage and displays it in more comfortable surroundings. This time I’ve stuck to C as my language of choice.

Raspberry Pi 4B plus a 20x4 LCD screen showing a Zambretti weather forecast
A Raspberry Pi 4B plus a 20×4 LCD screen, showing a Zambretti weather forecast all the way from my garage.

The current release of my Zambretti forecaster with remote display screen, with instructions, is available on github. Some (most) of the code could definitely do with improvement …

edX 6.00x week 2 – simple algorithms and (hopefully) teething problems

I’ve now completed the first two weeks of 6.00x and so far I’ve found it to be fairly straightforward fare – which given my background is a relief! Week 1 had no marked problem set, as we were asked to install a specific version of Python – this one.

So week 2’s problem set has been the first real test, consisting of writing three small modules of code using some simple algorithms. The first problem required writing code to show the impact of making minimum payments on a credit card balance. The second required code to calculate to the nearest $10 the minimum monthly payment required to clear the balance in a year. The third problem was identical – but required an implementation of the bisection method to calculate to the nearest cent the minimum monthly payment so that the program would complete its computation within a reasonable amount of time.

Unlike 6.002x, the course team aren’t publishing lectures and problem sets a week in advance, so this is going to make the course more difficult to plan around life in general. That seems a step backwards to me, as does the implementation of the discussion forums using what I assume is some kind of AJAX interface. I’ve largely ignored them so far as it’s just too tedious to use – especially on a slow connection or an iPad. Worse than this however is that the incredibly useful tagging functionality used in 6.002x discussion forum also appears to have been removed as well. But at least the ridiculous karma system from 6.002x has gone and has been replaced with a simple ‘upvote’ system, allowing useful discussions to still be found while not allowing the abuse of power that was sometimes evident.

The big advance on 6.002x is that the slides used in the video lectures aren’t handwritten – and so are actually legible. However, at the moment, the Python code windows are a bit blurry and hard to read. The course team have promised that this aspect will be improved in later lectures.

So all in all, one step forwards and two or three back compared to the delivery of 6.002x. But the content so far is everything that I’d expect from a first year university level introduction to computation and programming, so I’ll be sticking with it.

Welcome to edX 6.00x

I’ve had an email this morning welcoming me to the edX 6.00x course and letting me know that the course website has opened. 6.00x promises to teach the basics of computer programming using Python and the fundamentals of computation. Given that my first degree was in Computer Science and I spent the first ten or so years of my career as a C and FORTRAN programmer, I’m hoping it’s going to be a gentle reminder and a bit of a busman’s holiday. Of course, much has changed in programming since the mid 1980s (not least the fashion for object orientation) so it’s also going to be interesting to see how the basics are taught today. I see from the syllabus they’ve published that the old favourites, including recursion and sorting algorithms, are all still present!

Welcome to edX 6.00x
Welcome to edX 6.00x

The assessment and grading scheme seems a little different to the 6.002x course I took earlier on this year. This time, you get marks for completing the ‘finger exercises’ (5%) that are included in the lecture sequences, 15% for the weekly tests, there are two mid-term exams (one at the start of November and the other in December) both worth 20% each and a final exam in mid-January, worth the remaining 40%. You also only get a 3 hour window to complete each of the midterm and final exams instead of the very generous 24 hour window which was offered on the original presentation of 6.002x.

Pass marks are a little different from 6.002x as well – This time 80% will secure an ‘A’, 65% a ‘B’ and 55% a ‘C’.

I’m looking forward to getting started properly next Monday when the first lectures are released – and there’s still time to join me on this adventure if you want to by registering for free at edX.