forked from openradar/cmweather
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DOC: Add example for showing colormaps on a real case.
- Loading branch information
Showing
2 changed files
with
65 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,6 +17,7 @@ dependencies: | |
- sphinx-gallery | ||
- sphinx-copybutton | ||
- sphinx<7.2 | ||
- arm_pyart | ||
- pip | ||
- pip: | ||
- ablog | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
""" | ||
========================================================= | ||
Plotting a Convective System using CVD Friendly Colormaps | ||
========================================================= | ||
This is an example of using both HomeyerRainbow and ChaseSpectral CVD friendly | ||
colormaps for a convective system in Oklahoma. | ||
""" | ||
print(__doc__) | ||
|
||
# Author: Zach Sherman | ||
# License: BSD 3 clause | ||
|
||
from open_radar_data import DATASETS | ||
import matplotlib.pyplot as plt | ||
import pyart | ||
|
||
import cmweather # noqa | ||
|
||
###################################### | ||
# **Download and read in the data** | ||
# | ||
# First we will read in the example data from the repository open_radar_data | ||
# by using a built in fetch function to download the data. | ||
|
||
file = DATASETS.fetch("110635.nc") | ||
|
||
# Read the data using pyart | ||
radar = pyart.io.read(file) | ||
|
||
# Apply a filter to remove ring artifact | ||
gatefilter = pyart.filters.GateFilter(radar) | ||
gatefilter.exclude_last_gates("reflectivity", n_gates=7) | ||
|
||
###################################### | ||
# **Color Vision Deficiency (CVD) Friendly Colormap HomeyerRainbow** | ||
# | ||
# Let's visualize the HomeyerRainbow CVD friendly colormap for the reflectivity | ||
# moment in our data. | ||
|
||
# create the plot using RadarDisplay | ||
display = pyart.graph.RadarDisplay(radar) | ||
fig = plt.figure() | ||
display.plot( | ||
"reflectivity", 0, vmin=-16.0, vmax=64, title="PPI", cmap="HomeyerRainbow", gatefilter=gatefilter, | ||
) | ||
display.set_limits(ylim=[-150, 150], xlim=[-150, 150]) | ||
plt.show() | ||
|
||
####################################### | ||
# **Color Vision Deficiency (CVD) Friendly Colormap ChaseSpectral** | ||
# | ||
# Similar to the previous example, let's visualize the ChaseSpectral CVD | ||
# friendly colormap | ||
|
||
# create the plot using RadarDisplay | ||
display = pyart.graph.RadarDisplay(radar) | ||
fig = plt.figure() | ||
display.plot( | ||
"reflectivity", 0, vmin=-16.0, vmax=64, title="PPI", cmap="ChaseSpectral", gatefilter=gatefilter, | ||
) | ||
display.set_limits(ylim=[-150, 150], xlim=[-150, 150]) | ||
plt.show() |