indeed to extract “REF” values >=40dbz and need to plot it :
import pyart
import numpy as np
import glob
import matplotlib.pyplot as plt
import cartopy.crs as ccrs
import cartopy.feature as cfeature
from cartopy.mpl.gridliner import LONGITUDE_FORMATTER, LATITUDE_FORMATTER
Assuming grid_files is defined as in your code
grid_files = glob.glob(“D:\radar_data\radinout\gridded_20_jun_2022\gridded_20_jun_2022grid_ZDR_*nc”)
Define the projection you want to use
projection = ccrs.PlateCarree()
for i, file in enumerate(grid_files):
grid_data = pyart.io.read_grid(file)
ref_data = grid_data.fields[‘REF’][‘data’]
ref_values_less_mask40 = np.where(ref_data >= 40, ref_data, np.nan)
grid_data.fields['REF']['data'] = ref_values_less_mask40
grid_data.fields['REF']['long_name'] = 'Filtered Reflectivity'
grid_data.fields['REF']['units'] = 'dBZ'
fig = plt.figure(figsize=[8, 8])
ax = plt.subplot(111, projection=projection)
grid_display = pyart.graph.GridMapDisplay(grid_data)
grid_display.plot_grid("REF", level=1,vmin=40,vmax=100, projection=projection, ax=ax, ticks=np.arange(40, 101, 2))
BUT I’M GETTING PLOTS LIKE THIS ,IS IT BECAUSE OF THE PROBLEM OF MY CODE OR DATA(SHOWING 100Dbz MOST OF THE MAP)?AND ALSO I NEED TO SEE THE “REF” >=40 VARIATION WITH SUITABLE TICKS AND COLOURMAP.