first of all thank you very much for this awesome library being released as open source software!
I'm both a Python newbie (I usually work with MATLAB) and a radar newbie (I usually work with GPS), so please be kind ;)
I've successfully used PyART to read Sigmet IRIS/RAW data files, plot the results and export the gridded data to a NetCDF file. My main objective was to read gridded reflectivity data in MATLAB, and I actually managed to use the MATLAB command "ncread" to read the NetCDF file produced by PyART.
I've set the same threshold on the minimum reflectivity value that I use for the plot_ppi function (14 dBZ) also in the MATLAB plots, but while that successfully removes most of the noise, the rings are unaffected.
Could anyone help me understanding how the remove those rings from the MATLAB plots? I mean, I applied some kind of image filtering to partially remove them "a posteriori", but I guess there should be a better way to avoid having them in the first place.
import numpy as np
import matplotlib.pyplot as plt
import pyart
# read Sigmet IRIS/RAW data
filename = 'JEP100802152831.RAWJY9F'
radar = pyart.io.read(filename)
# mask out last 10 gates of each ray, this removes the "ring" around the radar.
radar.fields['reflectivity']['data'][:, -10:] = np.ma.masked
# perform Cartesian mapping, limit to the reflectivity field.
grid = pyart.map.grid_from_radars(
(radar,),
grid_shape=(600, 600, 2),
grid_limits=((-100000.0, 100000.0), (-100000.0, 100000.0),
(2000, 5000)),
weighting_function='Cressman',
fields=['reflectivity'],
refl_filter_flag=True)
# save grid to netCDF file
pyart.io.write_grid(filename + '.nc', grid)
# PPI plot
display = pyart.graph.RadarDisplay(radar)
fig = plt.figure()
ax = fig.add_subplot(111)
display.plot_ppi('reflectivity', 0, mask_tuple=['reflectivity', 14], vmin=0, vmax=72.)
display.set_limits(xlim=[-100, 100])
display.set_limits(ylim=[-100, 100])
display.plot_range_rings([25, 50, 75, 100])
display.plot_cross_hair(5.)
plt.show()