What data format to use for plotting weather symbol with METAR data #2248
-
I'm pulling METAR data from LDM and opening the netCDF files. I'm using the presWeather variable. I'd like to use something like this line to plot the weather symbols on a StationPlot. stn_plot.plot_symbol('W',wx_symbol[mask],current_weather) wx_symbol[mask] = ['' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '-SN' '-SN' '-SN BR' '' '' '-SN' '' '' '-SN BR' 'SN' '-SN' '-SN' '' '-SN BR' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '-SN' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' ''] These would be strings, and I'm getting the following error, and the issue has something to do with the data type. stn_plot.plot_symbol('W',wx_symbol[mask],current_weather) Any thoughts on how to properly format the data to be used like stn_plot.plot_symbol('W',wx_symbol[mask],current_weather)? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi Carol, It looks like the plot_symbol() function is expecting a numeric value that the WMO uses for various METAR weather types. You can see the table MetPy uses here: MetPy/src/metpy/plots/wx_symbols.py Lines 198 to 257 in 749cf07 Maybe try converting your Maybe something like: I may not have the call to |
Beta Was this translation helpful? Give feedback.
Hi Carol,
It looks like the plot_symbol() function is expecting a numeric value that the WMO uses for various METAR weather types. You can see the table MetPy uses here:
MetPy/src/metpy/plots/wx_symbols.py
Lines 198 to 257 in 749cf07