I have been listening to an audio text book, “College Level Meteorology” by Audiolearn on Audible (I am so fun at parties). I came across a particular section about weather prediction. Currently in our technologically advanced world, we use doppler radars, weather balloons, satellites and super computers to predict the weather. But in the past, people did not have access to this technology. Their weather predictions were not as good as ours are today. Still, some very smart people figured out how to make predictions anyway.
This chapter talked about someone (unnamed in this book unfortunately and I haven’t been able to find it) who predicted the weather based on air pressure and temperature.
Weather is often a result of temperature, humidity and pressure, so if you know these three things.. why could you not make your own rudimentary predictions?
Weather Prediction With Python
My climate model that I created (read about that here) was my first real coding project. So naturally, another coding project is in order.
So I got to work making my own high tech “Weather Prediction Machine 3000 TM” (a series of if / else statements).
For those unfamiliar, an if statement is just where you tell the computer: “if x is true, then do y.” Else statements tell the computer what to do if x is not true, and elif is a weird shortening of “else if”. Elifs tell the computer that “if x is not true, but y is, then do z” for example.
My program uses this to say is temperature, humidity and pressure are x then the weather is going to be y for a number of different combinations.
You can have as many elifs as you like for different scenarios. And my program sure used a lot. It basically went something like this:
If the temperature is x, the humidity is y and pressure is z, then you get weather phenomena a, b and c. Simple.
And indeed it is simple. It made some very broad, basic predictions. They seemed to line up with what the BOM had predicted, but I had forgotten about one of the oldest methods of weather prediction. Cloud reading.
Cloud Reading
My main issue with the old version was that I had no access to or way to process weather front data. That would be way beyond my skill level and I couldn’t find the data for it anyway. My get around for this was clouds.
Clouds form in specific ways in particular conditions. If there is a cold front coming through, you might notice wispy cirrus clouds high in the sky, or you might notice the towering dark cumulonimbus clouds before a thunder storm. Often you can see clouds before the weather system that created them comes your way.

Example of cirrus clouds

Example of cumulonimbus cloud
So once again I used my advanced, technical, programming skills to create more if / else statements.
There are probably much better ways of doing this, and this means that I also have to be able to identify what kinds of clouds there are. Fortunately, I live in the age of Google.
Cloud identification is not too difficult, and they are classified in different groups. I started with the ten basic cloud types. These cloud types are pretty much just different combinations of the four types; cumulus (the big fluffy ones), stratus (the big flat grey ones), cirrus (the wispy ones) and alto (the bumpy ones). For example, a big flat grey cloud that stretches across the sky, but more puffy and less flat looking is probably a combination of stratus and cumulus, a stratocumulus.
Project Outcomes
This rudimentary weather prediction program is actually quite accurate. It gives detailed answers about when and what weather changes to expect. The only flaw in this is that I have to input all the measurements myself. Though it is only three measurements and a cloud type so it’s not too bad.

I could automate this though is to use electronic sensors connected by Bluetooth rather than inputting this manually. Thought this would only work for temperature, humidity, and pressure. Cloud identification would require machine learning and computer vision well beyond my current skill level. Though building a basic weather station is probably not a bad next project.
Of course I could just get a weather station. It would probably be the same price as all the parts too, but where’s the fun in that. (I say now before I spend hours trying to find why it isn’t working).
But that is a project for another time.
Leave a Reply