ITEC 325

0 comments

Assignment 2

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
    1. Few Clouds <altitude>
    1. Scattered Clouds <altitude>
    1. Broken Clouds <altitude>
    1. Overcast Clouds <altitude>
  10. Temperature
  11. Dew Point
  12. Barometric Pressure
  13. If the token ‘TH’ is present, you should output “Thunderstorms reported in the area”
KEY TO DECODING THE U.S. METAR OBSERVATION REPORT
KEY TO DECODING A METAR REPORT
METARTYPE OF REPORTMETAR: hourly (scheduled) report; SPECI: special (unscheduled) report.
KABCICAO STATION (location) IDENTIFIERFour character ICAO location identifier.
121755ZDATE/TIME groupAll dates and times in UTC using a 24-hour clock; two-digit date and four-digit time; always appended with Z to indicate UTC.
AUTOREPORT MODIFIERAUTO: Indicates a fully automated report with no human intervention. It is removed when an observer logs on to the system. COR: Indicates a corrected observation. No modifier indicates human observer or automated system with human logged on for oversight functions.
21016G24KT 180V240WIND DIRECTION AND SPEEDDirection in tens of degrees from true north (first three digits); next two digits: speed in whole knots; if needed, include character as: Gusts (character) followed by maximum observed speed; always appended with KT to indicate knots; 00000KT for calm; if direction varies by 60o or more and speed greater than 6 knots, a Variable wind direction group is reported, otherwise omitted. If wind direction is variable and speed 6 knots or less, replace wind direction with VRB followed by wind speed in knots.
1SMVISIBILITYPrevailing visibility in statute miles and fractions with space between whole miles and fractions; always appended with SM to indicate statute miles; values <1/4SM reported as M1/4SM.
R11/P6000FTRUNWAY VISUAL RANGEA 10-minute RVR evaluation value in hundreds of feet is reported if prevailing visibility is < or = 1 mile or RVR < or = 6000 feet; always appended with FT to indicate feet; value prefixed with M or P to indicate value is lower or higher than the reportable RVR value. See
-RA BRWEATHER PHENOMENAPresent weather: QUALIFIER Intensity or Proximity – Light “no sign” Moderate + Heavy VC Vicinity: but not at aerodrome; in U.S. METAR, between 5SM and 10SM of the point(s) of observation. Descriptor MI Shallow
BL Blowing BC Patches
SH showers PR Partial
DR Drifting TS Thunderstorm
FZ Freezing WEATHER PHENOMENA Precipitation DZ Drizzle
IC Ice Crystals
UP Unknown
in automated
observations RA Rain
PL Ice pellets SN Snow
GR Hail SG Snow grains
GS Small hail/
snow pellets Obscuration BR Mist (< or = 5/8SM)
SA Sand FU Smoke
HZ Haze VA Volcanic Ash
PY Spray DU Widespread Dust Other SQ Squall
FC Funnel Cloud SS Sandstorm
+FC Tornado/
Waterspout DS Duststorm PO Well developed
dust/sand whirls
BKN015 OVC025SKY CONDITIONCloud amount and height: CLR (In automated METAR reports only, no clouds detected below 12000 feet.); SKy Clear 0/8; FEW 1/8-2/8; SCattered 3/8-4/8; BroKeN 5/8-7/8; OVerCast 8/8; 3-digit height of base in hundreds of feet; followed by Towering CUmulus or CumulonimBus if present. For an observed sky: Vertical Visibility followed by vertical veisibility in hundreds of feet into the obscuration, example: VV004. More than 1 layer may be reported.
06/04TEMPERATURE/DEW POINTEach is reported in whole degrees Celsius using two digits; values are separated by a solidus (/); sub-zero values are prefixed with an M (minus).
A2990ALTIMETERAltimeter setting (in U.S. reports) is always prefixed with an A indicating inches of mercury; reported using four digits: tens, units, tenths, and hundredths.
The following groups are reported in the Remarks section of the METAR report
RMKREMARKS IDENTIFIERRemarks includes clarifying or augmenting data concerning elements in the body of the METAR, additive coded data and maintenance data.
TORNADO, FUNNEL CLOUD or WATERSPOUTTORNADIC ACTIVITYAugmented; report should include TORNADO, FUNNEL CLOUD or WATERSPOUT, time (after the hour) of beginning/end, location, movement; e.g., TORNADO B25 N MOVE E

AO2TYPE OF AUTOMATED STATIONAO1; automated station without a precipitation descriminator. AO2; automated station with precipitation descriminator.
PK WND 20032/25PEAK WINDPK WND dddff(F)/(hh)mm; direction in tens of degrees, speed in whole knots, time in minutes after the hour. Only minutes after the hour is included if the hour can be inferred from the report.
WSHFT 1715WIND SHIFTWSHFT followed by hours and minutes of occurrence. The term FROPA may be entered after the time if it is reasonably certain that the wind shift was a result of a frontal passage.
VIS 3/4V1 1/2VARIABLE PREVAILING VISIBILITYVIS vnvnvnvn vnVvxvxvx vxvx; reported if prevailing visibility is <3 statute miles and variable.

VIS 3/4 RWY11VISIBILITY AT SECOND LOCATIONVIS vvvvv(LOC); reported if different than the reported prevailing visibility in the body of the report.

RAB07BEGINNING AND ENDING OF PRECIPITATION AND THUNDERSTORMSw’w’B(hh)mmE(hh)mm; TSB(hh)mmE(hh)mm, where w’w’ is the present weather precipitation contraction, B indicates began, E indicates ended; (hh) indicates the hour the phenomena began or ended and can be omitted if the hour can be inferred from the report, mm indicates the minutes after the hour the phenomenon began or ended.
CIG 013V017VARIABLE CEILINGCIG hnhnhnVhx hxhx;
reported if the ceiling in the body of the report is < 3000 feet and variable.
CIG 017 RWY11CEILING HEIGHT AT SECOND LOCATIONCIG hhh[LOC]; Ceiling height reported if secondary ceilometer site ceiling value is different than the ceiling height in the body of the report.
PRESFRPRESSURE RISING OR FALLING RAPIDLYPRESRR or PRESFR; pressure rising or falling rapidly at time of observation.
SLP125SEA LEVEL PRESSURESLPppp; sea level pressure reported for ppp in tens, units, and tenths of hPa.
P0003HOURLY PRECIPITATION AMOUNTPrrrr; in tens, units, tenths and hundredths of an inch since last regular hourly METAR. A trace is reported as P0000..
600093- AND 6-HOUR PRECIPITATION AMOUNT6RRRR; precipitation amount, including water equivalent, to nearest 0.01 inches for past 6 hours reported in 00, 06, 12, and 18 UTC observations and for past 3 hours in 03, 09, 15, and 21 UTC observations. A trace is 60000.
T00640036HOURLY TEMPERATURE AND DEW POINTTsnTaTaTa snT’aT’aT’a; reported to nearest tenth of oC; sn: 1 if temperature or dew point below 0oC and 0 if temperature/dew point 0oC or higher.
100666-HOUR MAXIMUM TEMPERATURE1snTxTxTx; maximum temperature for past 6 hours reported to nearest tenth of degree Celsius; reported on 00, 06, 12, 18 UTC reports; sn = 1 if temperature below 0oC and 0 if temperature 0oC or higher..
210126-HOUR MINIMUM TEMPERATURE2snTnTnTn; minimum temperature for past 6 hours reported to nearest tenth of degree Celsius; reported on 00, 06, 12, 18 UTC reports; sn = 1 if temperature below 0oC and 0 if temperature 0oC or higher.
58033PRESSURE TENDENCY5appp; the character (a) and amount of change in pressure (ppp) in tenths of hPa for the past 3 hours.
TSNOSENSOR STATUS INDICATORSRVRNO: RVR missing; PWINO: precipitation identifier information not available; PNO: precipitation amount not available; FZRANO: freezing rain information not available; TSNO: thunderstorm information not available (may indicate augmenting weather observer not logged on); VISNO [LOC} visibility at second location not available, e.g. VISNO RWY06; CHINO [LOC}: (cloud-height- indicator) sky condition at secondary location not available, e.g., CHINO RWY06.
$MAINTENANCE CHECK INDICATORMaintenance is needed on the system.

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

About the Author

Follow me


{"email":"Email address invalid","url":"Website address invalid","required":"Required field missing"}