Question
METARs are reports assembled with a particular format that is easy to decode with computer systems using regular expressions. These reports typically come in two
METARs are reports assembled with a particular format that is easy to decode with computer systems using regular expressions.
These reports typically come in two forms: North American METARs and International METARs. Create a series of regular expressions that decode each token of information using the North American METAR form.
You can find METAR reports at the following address:
http://weather.noaa.gov/weather/metar.shtml.
In order to find the weather information you need to get a METAR report from any airport you wish utilizing the appropriate code (Baltimore-Washington International is KBWI) and then apply the different regular expressions to identify each token and eventually extract it from the report.
Your submission should be a script that reads a single line METAR from a file named: metar.txt Your script output (to the shell screen) should include:
the report type: either METAR or SPECI for Special Report
the station identifies (four characters starting with a K)
Day of the month and time the report was filed
If the token AUTO is present, you should output This is a fully automated report
If the token COR is present, you should output This is a corrected observation
Wind direction and speed, wind gusting, and variable wind directions
Visibility in statute miles
Light, medium, or heavy rain (-RA|RA|+RA)
Cloud Conditions: [0 or more occurrences of each of the following]
Sky Clear
Few Clouds
Scattered Clouds
Broken Clouds
Overcast Clouds
Temperature
Dew Point
Barometric Pressure
If the token TH is present, you should output Thunderstorms reported in the area
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started