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
Current weather #643
Comments
Perhaps useful, I did a database query against my entire 2017 archive counting up present weather code usages. Here's the entire listing and the top 10 for your quick viewing enjoyment
Of course, some of these codes could be false-positives and bugs with the METAR parsing. |
This comes back to these being human-encoded reports, which aren't necessarily valid. For instance, according to the WMO manual:
So based on that, 'FZBR' is an invalid report. I don't see any similar language for "SG" and intensity, but it's pretty clear in the WMO code listing that you only have 77 -> "Snow grains". So the question I have is: Is this a problem with MetPy's code listing? Or is it really a METAR problem? MetPy is going to have its own METAR parser eventually, so I wonder if the "real" solution is to fix it when parsing METARs. On the other hand, adding a couple more entries to the table to work around data-encoding problems isn't such a big deal (provided such work arounds are documented as such). Anyone have opinions on the matter? |
I have no problems adding "aliases" to the dictionary if it's a relatively common problem and if it's reasonable to map it that way. The other option would be to have the aliases separately that can be used to update that dictionary to a "strict" or "approximate" interpretation of the METAR. |
Today I ran into a problem with '-DRSN'. Currently there are 'DRSN': 36, '+DRSN': 37, 'BLSN': 38,'+BLSN': 39, Does this not already contradict the following quotes (http://www.moratech.com/aviation/metar-class/metar-pg9-ww.html#LDRIFT)
|
Are you accusing me of being inconsistent? 😉 I will say one difference is that WMO code table 4677 lists
Upon further reflection, if you can figure out a sane WMO code to use for the reports you need, I'd merge a PR adding them. |
Sorry, I didn't want to give that impression, I should have phrased it differently :-) I just want to understand how you developed the wx_code_map (to maybe contribute something with a PR). I'll try to figure out how I can help and I'll have a look at the WMO codes. |
If you get stuck anywhere, just holler and we'll be happy to help! 😄 |
@shofer16450 No worries at all, I was completely joking. 😁 |
I did create a Metar parser in python in my individual weather program and created a table in an XML file to verify the precipitation. In some cases I had to modify the text to make valid as there was an error in the text. However I was able to assume the weather reported but it is not always certain in some cases. I know the code was not built in the same structure as Metpy but it could be adapted if you have a need for it. I am using the WMO weather codes but I have noted that the Canadian version can be slightly different. It depends on which version of the code as been used over the years. We do use SG (snow grain) in Canada as it does occur in my location. For drifting or blowing snow, I will need to verify this. |
Noting another code seen in the wild that isn't in our dictionary: '-FZRAGR'. Still not sure whether the table enumerating all the possibilities or some kind of algorithmic approach is better. I mean, an algorithm in general would be better, but I have no idea where to begin with something like that in this case since there's no actual robust, documented procedure that humans do for these. |
I do see those metar reports indicating freezing rain and ice pellets. This would be normal for our area in winter. According to definition for metars, the precipitation goes from most important on the left to least important to the right. So FZRA freezing rain most important combined with GR ice pellets least important. This is how we interpret this obs. |
I am struggling to have the parser correctly handle smoke (FU) as a sensible weather condition. Parsing KFLG 252353Z AUTO 27005KT 10SM FU BKN036 BKN085 22/03 A3018 RMK AO2 SLP130 T02220033 10250 20217 55007= yields NaN for all fields except station ID, date/time, wind direction/speed, and a 10 for sky cover, meaning that the sky cover was not correctly parsed. If I parse KSYR 252354Z 18011KT 10SM FEW180 BKN250 27/12 A3012 RMK AO2 SLP193 T02670122 10294 20267 55002 $= it parses correctly. but if I parse (same METAR, only with the manual addition of smoke) KSYR 252354Z 18011KT 10SM FU FEW180 BKN250 27/12 A3012 RMK AO2 SLP193 T02670122 10294 20267 55002 $= it fails as with the FLG example above. |
Thanks for the report @VORTEXJeff ! I've gone ahead and moved that to it's own issue in #1951, because that's really a problem with the METAR parser. As far as the original issue here, we now have |
(Fixed by #1238) |
I've recently used MetPy's wx_code_map functionality to work with METAR data. From what I've seen I think that there are some entries missing in the dictionary this includes (but there might potentially be a few more):
This can easily be reproduced by importing the wx_code_map as a dictionary interactively and then trying call these keys:
So when calling this is the error message that I get:
My current workaround is to replace these entries in my dataset with something similar in the dictionary, for example I replace FZBR with freezing fog (FZFG instead of FZBR) and snow grains with light intensity with snow grains with moderate intensity (SG instead of -SG):
This is my first "contribution" to a project on GitHub so every comment on how to contribute more efficiently in the future is welcome. I'd be happy to check and add entries to the dictionary if you can point me to a link with the decoding instructions used by MetPy for METARs.
The text was updated successfully, but these errors were encountered: