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

issue with airports not reporting flight_category lighting up as VFR with low visibility being reported #23

Open
benshaw5 opened this issue Dec 26, 2022 · 1 comment

Comments

@benshaw5
Copy link

I've tried out a few different metar builds for the map I built, and this one is by far the nicest to use. I did run into one issue, however.

I had a couple of airports lighting up as VFR even though they have low visibility being reported. Looking at the logs, these airports were not reporting ceilings or flight categories. After digging around a bit, I found this in lines 1259-1263 of the metar-v4.py:

   #visibilty can also set flight category. If the clouds haven't set the fltcat to LIFR. See if visibility will
            if flightcategory != "LIFR": #if it's LIFR due to cloud layer, no reason to check any other things that can set flight category.
                if metar.find('./forecast/visibility_statute_mi') is not None: #check XML if visibility value exists
                    visibility_statute_mi = metar.find('./forecast/visibility_statute_mi').text   #get visibility number
                    visibility_statute_mi = float(visibility_statute_mi)

I'm not sure if this is the root of the problem (I'm not great with python), but changing the two instances of metar.find('./forecast/visibility_statute_mi') to metar.find('visibility_statute_mi') to grab the reported visibility seems to have resolved the issue and the problem airports are now lighting up according the visibility rules. With no forecast data or ceilings being reported, I think the code was just keeping the VFR assumption.

@markyharris
Copy link
Owner

markyharris commented Dec 26, 2022 via email

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