Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Working individually you will create a series of regular expressions that identify different parts composing a METAR. METARs are reports assembled with a particular format

Working individually you will create a series of regular expressions that identify different parts composing a METAR.

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 homework 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:

  1. the report type: either METAR or SPECI for Special Report
  2. the station identifies (four characters starting with a K)
  3. Day of the month and time the report was filed
  4. If the token AUTO is present, you should output This is a fully automated report
  5. If the token COR is present, you should output This is a corrected observation
  6. Wind direction and speed, wind gusting, and variable wind directions
  7. Visibility in statute miles
  8. Light, medium, or heavy rain (-RA|RA|+RA)
  9. Cloud Conditions: [0 or more occurrences of each of the following]
    1. Sky Clear
    2. Few Clouds
    3. Scattered Clouds
    4. Broken Clouds
    5. Overcast Clouds
  10. Temperature
  11. Dew Point
  12. Barometric Pressure
  13. If the token TH is present, you should output Thunderstorms reported in the area"

If an element or phenomena does not occur, is missing, or cannot be observed, the corresponding group and space are omitted (body and/or remarks) from that particular report, except for Sea-level Pressure (SLPppp). SLPNO shall be reported in a METAR when the SLP is not available.

Example of a decoded METAR:

  • METAR KBWI 031754Z 29008KT 250V320 10SM FEW023 SCT041 BKN080 BKN140 13/07 A3003 RMK AO2 SLP170 60001 T01280067 10133 20072 58002
    • Report type: METAR
    • Location: KBWI
    • Day of month: 03
    • Time: 17:54 UTC
    • Wind: True direction = 290 degrees, Speed: 8 knots
    • Wind direction is variable between 250 and 320
    • Visibility: 10 Statute Miles
    • Clouds: A few , at 2300 feet above sea level
    • Clouds: Scattered , at 4100 feet above sea level
    • Clouds: Broken clouds , at 8000 feet above sea level
    • Clouds: Broken clouds , at 14000 feet above sea level
    • Temperature: 13 degrees Celsius
    • Dew point: 07 degrees Celsius
    • Altimeter: 30.03 inHg

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Information Modeling And Relational Databases

Authors: Terry Halpin, Tony Morgan

2nd Edition

0123735688, 978-0123735683

More Books

Students also viewed these Databases questions

Question

Is SHRD compatible with individual career aspirations

Answered: 1 week ago