Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for three-digit gust reports #77

Merged
merged 2 commits into from
Aug 23, 2023

Conversation

SkySails
Copy link
Collaborator

Parsing the following (simplified) report yields a gust value of 4, which seems to be incorrect.

RKPM 091931Z 34028G043KT

I did some research, and while I found it hard to find "official" sources, I believe that I have found ones that are reputable enough. There also seems to be some degree of disagreement between sources, but I think it would be safe to support an extra digit regardless, as it seems that this does in fact occur in real reports.

Here are some extracts from a few sources with varying amounts of explicit specifications:

The maximum gust during the sampling period is reported when it exceeds the mean speed by 10 knots or more. It is indicated by the letter G which is followed by the gust value.
http://www.bom.gov.au/aviation/data/education/metar-speci.pdf

If gusts exceed the mean wind speed by 10kts or more in the 10 minutes preceding the time of the report, a letter G and 2 more figures are added to indicate the maximum wind speed
https://skybrary.aero/articles/meteorological-aerodrome-report-metar

Gfmfm will be included if gust speeds exceed the mean speed by 10 knots or more in the 10-minute period preceding the observation. If this condition is not met, Gfmfm is omitted. G indicates gusts and fmfm is the peak gust reported, using two or three digits as required.
https://meteocentre.com/doc/metar.html

This PR optionally includes a 3rd digit in the pattern match for gust values. I also added a test, and made sure that I did not break any of the existing ones!

@aeharding
Copy link
Owner

Hi! Thanks for the PR. It appears that there are some formatting issues.

@SkySails
Copy link
Collaborator Author

Sorry about that! For some reason, my editor did not pick up the Prettier config and I had to run it manually. It should be good now!

@SkySails
Copy link
Collaborator Author

Looks like it is now fixed upstream as well! Thanks for opening that issue!

@aeharding aeharding merged commit 2da4c0b into aeharding:main Aug 23, 2023
1 check passed
@aeharding
Copy link
Owner

Should be fixed in 8.0.4! https://aeharding.github.io/metar-taf-parser/metar?input=RKPM+091931Z+34028G043KT

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants