Skip to content

Commit

Permalink
Merge branch 'release/2.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
zssherman committed Oct 4, 2024
2 parents d21f61f + 00dd386 commit a3f8d72
Show file tree
Hide file tree
Showing 28 changed files with 87 additions and 2,998 deletions.
1 change: 1 addition & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ The required dependencies to install Py-ART in addition to Python are:
* `Cython <https://cython.readthedocs.io/en/latest/>`_
* `setuptools <https://setuptools.pypa.io/en/latest/index.html>`_
* `cartopy <https://scitools.org.uk/cartopy/docs/latest/>`_
* `cmweather <https://cmweather.readthedocs.io/en/latest/>`_

A working C/C++ compiler is required for some optional modules. An easy method
to install these dependencies is by using a
Expand Down
2 changes: 2 additions & 0 deletions continuous_integration/environment-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,5 @@ dependencies:
- versioneer
- black
- open-radar-data
- ruff
- cmweather
4 changes: 2 additions & 2 deletions doc/source/blog_posts/2022/hail-analysis-spc.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@
" ax=ax,\n",
" embellish=False,\n",
" add_grid_lines=True,\n",
" cmap=\"pyart_ChaseSpectral\",\n",
" cmap=\"ChaseSpectral\",\n",
" vmin=-20,\n",
" vmax=70,\n",
")\n",
Expand Down Expand Up @@ -1064,7 +1064,7 @@
" projection=projection,\n",
" resolution=\"10m\",\n",
" gatefilter=gatefilter,\n",
" cmap=\"pyart_ChaseSpectral\",\n",
" cmap=\"ChaseSpectral\",\n",
" colorbar_flag=False,\n",
" lat_lines=[0, 0],\n",
" lon_lines=[0, 0],\n",
Expand Down
1 change: 1 addition & 0 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ dependencies:
- xradar
- mda-xdrlib
- pip
- cmweather
- pip:
- wheel
- watchdog
Expand Down
4 changes: 2 additions & 2 deletions examples/mapping/plot_compare_two_radars_gatemapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@
disp1 = pyart.graph.RadarMapDisplay(radar_se)
disp1.plot_ppi_map(
"reflectivity_bias",
cmap="pyart_balance",
cmap="balance",
title="Reflectivity Difference \n XSAPR Southwest - XSPAR Southeast",
sweep=1,
ax=ax,
Expand Down Expand Up @@ -216,7 +216,7 @@

# Create a 1-1 comparison
x, y = np.meshgrid((bins[:-1] + bins[1:]) / 2.0, (bins[:-1] + bins[1:]) / 2.0)
c = plt.pcolormesh(x, y, np.log10(hist.T), cmap="pyart_HomeyerRainbow")
c = plt.pcolormesh(x, y, np.log10(hist.T), cmap="HomeyerRainbow")

# Add a colorbar and labels
plt.colorbar(c, label="$log_{10}$ counts")
Expand Down
16 changes: 6 additions & 10 deletions examples/plotting/plot_choose_a_colormap.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
######################################
# **Plot the available colormaps**
#
# Let's see which colormaps are available directly from Py-ART!
# Let's see which colormaps are available in Py-ART from the colormap package cmweather!
# We use a helper function from matplotlib to plot this.

# Setup some helper functions and ranges to visualize our colormaps, from matplotlib
Expand All @@ -40,11 +40,11 @@ def plot_color_gradients(cmap_category, cmap_list):
axs[0].set_title(cmap_category + " Colormaps", fontsize=14)

for ax, cmap_name in zip(axs, cmap_list):
ax.imshow(gradient, aspect="auto", cmap=f"pyart_{cmap_name}")
ax.imshow(gradient, aspect="auto", cmap=f"{cmap_name}")
ax.text(
-0.01,
0.5,
f"pyart_{cmap_name}",
f"{cmap_name}",
va="center",
ha="right",
fontsize=10,
Expand Down Expand Up @@ -158,14 +158,10 @@ def plot_color_gradients(cmap_category, cmap_list):
######################################
# **Plot Using a Colormap from Py-ART**
#
# Let's use one of our Py-ART's colorbars now! We need
# to remember to add the pyart_ string in front of the
# colormap, as shown below.
# Let's use one of our cmweather's colorbars now!
# Setup a display to plot the data

display = pyart.graph.RadarDisplay(radar)

# Start by plotting a regular matplotlib colormap (Spectral_r)
display.plot(
"reflectivity_horizontal", vmin=-32, vmax=64.0, cmap="pyart_HomeyerRainbow"
)
# Now let's plot with a CVD-friendly colormap (HomeyerRainbow)
display.plot("reflectivity_horizontal", vmin=-32, vmax=64.0, cmap="HomeyerRainbow")
4 changes: 2 additions & 2 deletions examples/plotting/plot_cross_section.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
display.plot_grid(
"corrected_reflectivity_horizontal",
ax=ax1,
cmap="pyart_HomeyerRainbow",
cmap="HomeyerRainbow",
vmin=-20,
vmax=70,
)
Expand All @@ -72,7 +72,7 @@
start,
end,
x_axis="lat",
cmap="pyart_HomeyerRainbow",
cmap="HomeyerRainbow",
vmin=-20,
vmax=70,
)
4 changes: 2 additions & 2 deletions examples/plotting/plot_modify_colorbar.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
vmax=60,
embellish=False,
norm=None,
cmap="pyart_HomeyerRainbow",
cmap="HomeyerRainbow",
)

# Add gridlines
Expand Down Expand Up @@ -100,7 +100,7 @@
vmax=60,
embellish=False,
norm=None,
cmap="pyart_HomeyerRainbow",
cmap="HomeyerRainbow",
)

# Add gridlines
Expand Down
4 changes: 1 addition & 3 deletions examples/plotting/plot_ppi_mdv.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
display = pyart.graph.RadarDisplay(radar)
fig = plt.figure(figsize=[5, 5])
ax = fig.add_subplot(111)
display.plot(
"reflectivity", 0, vmin=-16.0, vmax=64, title="PPI", cmap="pyart_HomeyerRainbow"
)
display.plot("reflectivity", 0, vmin=-16.0, vmax=64, title="PPI", cmap="HomeyerRainbow")
display.set_limits(ylim=[-150, 150], xlim=[-150, 150])
plt.show()
2 changes: 1 addition & 1 deletion examples/plotting/plot_rhi_cfradial_singlescan.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
mask_outside=True,
title="RHI",
axislabels=(xlabel, ylabel),
cmap="pyart_HomeyerRainbow",
cmap="HomeyerRainbow",
colorbar_label=colorbar_label,
ax=ax,
)
Expand Down
5 changes: 1 addition & 4 deletions examples/plotting/plot_rhi_data_overlay.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,6 @@
ax = fig.add_subplot(111)

# plot velocity
# cmap is the color ramp being used in this case blue to red no 18
# https://github.com/ARM-DOE/pyart/blob/master/pyart/graph/cm.py
# for more information

display.plot(
"velocity",
Expand All @@ -41,7 +38,7 @@
vmax=20.0,
fig=fig,
ax=ax,
cmap="pyart_BuDRd18",
cmap="balance",
colorbar_label="Velocity (m/s)",
)

Expand Down
2 changes: 1 addition & 1 deletion examples/plotting/plot_rhi_two_panel.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
# Fields to plot and ranges
fields_to_plot = ["reflectivity_horizontal", "mean_doppler_velocity"]
ranges = [(-20, 20), (-17.0, 17.0)]
cmaps = ["pyart_HomeyerRainbow", "pyart_balance"]
cmaps = ["HomeyerRainbow", "balance"]

# Plot the data
nplots = len(fields_to_plot)
Expand Down
6 changes: 3 additions & 3 deletions examples/plotting/plot_three_panel_gridmapdisplay.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,14 @@
vmax=vmax,
ax=ax1,
projection=projection,
cmap="pyart_HomeyerRainbow",
cmap="HomeyerRainbow",
)
display.plot_crosshairs(lon=lon, lat=lat)

# Panel 2: longitude slice
ax2 = fig.add_axes(x_cut_panel_axes)
display.plot_longitude_slice(
"REF", lon=lon, lat=lat, ax=ax2, vmin=vmin, vmax=vmax, cmap="pyart_HomeyerRainbow"
"REF", lon=lon, lat=lat, ax=ax2, vmin=vmin, vmax=vmax, cmap="HomeyerRainbow"
)

ax2.set_ylim([0, 15])
Expand All @@ -65,7 +65,7 @@
# Panel 3: latitude slice
ax3 = fig.add_axes(y_cut_panel_axes)
display.plot_latitude_slice(
"REF", lon=lon, lat=lat, ax=ax3, vmin=vmin, vmax=vmax, cmap="pyart_HomeyerRainbow"
"REF", lon=lon, lat=lat, ax=ax3, vmin=vmin, vmax=vmax, cmap="HomeyerRainbow"
)
ax3.set_ylim([0, 15])
ax3.set_xlim([-50, 50])
Expand Down
14 changes: 7 additions & 7 deletions examples/plotting/radar-cross-section.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
"display.plot_grid(\n",
" \"corrected_reflectivity_horizontal\",\n",
" ax=ax1,\n",
" cmap=\"pyart_HomeyerRainbow\",\n",
" cmap=\"HomeyerRainbow\",\n",
" vmin=-20,\n",
" vmax=70,\n",
")\n",
Expand All @@ -99,7 +99,7 @@
" start,\n",
" end,\n",
" x_axis=\"lat\",\n",
" cmap=\"pyart_HomeyerRainbow\",\n",
" cmap=\"HomeyerRainbow\",\n",
" vmin=-20,\n",
" vmax=70,\n",
")"
Expand Down Expand Up @@ -167,7 +167,7 @@
" start,\n",
" end,\n",
" x_axis=\"lon\",\n",
" cmap=\"pyart_HomeyerRainbow\",\n",
" cmap=\"HomeyerRainbow\",\n",
" vmin=-20,\n",
" vmax=70,\n",
")"
Expand Down Expand Up @@ -298,7 +298,7 @@
"ds.corrected_reflectivity_horizontal.isel(z=0).plot(\n",
" x=\"lon\",\n",
" y=\"lat\",\n",
" cmap=\"pyart_HomeyerRainbow\",\n",
" cmap=\"HomeyerRainbow\",\n",
" vmin=-20,\n",
" vmax=60,\n",
" ax=ax,\n",
Expand All @@ -319,7 +319,7 @@
"fig = plt.figure()\n",
"ax = plt.subplot(111)\n",
"ds.corrected_reflectivity_horizontal.isel(z=0).plot(\n",
" x=\"lon\", y=\"lat\", cmap=\"pyart_HomeyerRainbow\", vmin=-20, vmax=60, ax=ax\n",
" x=\"lon\", y=\"lat\", cmap=\"HomeyerRainbow\", vmin=-20, vmax=60, ax=ax\n",
")\n",
"ax.scatter(start[1], start[0], label=\"Start Point\", color=\"tab:blue\")\n",
"ax.scatter(end[1], end[0], label=\"Start Point\", color=\"k\")\n",
Expand Down Expand Up @@ -347,7 +347,7 @@
"fig = plt.figure(figsize=(10, 8))\n",
"title = r\"($^\\circ$N)\"\n",
"cross.corrected_reflectivity_horizontal.plot(\n",
" cmap=\"pyart_HomeyerRainbow\",\n",
" cmap=\"HomeyerRainbow\",\n",
" x=None,\n",
" y=\"z\",\n",
" vmin=-20,\n",
Expand Down Expand Up @@ -438,7 +438,7 @@
" grid, \"corrected_reflectivity_horizontal\", start, end\n",
")\n",
"cross.corrected_reflectivity_horizontal.plot(\n",
" cmap=\"pyart_HomeyerRainbow\",\n",
" cmap=\"HomeyerRainbow\",\n",
" x=None,\n",
" y=\"z\",\n",
" vmin=-20,\n",
Expand Down
2 changes: 1 addition & 1 deletion examples/retrieve/plot_composite_reflectivity.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,5 @@
ax2 = plt.subplot(122)
composite_display = pyart.graph.RadarDisplay(compz)
composite_display.plot(
"composite_reflectivity", ax=ax2, vmin=-20, vmax=80, cmap="pyart_HomeyerRainbow"
"composite_reflectivity", ax=ax2, vmin=-20, vmax=80, cmap="HomeyerRainbow"
)
104 changes: 47 additions & 57 deletions pyart/default_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -1493,64 +1493,54 @@ def spectrum_width_limit(container=None, selection=0):

DEFAULT_FIELD_COLORMAP = {
# field name : colormap
reflectivity: "pyart_HomeyerRainbow",
corrected_reflectivity: "pyart_HomeyerRainbow",
total_power: "pyart_HomeyerRainbow",
signal_to_noise_ratio: "pyart_Carbone17",
velocity: "pyart_BuDRd18",
corrected_velocity: "pyart_BuDRd18",
simulated_velocity: "pyart_BuDRd18",
eastward_wind_component: "pyart_BuDRd18",
northward_wind_component: "pyart_BuDRd18",
vertical_wind_component: "pyart_BuDRd18",
spectrum_width: "pyart_NWS_SPW",
normalized_coherent_power: "pyart_Carbone17",
differential_reflectivity: "pyart_RefDiff",
corrected_differential_reflectivity: "pyart_RefDiff",
clutter_filter_power_removed: "pyart_RefDiff",
cross_correlation_ratio: "pyart_RefDiff",
logarithmic_cross_correlation_ratio: "pyart_RefDiff",
differential_phase: "pyart_Wild25",
unfolded_differential_phase: "pyart_Wild25",
corrected_differential_phase: "pyart_Wild25",
specific_differential_phase: "pyart_Theodore16",
corrected_specific_differential_phase: "pyart_Theodore16",
linear_depolarization_ratio: "pyart_SCook18",
linear_depolarization_ratio_h: "pyart_SCook18",
linear_depolarization_ratio_v: "pyart_SCook18",
circular_depolarization_ratio: "pyart_SCook18",
rain_rate: "pyart_RRate11",
radar_estimated_rain_rate: "pyart_RRate11",
radar_echo_classification: "pyart_LangRainbow12",
hydroclass_entropy: "pyart_LangRainbow12",
proportion_AG: "pyart_LangRainbow12",
proportion_CR: "pyart_LangRainbow12",
proportion_LR: "pyart_LangRainbow12",
proportion_RP: "pyart_LangRainbow12",
proportion_RN: "pyart_LangRainbow12",
proportion_VI: "pyart_LangRainbow12",
proportion_WS: "pyart_LangRainbow12",
proportion_MH: "pyart_LangRainbow12",
proportion_IH: "pyart_LangRainbow12",
specific_attenuation: "pyart_Carbone17",
differential_phase_texture: "pyart_BlueBrown11",
height: "pyart_SCook18",
interpolated_profile: "pyart_SCook18",
noisedBZ_hh: "pyart_HomeyerRainbow",
noisedBZ_vv: "pyart_HomeyerRainbow",
reflectivity: "HomeyerRainbow",
corrected_reflectivity: "HomeyerRainbow",
total_power: "HomeyerRainbow",
signal_to_noise_ratio: "Carbone17",
velocity: "BuDRd18",
corrected_velocity: "BuDRd18",
simulated_velocity: "BuDRd18",
eastward_wind_component: "BuDRd18",
northward_wind_component: "BuDRd18",
vertical_wind_component: "BuDRd18",
spectrum_width: "NWS_SPW",
normalized_coherent_power: "Carbone17",
differential_reflectivity: "RefDiff",
corrected_differential_reflectivity: "RefDiff",
clutter_filter_power_removed: "RefDiff",
cross_correlation_ratio: "RefDiff",
logarithmic_cross_correlation_ratio: "RefDiff",
differential_phase: "Wild25",
unfolded_differential_phase: "Wild25",
corrected_differential_phase: "Wild25",
specific_differential_phase: "Theodore16",
corrected_specific_differential_phase: "Theodore16",
linear_depolarization_ratio: "SCook18",
linear_depolarization_ratio_h: "SCook18",
linear_depolarization_ratio_v: "SCook18",
circular_depolarization_ratio: "SCook18",
rain_rate: "RRate11",
radar_estimated_rain_rate: "RRate11",
radar_echo_classification: "LangRainbow12",
specific_attenuation: "Carbone17",
differential_phase_texture: "BlueBrown11",
height: "SCook18",
interpolated_profile: "SCook18",
noisedBZ_hh: "HomeyerRainbow",
noisedBZ_vv: "HomeyerRainbow",
# Additional reflectivity like fields
"CZ": "pyart_HomeyerRainbow",
"DZ": "pyart_HomeyerRainbow",
"AZ": "pyart_HomeyerRainbow",
"Z": "pyart_HomeyerRainbow",
"dbz": "pyart_HomeyerRainbow",
"DBZ": "pyart_HomeyerRainbow",
"dBZ": "pyart_HomeyerRainbow",
"DBZH": "pyart_HomeyerRainbow",
"DBZ_S": "pyart_HomeyerRainbow",
"DBZ_K": "pyart_HomeyerRainbow",
"reflectivity_horizontal": "pyart_HomeyerRainbow",
"corr_reflectivity": "pyart_HomeyerRainbow",
"CZ": "HomeyerRainbow",
"DZ": "HomeyerRainbow",
"AZ": "HomeyerRainbow",
"Z": "HomeyerRainbow",
"dbz": "HomeyerRainbow",
"DBZ": "HomeyerRainbow",
"dBZ": "HomeyerRainbow",
"DBZH": "HomeyerRainbow",
"DBZ_S": "HomeyerRainbow",
"DBZ_K": "HomeyerRainbow",
"reflectivity_horizontal": "HomeyerRainbow",
"corr_reflectivity": "HomeyerRainbow",
}

# map each field to a limit or a limit function
Expand Down
Loading

0 comments on commit a3f8d72

Please sign in to comment.