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

Cannot parse where visibility is directional #62

Closed
drmrbrewer opened this issue Jan 30, 2023 · 3 comments
Closed

Cannot parse where visibility is directional #62

drmrbrewer opened this issue Jan 30, 2023 · 3 comments

Comments

@drmrbrewer
Copy link

According to this page:

Visibility can also be listed per direction. 1500SW 2000NE means the visibility to the southwest is 1500 meters and 2000 meters to the northeast.

It seems that this isn't accounted for by this parser... as per this example it gives the following error:

UnexpectedParseError: container.visibility not instantiated

@aeharding aeharding added bug Something isn't working and removed bug Something isn't working labels Jan 30, 2023
@aeharding
Copy link
Owner

Based on the following, page 25-28, it appears as if the directional visibility will always accompany a primary visibility.

https://www.vaisala.com/sites/default/files/documents/Vaisala%20unmanned%20automatic%20weather%20observations%20at%20airports.pdf

The minimum visibility is also included when the visibility in one direction, which is not the prevailing visibility, is less than 1,500 meters or less than 50% of the prevailing visibility and less than 5000 meters. A direction is also added if possible, as N, NE, E, SE, S, SW, W and NW. If the direction cannot be determined like in AUTO metar, NDV (No directional visibility) keyword can be used.

It seems like a visibility with a direction attached will always have a prevailing visibility (without a specific direction). For example

3200 1200SW

Here's you example, but with the above visibility string, working correctly:

https://aeharding.github.io/metar-taf-parser/metar?input=CYVR+301300Z+09006KT+3200+1200SW+2000NE+FEW055+FEW120+M04%2FM06+A3049+RMK+SC1AC1+SC+TR+SLP327

It seems like it may be possible (?) to have more than one minimum visibility directions, but I'm not sure.

Do you have a specific example of a real METAR with a direction but without a prevailing visibility?

@drmrbrewer
Copy link
Author

You may well be right, but it's frustratingly difficult to find a definitive resource.

This reference backs up your theory:

image

But this source only refers to "two groups" (not in addition to a prevailing group):

image

And then this source again suggests there is a prevailing visibility followed by a directional visibility:

image

On balance (and based on the "officialness" of the above sources) it does seem that you're correct that a directional visibility should follow a non-directional visibility.

Happy to close this if you are.

@aeharding
Copy link
Owner

Sounds good! Please let me know if you find anything weird like this in a real METAR and I will reopen this.

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

No branches or pull requests

2 participants