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/40c1fa93c5d36b5a3584e67e7ba1c9a673d829e778d2c8f684e45e033a299735.png

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