Git Product home page Git Product logo

python-metar-taf-parser's Introduction

METAR TAF Parser

Python test

This project provides METAR and TAF parsers.

Install

pip install metar-taf-parser-mivek

Structure

Commons package

This package contains the converter module. The module contains helper functions.

Model package

This package contains multiple modules

  • enum: Contains the enumerations for the project
  • model: Contains the model classes for the project

Parser package

This package contains the parser module with the MetarParser and TAFParser classes.

Model

Enumerations

  • CloudQuantity: Represents the quantity in a cloud layer
  • CloudType: Represents the type of cloud in a cloud layer
  • DepositCoverage: Represents the percentage of a runway covered by the deposit
  • DepositType: Represents the type of deposit on a runway
  • Descriptive: Represents the descriptive part of a weather phenomenon
  • Intensity: Represents the intensity of a weather phenomenon
  • Phenomenon: Represents the phenomenon of a weather phenomenon
  • TimeIndicator: Indicates the time trend
  • WeatherChangeType: Indicate the type of trend
  • IcingIntensity: Represents the intensity of an icing element
  • TurbulenceIntensity: Represents the intensity of a turbulence element

Objects

model.png

Wind

Represents the wind part of a metar, taf or trend

  • speed: int. The speed of the wind
  • direction: str. The cardinal direction of the wind
  • degrees: int. The direction in degrees
  • gust: int. The speed of gust if any, None otherwise
  • min_variation: int. The minimal degree variation of the wind
  • max_variation: int. The maximal degree variation of the wind
  • unit: str. The unit of the speed of the wind.

WindShear

Represents a wind shear in TAF message. This class extends Wind.

  • height: int. The height of the wind shear.

Visibility

Represents the visibility part of a METAR, TAF or trend.

  • distance: str. The distance in meters or nautical miles.
  • min_distance: int. The minimal distance in meters if any.
  • min_direction: str. The direction of the minimal distance if any.

WeatherCondition

Represents the weather part of a METAR, TAF or trend.

  • intensity: Intensity. The intensity of the weather condition if any, None otherwise.
  • descriptive: Descriptive. The descriptive of the weather condition if any, None otherwise.
  • phenomenons: [Phenomenon]. Array of phenomenons of the weather condition.

TemperatureDated

Represents the temperature part of a TAF.

  • temperature: int. The temperature in celsius degrees.
  • day: int. Day of the occurrence.
  • hour: int. Hour of the occurrence.

RunwayInfo

Represents the visibility or the deposit on a runway.

  • name: str. The name of the runway.
  • min_range: int. The minimal visibility distance on the runway.
  • max_range: int. The maximal visibility distance on the runway.
  • trend: str. The trend of the visibility.
  • indicator: str. The indicator on the visual range. M for less than and or P for greater than.
  • deposit_type: DepositType. The type of deposit.
  • coverage: DepositCoverage. The percentage of coverage.
  • thickness: str. The thickness of the deposit.
  • braking_capacity: str. The braking capacity on the runway.

Cloud

Represents a cloud layer in METAR, TAF or trend object.

  • height: int. The height of the layer in feet.
  • quantity: CloudQuantity. The quantity of clouds.
  • type: CloudType. The type of cloud in the layer.

Icing

Represents the icing in a TAF or TAFTrend object.

  • intensity: IcingIntensity. The intensity of an icing.
  • base_height: int. The base height of an icing element in feet.
  • depth: int. The icing layer depth in feet. Adding this to the base height determines the top limit of the icing.

Turbulence

Represents the turbulence in a TAF or TAFTrend object.

  • intensity: TurbulenceIntensity. The intensity of a turbulence.
  • base_height: int. The base height of a turbulence element in feet.
  • depth: int. The turbulence layer depth in feet. Adding this to the base height determines the top limit of the turbulence.

ITafGroups

Class holding turbulence and icing elements.

  • icings: [Icing]. List of icing elements.
  • turbulence: [Turbulence]. List of turbulence elements.

This class is a parent class of TAF and ITafGroups.

AbstractWeatherContainer

Abstract class containing the basic fields of METAR, TAF or trend objects.

  • wind: Wind. The wind. Can be None for trends.
  • visibility: Visibility. The visibility.
  • vertical_visibility: int. The vertical visibility, can be None
  • wind_shear: WindShear. The wind shear object.
  • cavok: bool. Indicates whether the message is CAVOK (Ceiling and visibility OK)
  • remark: str. The remark part of the message.
  • remarks: list[str]. List of remarks. Each element is a different remark or token
  • clouds: [Cloud]. Array of clouds elements.
  • weather_conditions: [WeatherCondition]. Array of weather conditions.

AbstractValidity

Abstract class representing the base of a Validity object.

  • start_day: int. The starting day of the validity.
  • start_hour: int. The starting hour of the validity.

AbstractWeatherCode

Class extending the AbstractWeatherContainer. Abstract parent class of METAR and TAF.

  • day: int. The delivery day of the METAR or TAF.
  • time: datetime.time. The delivery time of the METAR/TAF.
  • message: str. The message of the METAR/TAF.
  • station: str. The station for which the message was issued.
  • trends: [TAFTrend/MetarTrend]. Array of trends
  • flags: [Flag]. Set of flags.
  • auto: bool. Whether the METAR is automated.
  • amendment: bool. Whether the TAF is an amendment.
  • nil: bool. Whether the METAR/TAF is null.
  • canceled: bool. Whether the METAR/TAF is canceled.
  • corrected: bool. Whether the METAR/TAF is a correction.

Metar

Class representing a metar object.

  • temperature: int. The temperature in celsius.
  • dew_point: int. The dew_point in celsius.
  • altimeter: float. The altimeter value in HPa.
  • nosig: bool. Whether the message is nosig: No significant changes to come.
  • runway_info: [RunwayInfo]. Array of runway information.

TAF

Class representing a TAF object.

  • validity: Validity. The validity of the TAF.
  • max_temperature: TemperatureDated. The maximum temperature during the validity of the TAF.
  • min_temperature: TemperatureDated. The minimum temperature during the validity of the TAF.
  • amendment: bool. Whether the TAF is an amendment.

AbstractTrend

Abstract base class for trend.

  • type: WeatherChangeType. The type of change.

MetarTrendTime

Class containing the time of the trend.

  • time: datetime.time. Time of the trend's occurrence.
  • type: TimeIndicator. Type of time change of the trend.

MetarTrend

Represents a trend in a METAR object, this class extends AbstractTrend.

  • times: [MetarTrendTime]. The list of time change of the trend.

TAFTrend

Represent a trend in a TAF object, this class extends AbstractTrend

  • validity: AbstractValidity. The validity of the trend either Validity or FMValidity
  • probability: int. The probability of a trend, can be None.

Validity

Represents the validity timespan of a TAF or TAFTrend, this class extends AbstractValidity.

  • end_day: int. The ending day of the validity.
  • end_hour: int The ending hour of the validity.

FMValidity

Represents the validity of a From trend, extends AbstractValidity

  • start_minutes: int. The starting minute of the trend.

Example

Parse a METAR

Use the method parse(string) of the MetarParser to parse a metar.

from metar_taf_parser.parser.parser import MetarParser

metar = MetarParser().parse('KTTN 051853Z 04011KT 9999 VCTS SN FZFG BKN003 OVC010 M02/M02 A3006')

Parse a TAF

Use the method parse(string) of the TAFParser to parse a TAF message. The message must start with TAF in order to be parsed.

from metar_taf_parser.parser.parser import TAFParser

taf = TAFParser().parse(
    'TAF LFPG 150500Z 1506/1612 17005KT 6000 SCT012 TEMPO 1506/1509 3000 BR BKN006 PROB40 TEMPO 1506/1508 0400 BCFG BKN002 PROB40 TEMPO 1512/1516 4000 -SHRA FEW030TCU BKN040 BECMG 1520/1522 CAVOK TEMPO 1603/1608 3000 BR BKN006 PROB40 TEMPO 1604/1607 0400 BCFG BKN002 TX17/1512Z TN07/1605Z')

Internationalization

The following locales are supported:

  • en (default)
  • fr
  • de
  • pl
  • it
  • ru

To add or complete locales please see CONTRIBUTING

python-metar-taf-parser's People

Contributors

devleaks avatar mivek avatar renovate[bot] avatar umpire274 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

python-metar-taf-parser's Issues

Parsing fails for some METAR data

The decoding works excellently for most situations. The code fails for some special conditions. Some examples are given below. The data is from OGIMET. Is this a known issue?

KCLT 022052Z 200/07KT 170V230 10SM BKN140 OVC250 17/01 A3001 RMK SLP159 T01670011 58023=

KDEN 122053Z 03008KT 10SM TS SCT085CB BKN110 BKN150 BKN200 30/10 A2986 RMK TORNADO B21 8 N MOV UNKN TORNADO E32 AO2 LTG DSNT N AND NE TSB1959E14B45 SLP020 OCNL LTGICCCCG NE AND W TS NE AND W MOV NE T03000100 56002=

KDEN 052153Z 34009KT 10SM FEW080 BKN110 BKN220 33/11 A3000 RMK TORNADO B43 TORNADO E50 AO2 PK WND 33027/2141 RAB29E43 SLP062 TORNADO E50 P0001 T03280106 $=

KDEN 252153Z AUTO 19026G34KT 10SM FEW033 BKN060CB BKN090 BKN180 09/03 A2981 RMK TORNADO E2058 AO2 PK WND 19034/2153 LTG DSNT ALQDS TSB12 SLP066 OCNL LTGICCG NE-S TS E-S MOV NE T00890028 TSNO=

KDEN 062353Z 22009KT 10SM -TSRA BKN060CB BKN080 BKN220 18/13 A3004 RMK AO2 WSHFT 2322 LTG DSNT N RAB18 SLP118 TORNADO E45 FRQ LTGICCG SW-NW TS SW-NW MOV E P0000 60000 T01830128 10250 20172 53001=

KMDW 122353Z 25011G25KT 10SM FEW034 BKN065 BKN095 26/21 A2967 RMK TORNADO B12 8 W MOV NE TORNADO E20 AO2 WSHFT 2326 LTG DSNT NW-NE RAB10E51 TSB18E50 SLP040 OCNL LTGICCG DSNT NW-N-NE CB DSNT ALQDS P0015 60097 T02=

KMIA 151553Z 08011G16KT 10SM BKN037 BKN055 BKN250 32/23 A3005 RMK WATERSPOUT E1454 10SE MIA AO2 SLP177 CB DSNT NE-SE-SW MOV SW T03170233 $=

KMIA 081353Z 36006KT 10SM -RA FEW028 BKN034 OVC050 26/22 A3006 RMK TORNADO B08 TORNADO E19 AO2 RAB25 SLP178 WATERSPOUT E15 P0000 T02610222 $=

KSDF 170655Z 02006KT 7SM SKC 21/17 A3000 RMK AO2 SLP153 T02060167=\



"Zero wind" (`00000KT`) scenario not completely handled

Hello! First of all, thank you for your awesome work on this family of parsers 🙌

I am debugging an issue in the Typescript port of this project, and it seems like the same thing occurs over here and since that other project is a port, I think it's best to work with this upstream first!
The following METAR report incorrectly parses to the wrong unit:

KATL 270200Z 00000MPS

The result, as per https://www.metar-taf-decoder.com, is Wind: Speed : 0 KT Direction : North | 0° - KT instead of MPS.
This is a really small issue, but it has other consequences in the Typescript port which you can read about in the linked issues at the bottom!

Related issues

More details

The culprit seems to be this regex, as it results in the following incorrect matching:

regex = r'^(VRB|00|[0-3]\d{2})(\d{2})G?(\d{2,3})?(KT|MPS|KM\/H)?'

It seems to be there to satisfy this test case, which includes an invalid METAR string according to the specifications I can find. As usual, most are not too explicit on the matter but this is one example:

Wind speeds (ff) are two digits (or three digits if required), in knots.
https://meteocentre.com/doc/metar.html

So I guess this is a case of choosing which case to support. If we change the regex by adding an additional required zero:

(VRB|000|[0-3]\d{2})(\d{2})G?(\d{2,3})?(KT|MPS|KM\/H)?

The unit is now correctly parsed and the speed is correctly registered (not that it matters, it's all zeros anyway)

image

The downside is that the test case will start to fail. Is there a reason behind supporting 0000KT (four digits) specifically? Is it a common occurrence in the real world?

Weather conditions with 1 descriptive + 2 phenomenons or just 3 phenomenons are not recognized

Hello,

Weather conditions with one descriptive and two phenomenons are not recognized. For example for

  1. "CYVM 282100Z 36028G36KT 1SM -SN DRSN VCBLSN OVC008 M03/M04 A2935 RMK SN2ST8 LAST STFFD OBS/NXT 291200UTC SLP940"

there is no weather condition for 'VCBLSN'

  1. 'KDEN 240638Z 01018G30KT 3SM FZDZSN BR BKN014CB OVC019 03/01 A2979 RMK AO2 PK WND 36030/0631 LTG DSNT N AND NE RAB16SNB34 TSB09E28E37B38 FRQ LTGICCCCG OHD-N TS OHD-N MOV N'

there is no weather condition entry for 'FZDZSN'

Also Weather conditions with 3 phenomenons are not recognized. For example for
3. "KEWR 020551Z 03008KT 5SM SNPLRA BR BKN008 OVC012 01/M01 A3013 RMK AO2 RAB29PLB48 SLP201 931000 P0003 60003 T00061011 10017 20006 56028

Strangely, 1 descriptor + 3 Phenomenons or 4 phenomenons work fine.

thanks,
Manoj agrawal

RunwayInfo

RunwayInfo sampes R28/990140
[R28/] Runway 28 or 28L
[9] Runway Deposit: Frozen ruts or ridges
[9] Extent of contamination: 51% to 100%
[01] Depth of Deposit: 1mm
[40] Braking friction coefficient: 0.40

i18n not working

Hello Mivek.

I'm trying to use the new feature i18n for translating strings into locale, IT in my case.

Unfortunately this function not working and messages presented by parser are always in english, also in the case that 'locale' Python function return the right locale

Schermata 2021-05-06 alle 09 55 45

Schermata 2021-05-06 alle 10 19 17

Please take a look and if I can help you in troubleshooting you are welcome.

Alex.

'pip install' don't work correctly

Hi Mivek.

When I try to install from scratch you plugin via 'pip install' obtain the installation about only 'metar_taf_parser_mivek-1.1.0.dist-info' but not the package.

Obtain this result whether when I launch 'pip install metar-taf-parser-mivek' from terminal or when import the package using 'PyCharm' UI functionallity.

Schermata 2021-04-20 alle 11 39 47

Can you help me?

Alex.

TAF parser cannot parse multiple

The library is only able to return the last max/min temperature of TAF.

For example, when using TAFParse on 'TAF VHHH 011700Z 0118/0224 09010KT 7000 FEW020 SCT035 TX21/0207Z TN16/0123Z TN17/0223Z \n TEMPO 0203/0209 33010KT \n TEMPO 0209/0213 VRB05KT', it returns {'_temperature': 17, '_day': 2, '_hour': 23}, corresponding to TN17/0223Z.

image

Add support for remarks PrecipitationBegCommand, PrecipitationEndCommand

Hello! I ❤️ this project. However, I see that the remark commands PrecipitationBegCommand and PrecipitationEndCommand are not in the python implementation.

See the Java implementation:

I'd love support added! I would be happy to make a PR but I'm not a python developer so it may take a bit to get something out there. Let me know.

Probability for TEMPO Group

Hello,

I am trying the TAF parser as below:

x = TAFParser().parse('TAF LFPG 150500Z 1506/1612 17005KT 6000 SCT012 PROB60\nTEMPO 1509/1511 3000 BR BKN006 PROB40')

When I read the probabilities, they are correct
x.trends[0].probability = 60
x.trends[1].probability = 40

however when I check the trend type, I get this for the first trend

x.trends[0].type.value = TEMPO

image

Is this the expected behavior?

thanks,

Manoj Agrawal

Some METAR and TAF report can not be parsed

I use this great library for parse weather report, most of reports are parsed greatly,but some report can not be parsed,like:

METAR ZSNB 050000Z 18005MPS 9999 SCT030CB 26/22 Q1001 BECMG TL002024005G11MPS TSRA=

TAF ZSYT 042112Z 0500/0524 36004MPS 3200 BR FEW002 BKN010 BKN023TX15/0506Z TN11/0521Z TEMPO 0500/0506 1500 -SHRA BKN002 BKN010 BECMG0503/0504 FEW010 BKN023=

please fix it and thank you.

New phenomenon 'FZ'

Hi I want to ask you to add a new phenomenon into 'metar_taf_parser/model/enum.py' into class 'Phenomenon':

FREEZING = 'FZ'

Printing model objects produces output with undesirable line breaks or formatting

Reproduction:

from metar_taf_parser.parser.parser import MetarParser
metar = MetarParser().parse("CYTZ 010000Z AUTO 33013G21KT 9SM -RA BKN017 OVC046 06/05 A2977 RMK SLP084")
print(metar)

Printing the Metar object results in a poorly formatted __repr__ output from #49. As you can see, there are some odd line breaks and indentations, which affects readability.

image

I recommend we remove the line breaks and update the code to use f-strings to fix the issue.

TAF Trends missing visibility

I have tried several TAFs and they all seem to be missing visibility.

TAF AMD KEWR 191303Z 1913/2018 09006KT 5SM -RA BR BKN007 OVC025
FM191600 17007KT P6SM BKN020
FM192100 26008KT P3SM SCT030 SCT050
FM200000 29005KT P4SM SCT050
FM200600 VRB03KT P9SM SCT050

All the "FROM" trends are showing None for the visibility. Other trend data appears to be intact. Only the initial visibility is parsing.

2022-05-24_17-02-00

Thanks
Steph

Error while importing metar-taf-parser library in python

Hello,

I get an error when I try to import metar-taf-parser library in my notebook as below. Strangely this error started showing up only recently. I am using a Macbook.

thanks,
Manoj Agrawal


TypeError Traceback (most recent call last)
Input In [1], in <cell line: 15>()
13 import unicodedata
14 #from python_metar_taf_parser.metar_taf_parser.parser.parser import MetarParser, TAFParser
---> 15 from metar_taf_parser.parser.parser import MetarParser, TAFParser
16 from bs4 import BeautifulSoup

File ~/opt/anaconda3/lib/python3.9/site-packages/metar_taf_parser/parser/parser.py:5, in
2 import re
3 from datetime import time
----> 5 from metar_taf_parser.command.common import CommandSupplier
6 from metar_taf_parser.command.metar import CommandSupplier as MetarCommandSupplier
7 from metar_taf_parser.command.remark import RemarkCommandSupplier

File ~/opt/anaconda3/lib/python3.9/site-packages/metar_taf_parser/command/common.py:6, in
4 from metar_taf_parser.commons import converter
5 from metar_taf_parser.commons.converter import convert_visibility
----> 6 from metar_taf_parser.model.enum import CloudQuantity, CloudType
7 from metar_taf_parser.model.model import Visibility, Wind, WindShear, Cloud, AbstractWeatherContainer
10 def set_wind_elements(wind: Wind, direction: str, speed: str, gust: str, unit: str):

File ~/opt/anaconda3/lib/python3.9/site-packages/metar_taf_parser/model/enum.py:3, in
1 import enum
----> 3 from metar_taf_parser.commons.i18n import _
6 class CloudQuantity(enum.Enum):
7 SKC = 'SKC' # Sky clear

File ~/opt/anaconda3/lib/python3.9/site-packages/metar_taf_parser/commons/i18n.py:10, in
8 localedir = os.path.join(os.path.abspath(os.path.dirname(file)), '../locale')
9 langAvailable = os.listdir(localedir)
---> 10 lang = locale.getdefaultlocale()[0][:2]
11 if lang not in langAvailable:
12 lang = 'en'

TypeError: 'NoneType' object is not subscriptable

Altimeter setting parsing defaults to converting to hectopascals

There are currently two Altimeter commands, AltimeterCommand and AltimeterMercuryCommand. The latter parses the altimeter setting given in inches of mercury. However, it converts it to hectopascals before setting the altimeter value to the metar object.

metar.altimeter = int(converter.convert_inches_mercury_to_pascal(mercury))

This is misleading or can cause confusion because

  • It implicitly changes the numeric value from the original METAR message
  • It does not account for the user country since many still use inHg

I recommend creating an altimeter object to

  • preserve the original unit from the original message
  • store the numeric value for both units

Not an issue but a question

Hi, with the validity and especially the FM objects. Do we extract as a string? Or as a date time? And are they linked in any to the weather that comes after the FM time?

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Ignored or Blocked

These are blocked by an existing closed PR and will not be recreated unless you click a checkbox below.

Detected dependencies

github-actions
.github/workflows/github_release.yml
  • actions/checkout v4
  • actions/create-release v1
.github/workflows/main.yml
  • actions/checkout v4
  • actions/setup-python v5
  • actions/upload-artifact v3
.github/workflows/release.yml
  • actions/checkout v4
  • actions/setup-python v5
.github/workflows/stale.yml
  • actions/stale v9
pep621
pyproject.toml
  • setuptools >=42
pipenv
Pipfile
setup-cfg
setup.cfg

  • Check this box to trigger a request for Renovate to run again on this repository

Error on getting METAR info's

I've installed the new version 1.6.1 and when I run my personal code obtain an error.

This is the my Python code:

`# Create the window
window = sg.Window('METAR and TAF Reader', layout)

while True:
event, values = window.read()
# See if user wants to quit or window was closed
if event == sg.WINDOW_CLOSED or event == 'Quit':
break

try:
    metar = Metar(values['-INPUT-'].upper())

    properties = metar.text_recover()

    metar_parse = MetarParser().parse(properties[1])

...
`

and this is the error I get:

Traceback (most recent call last):
File "/Users/umpire274/Il mio Drive/Development/workspace/PycharmProject/metar_reader/metar_reader.py", line 126, in
metar_parse = MetarParser().parse(properties[1])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/umpire274/Library/Python/3.11/lib/python/site-packages/metar_taf_parser/parser/parser.py", line 230, in parse
command.execute(metar, metar_tab[index])
File "/Users/umpire274/Library/Python/3.11/lib/python/site-packages/metar_taf_parser/command/metar.py", line 65, in execute
runway.thickness = DepositThickness(matches[0][3])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/enum.py", line 695, in call
return cls.new(cls, value)
^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/enum.py", line 1111, in new
raise ve_exc
ValueError: '02' is not a valid DepositThickness

If you need any further infos write me.

Alex.

COR, NIL and CNL flag support

Hello!

I am opening this issue in reference to an issue opened in my typescript port - aeharding/metar-taf-parser#16 regarding support for COR, NIL and CNL.

Examples:

COR (corrected): TAF COR EDDS 201148Z 2012/2112 31010KT CAVOK TEMPO…B BECMG 2018/2021 33004KT BECMG 2106/2109 07005KT

NIL (none): SVMC 211703Z AUTO NIL

CNL (cancelled): TAF VTBD 281000Z 2812/2912 CNL=

CNL and NIL support example in a different library here (parsed as a trend): https://github.com/hsdn/metar-taf/blob/master/src/Metar.php#L278

Human readable summary?

Hi!

First of all, thank you for creating this comprehensive package! It looks very clean and even includes i18n.

However, I'm looking for a convenient way to convert raw METAR and TAF to human readable format just like https://www.metar-taf-decoder.com/ do. I want to integrate it into my telegram bot.

I'm currently using METAR and pytaf packages, but I have to install both and write some customized code to display additional things like airport name etc. into their summary. I wonder if there is a easy way or some example code to achieve the same thing here. What the other two packages does is basically this. It is a very common functionality, so I expect this package should have a similar method to get a summary. Not sure if anyone have the same need, but it seems to be very common. Could you please provide some sample code to construct a summary based on parsed objects?

If such functionality is not available at the moment but PR welcome, I may find some time to draft a PR. No guarantee when I will have some time. Might be months from now.

Thank you!

Wind datas wrongs when MPS

Hello.

I've parsed this METAR string

UNAA 240830Z 34002MPS CAVOK M14/M18 Q1019 R02/190054 NOSIG RMK QFE741

and I find two groups of datas into Wind object:

_speed : 2
_direction : NNW
_degrees : 340
_gust : None
_min_variation : None
_max_variation : None
_unit : MPS

_speed : 5
_direction : S
_degrees : 190
_gust : None
_min_variation : None
_max_variation : None
_unit : KT

This problem is generated by regex string into class WindCommand:

regex = r'(VRB|\d{3})(\d{2})G?(\d{2})?(KT|MPS|KM\/H)?'

that catches two strings matching the regex: 34002MPS and 19005

I've solved deleting the last ? in regex string.

regex = r'(VRB|\d{3})(\d{2})G?(\d{2})?(KT|MPS|KM\/H)'

Check if this is true also for your test.

Previous Meteorological State is not parsed

Great work on the library, thanks for such a comprehensive effort!

We have noticed that the previous weather state is not taken into account while parsing the METAR Code:
METAR LTAE 250250Z VRB02KT 9999 BKN030 BKN080 06/05 Q1005 RESHRA NOSIG RMK RWY21 07004KT 040V100

We don't see anything related to RESHRA (past shower rain).

Is this out of scope or are we missing something? We are using the https://www.metar-taf-decoder.com for testing.

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.