One ritual that every pilot observes before launching into the wild blue yonder (or dark gray muck) is tuning in the Automated Terminal Information Service, or ATIS. The ATIS is a recording, usually updated hourly, that contains a very terse version of the current weather and anything else new that pilots need to know.
ATIS is not the first weather information a pilot will hear before flying. In fact, it is more likely to be the last, after she has gotten a complete legal weather briefing (14 CFR 91.103), but before taking off. Pilots also listen to the ATIS at an airport at which they intend to land.
A similar system, called AWOS (Automated Weather Observation System) is like ATIS, except that it usually only carries the weather (no other info) and always sounds like a robot.
As it turns out, I have a doohickey in my home that 1) can connect to the Internet to get the weather and 2) sounds like a robot. I thought, maybe it would be fun to write an app that simulates ATIS on an Amazon Echo.
This is a rather straightforward Alexa Skill. A user specifies the airport of interest by using its four-letter ICAO identifier. Standard ICAO phonetics are supported. (alpha, bravo, charlie, …)
For example, Chicago O’Hare’s IATA code is ORD, but its complete ICAO code is KORD. You could say:
Alexa, ask airport weather to get kilo oscar romeo delta.
And it would read you the weather in Chicago. The skill also knows the names of many (but by no means all) airports, too, so you can specify an airport that way, too. And if you give only three letters (like an IATA code rather than an ICAO airport identifier), it will try to fill in that fourth letter if you. For European users, you can get the visibility and altimeter settings in metric format.
A few details of the skill:
- written in node.js
- Uses the Alexa Skills Kit API — Amazon handles all the voice stuff
- Runs as a function in AWS Lambda
- Accesses weather data from ADDS.
- Stores user preferences in an AWS DynamoDB (a Mongo-like database thingy)
- Caches weather info from ADDS for up to 5 minutes to reduce load on ADDS
- Whole thing runs in the AWS “Free tier” — which is important, as I’m not going to spend money to host a free app.
One of the more fun aspects of the project was getting to maximal verisimilitude. The ADDS weather source actually provides a METAR, which has a lot of the same information as does the ATIS, but it’s not entirely the same in form or content, so I had to do some translation and adjustment. For example, wind directions in METARs are true-north references, but in ATIS, they are magnetic-north referenced. In Northern California, where I live, that’s a 16.5° difference — not trivial. The program makes the adjustment based on the location of the airport and calculations from the World Magnetic Model.
So this METAR
1 |
KCLT 172152Z 22006KT 10SM FEW018 BKN170 OVC250 17/12 A3013 RMK AO2 SLP199 T01720122 |
becomes:
1 |
charlotte airport weather observation 2 1 5 2 zulu visibility 10 wind 2 1 2 at 6 sky condition few clouds 1 thousand 8 hundred broken 1 7 thousand overcast 2 5 thousand temperature 17 dewpoint 12 altimeter tree 0 1 tree |
There is even code there to try to get the pauses and pacing to be realistic.
Anyway, code is not the cleanest thing I ever did. Such is the case when things start as personal hacks and turn into “sofware.” Check it out on github.
More instructions here: http://toolsofourtools.org/alexa-metars-and-tafs
Update: Since coding this skill, I have added the Terminal Area Forecast (TAF) capability as well. Just as for the forecast.
pretty cool. I was picking a skill to write, but you beat me to this one (and did a really good job).
Thanks, Mark!