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 mapping of METAR wx codes to WMO numeric codes #504

Closed
dopplershift opened this issue Jul 16, 2017 · 5 comments
Closed

Add mapping of METAR wx codes to WMO numeric codes #504

dopplershift opened this issue Jul 16, 2017 · 5 comments
Labels
Area: Plots Pertains to producing plots good first issue Straightforward issues suitable for new and inexperienced contributors to the project Type: Feature New functionality
Milestone

Comments

@dopplershift
Copy link
Member

This will be useful for plotting weather symbols.

Here's some code I've started for it:

wx_code_map = {'': 0, 'DU':7, 'BLDU':7, 'HZ': 5, 'BR': 10, '-UP':16, 'UP': 16, 'SQ': 18, 'FC': 19,
               'DRSN': 36, 'FG': 45, 'FZFG': 49, '-DZ': 51, 'DZ': 53, '+DZ': 55,
               '-RA': 61, 'RA': 63, '+RA': 65, '-FZRA': 66,
               '-SN': 71, 'SN': 73, '+SN': 75, '-SHRA': 80, 'SHRA': 81, '-SHSN': 85,
               '-TSRA':93, 'TSRA':95, '+TSRA':95, 'PL':0}

I've also attached the relevant WMO manual.

@dopplershift dopplershift added Area: Plots Pertains to producing plots good first issue Straightforward issues suitable for new and inexperienced contributors to the project Type: Feature New functionality labels Jul 16, 2017
@abkenyon
Copy link
Contributor

abkenyon commented Jul 19, 2017

Here is what I filled in for all of the METAR codes I found that are actually used. I was thinking of adding this to the metpy.plots.wx_symbols.py script so that it can be imported with the "current_weather" and 'sky_cover' commands. If there is nothing blatantly missing, I will do a pull request soon (or you can copy and paste yourself...it's not like its an intricate portion of code or anything).

wx_code_map = {'': 0, 'FU':4, 'HZ': 5, 'DU':6, 'BLDU':7, 'PO':8, 'DS':9, 'BR': 10,
               '-UP':16, 'UP': 16, 'THDR':17, 'SQ': 18, 'FC': 19,
               'DS':31, 'SS':31, '+DS':34, '+SS':34, 'DRSN': 36, '+DRSN':37,
               'FG': 45, 'FZFG': 49,
               '-DZ': 51, 'DZ': 53, '+DZ': 55, '-FZDZ':56, 'FZDZ':57, '-DZRA':58, 'DZRA':59, 
               '-RA': 61, 'RA': 63, '+RA': 65, '-FZRA': 66, 'FZRA':67,
               '-SN': 71, 'SN': 73, '+SN': 75, 'SG':79, 'PL':79,
               '-SHRA': 80, 'SHRA': 81, '+SHRA':82, '-SHSN': 85, 'SHSN':86,
               '-TSRA':95, 'TSRA':95, 'TSGS':96, 'TSGR':96, '+TSRA':97,
               'TSDS':98, '+TSGS':99, '+TSGR':99}

@jrleeman
Copy link
Contributor

Thank you Abby! If you want to make a PR, that's great. We can always iterate any there.

@bryanguarente
Copy link
Contributor

I filled in even more of the codes here if it is helpful for this:

wx_codes = {'': 0, 'M':0, '-UP':0, 'UP':0, '+UP':0, 'TSNO':0, 'TS':0, 'VA': 4, 'FU': 4, 'HZ': 5, 'DU':6, 'BLDU':7, 'PO':8, 'VCSS':9, 
            'BR': 10, 'MIFG':11, 'VCTS':13, 'VIRGA':14, 'VCSH':16, '-VCTSRA':17, 'VCTSRA':17, '+VCTSRA':17, 'SQ':18, 'FC':19, 
            'SS':31, '+SS':34, 'DRSN':36, '+DRSN':37, 'BLSN':38, '+BLSN':39,
            'VCFG':40, 'BCFG':41, 'PRFG':44, 'FG':45, 'FZFG':49,
            '-DZ': 51, 'DZ': 53, '+DZ': 55, '-FZDZ':56, 'FZDZ':57, '+FZDZ':57,  
            '-RA': 61, 'RA': 63, '+RA': 65, '-FZRA':66, 'FZRA':67, '+FZRA':67,'-RASN':68, 'RASN':69, '+RASN':69, 
            '-SN': 71, 'SN': 73, '+SN': 75, 'IN':76, 'SG':77, 'IC':78, '-PL': 79, 'PL':79,
            '-SHRA':80, 'SHRA':81, '+SHRA':81, '-SHRASN':83, 'SHRASN':84, '+SHRASN':84, '-SHSN':85, 'SHSN':86, '+SHSN':86, 'SHGR':89, 
            '+SHGR':90, '-TSRA':95, 'TSRA':95, 'TSGR':96, '+TSRA':97, 'TSSA':98, '+TSGR':99}

@dopplershift
Copy link
Member Author

Great! We added some to master in #512. Would you be willing to submit a Pull Request to expand that with the ones you added?

@dopplershift dopplershift added this to the 0.6 milestone Aug 3, 2017
@dopplershift
Copy link
Member Author

Fixed in #512 and #535 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Plots Pertains to producing plots good first issue Straightforward issues suitable for new and inexperienced contributors to the project Type: Feature New functionality
Projects
None yet
Development

No branches or pull requests

4 participants