-
Notifications
You must be signed in to change notification settings - Fork 406
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
Color map that more closely matches the NWS mapping #52
Comments
@rankinstudio matplotlib has the |
The metpy colormap for NWS Reflectivity was "painstakingly" :) hand-pulled from the colors on the NWS website long ago, they're not the problem. What you need is what matplotlib calls a "norm", or an instance of the Matplotlib's colormaps handle mapping numbers in the range [0, 1] to colors. The norm handles mapping your actual range of colors to the range [0, 1]. If you don't explicitly pass a norm to something like from matplotlib.colors import Normalize
import matplotlib.pyplot as plt
from metpy.plots import ctables
# READ AND PARSE HERE
cmap = ctables.get_colortable('NWSReflectivity')
plt.pcolor(x, y, data, cmap=cmap, norm=Normalize(-25, 75)) I'm not sure if I got the range exactly right, but I think that should get you started. |
No problem. Glad you're finding this useful. |
I know this was posted a long time ago, but |
@w142236 Yes, the correct call for from metpy.plots import ctables
ctables.registry.get_colortable('NWSReflectivity') If you find this doesn't work for you, please open a new issue and we'll try to get you sorted out. |
Nah it's fine. I think the creator of metpy might have moved things around and changed some of the function names. That isn't too difficult for people with a good IDE like Spyder, but I have to run my code from a command line so I have to look a lot of this stuff up. |
Hey Ryan,
There doesn't seem to be a color map available that closely matches the level II image outputs from the NWS. Is this something that is easily modified?
Thanks!
The text was updated successfully, but these errors were encountered: