Code Monkey home page Code Monkey logo

pytaf's Issues

taf.get_header() shows dates with ordinal suffix

i.e. for taf = pytaf.TAF("TAF AMD KMKE 172034Z 1721/1824 14013G19KT P6SM SCT028 BKN035 BKN250 FM180100 17008KT P6SM SCT035 BKN120 FM181000 17007KT P6SM VCSH BKN040 OVC080 TEMPO 1811/1815 6SM -TSRA BR BKN030CB FM181500 18009KT P6SM VCSH BKN050 FM182100 16012KT P6SM SCT050 BKN150")

After running

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

print(taf.get_header()) shows
{'form': 'taf', 'icao_code': 'KMKE', 'origin_date': '17th', 'valid_till_hours': '24', 'valid_from_hours': '21', 'origin_hours': '20', 'valid_from_date': '17th', 'type': 'AMD', 'origin_minutes': '34', 'valid_till_date': '18th'}

why origin_date, valid_from_date and valid_till_date as the ordinal suffix and not just the day int value?

TAFs with missing issue date/time interpreted incorrectly

I noticed a few TAFs in my dataset that had no issue date/time and that the parser then incorrectly interpreted the valid form/to date/time as issue date/time, e. g.:

'TAF ENBO 0615/0715 03008KT 9999 FEW025 SCT100 BECMG 0615/0618 25010KT PROB30 TEMPO 0621/0708 BKN008'

would be interpreted as

TAF for KQHN issued 07: UTC on the 02nd, valid from :00 UTC on the to 13:00 UTC on the 03rd
Wind: from 270 degrees at 09 knots
Visibility: more than 10 000 meters
Sky conditions: sky clear

Temporarily between 11:00 on the 02nd and 15:00 on the 02nd:
Wind: from 270 degrees at 10 knots gusting to 15 knots
Visibility: 6000 meters
Weather: blowing dust

Gradual change to the following between 12:00 on the 02nd and 13:00 on the 02nd:
Wind: variable at 06 knots
Visibility: 9000 meters
Sky conditions: sky clear
Weather: haze

I am not familiar enough with regex to come up with a sensible solution to this. Is there a way to define that the "valid from/to" expression must be encapsulated by spaces and must contain a /?

Kind regards
Mike

Not parsing the last line in the TAF

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

Add runway visible range support

Request from a user:

I was trying to decode METAR using PyTaf library. The library is very useful and decodes very well except RVR.

For example : METAR VOML 101430Z 28005KT 1000 R24/1200 +TSRA BR FEW004 SCT012 FEW025CB BKN080 26/22 Q1009 NOSIG=

The library ignores  R24/1200. Requesting you to kindly incorporate RVR decoding in PyTaf.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.