Usage#

Installing cmweather#

cmweather can be installed in three ways:

Using the conda package manager that comes with the Anaconda/Miniconda/Mamba distribution:

$ mamba install cmweather --channel conda-forge

Using the pip package manager:

$ python -m pip install cmweather

To install a development version from source:

$ git clone https://github.com/openradar/cmweather
$ cd cmweather
$ python -m pip install -e .

Use cmweather In Your Scripts/Notebooks#

You can use cmweather colormaps as you would use matplotlib colormaps in your workflow.

The first step is to import cmweather.

import cmweather

Using “Traditional” Colormaps#

We can also use other colormaps such as the National Weather Service (NWS) Reflectivity (NWSRef) colormap with our plot

import cmweather
import numpy as np
import matplotlib.pyplot as plt

# Create some synthetic data
x = np.arange(1, 100)
y = np.arange(1, 100, .5)
x_2d, y_2d = np.meshgrid(x, y)
temps = (x_2d + y_2d)/2

# Plot our data and add a colorbar
color = plt.pcolormesh(temps, cmap='NWSRef')
plt.colorbar(color);
_images/f74b1a05a46cad0774538513f9b2275554b4fe8b1bdfbe043535912f4060412c.png

A full list of colormaps can be found in the Reference section of the docs