dmbaturin / pytaf

TAF (Terminal Aerodrome Forecast) and METAR parser and decoder
MIT License
59 stars 23 forks source link

Not parsing the last line in the TAF #17

Open jamayfieldjr opened 5 years ago

jamayfieldjr commented 5 years ago

I would like to also mention that the pytaf program forget the last TAF line.

import pytaf

taf = pytaf.TAF("TAF KIAH 090530Z 0906/1012 02006KT 3SM BR OVC004 FM090700 02008KT 4SM SHRA BR VCSH OVC007 TEMPO 0909/0913 2SM -TSRA BKN007 OVC040CB FM091300 01014G21KT 4SM -RA BR OVC006 FM091800 01017G25KT 6SM -DZ BR BKN012 OVC040 FM092200 01014G23KT P6SM BKN035 OVC090 FM100000 02013KT P6SM SCT120 SCT250 FM100700 03008KT P6SM BKN100 =")

taf = pytaf.TAF("TAF AMD CYMX 090209Z 0902/0924 VRB03KT P6SM OVC010 TEMPO 0902/0904 3SM SHRA BR OVC004 PROB40 0902/0904 VRB15G25KT 11/2SM TSRA BR OVC003CB FM090400 VRB03KT P6SM OVC010 TEMPO 0904/0905 VRB15G25KT 11/2SM TSRA BR OVC003CB FM090500 VRB03KT 3/4SM BR OVC002 TEMPO 0905/0911 2SM -SHRA BR OVC003 PROB30 0905/0911 1/4SM FG VV001 FM091100 VRB03KT WS010/24030KT 3/4SM -SHRA BR OVC002 PROB30 0911/0914 VRB15G30KT 2SM TSRA BR OVC004CB FM091400 24010G20KT 4SM -SHRA BR OVC005 FM091600 24010G20KT P6SM SCT008 OVC015 BECMG 0922/0924 23008KT RMK NXT FCST BY 090600Z =")

decoder = pytaf.Decoder(taf) print(decoder.decode_taf())

output:

TAF amended for CYMX issued 02:09 UTC on the 09th, valid from 02:00 UTC on the 09th to 24:00 UTC on the 09th Wind: variable at 03 knots Visibility: more than 6 statute miles Sky conditions: overcast clouds at 1000 feet

Temporarily between 02:00 on the 09th and 04:00 on the 09th: Visibility: 3 statute miles Sky conditions: overcast clouds at 400 feet Weather: rain showers / mist

Probability 40% of the following between 02:00 on the 09th and 04:00 on the 09th: Wind: variable at 15 knots gusting to 25 knots Sky conditions: overcast cumulonimbus clouds at 300 feet Weather: rain thunderstorms / mist

From 04:00 on the 09th: Wind: variable at 03 knots Visibility: more than 6 statute miles Sky conditions: overcast clouds at 1000 feet

Temporarily between 04:00 on the 09th and 05:00 on the 09th: Wind: variable at 15 knots gusting to 25 knots Sky conditions: overcast cumulonimbus clouds at 300 feet Weather: rain thunderstorms / mist

From 05:00 on the 09th: Wind: variable at 03 knots Visibility: 3/4 statute miles Sky conditions: overcast clouds at 200 feet Weather: mist

Temporarily between 05:00 on the 09th and 11:00 on the 09th: Visibility: 2 statute miles Sky conditions: overcast clouds at 300 feet Weather: light rain showers / mist

Probability 30% of the following between 05:00 on the 09th and 11:00 on the 09th: Visibility: 1/4 statute miles Weather: fog

From 11:00 on the 09th: Wind: variable at 03 knots Visibility: 3/4 statute miles Sky conditions: overcast clouds at 200 feet Weather: light rain showers / mist Windshear: at 1000, wind 240 at 30 KT

Probability 30% of the following between 11:00 on the 09th and 14:00 on the 09th: Wind: variable at 15 knots gusting to 30 knots Visibility: 2 statute miles Sky conditions: overcast cumulonimbus clouds at 400 feet Weather: rain thunderstorms / mist

From 14:00 on the 09th: Wind: from 240 degrees at 10 knots gusting to 20 knots Visibility: 4 statute miles Sky conditions: overcast clouds at 500 feet Weather: light rain showers / mist

From 16:00 on the 09th: Wind: from 240 degrees at 10 knots gusting to 20 knots Visibility: more than 6 statute miles Sky conditions: scattered clouds at 800 feet, overcast clouds at 1500 feet

It complete skips "BECMG 0922/0924 23008KT RMK NXT FCST BY 090600Z"

Don't no if this is the same issue as the other commit because it doesn't parse 0922/0924

jamayfieldjr commented 5 years ago

Resolved its the damn "=" at the end of the TAF which Meteorologists use to designate the end of TAF