Hey
Sorry that it has taken so long time, but just didn’t have time to look into that. Thanks for the code, it helped a lot!
Now, I am by no means an expert with Pyart, maybe some others can give better explanations here and apologies in advance to them, if I say something wrong here. (I didn’t even have a solid env with Pyart installed before this issue.)
As much as I learned while trying to understand your issue, I did get the same result that you had, that the order changed the visualised image. I do not know, what’s the underlying issue, but seems that all the internal weighting and roi functions are doing too good of a work when trying to visualise a simple "one layer” (z→1 pixel) CAPPI product. Especially when the radars are far apart and even more with such big elevation differences (that’s the key here!).
Basically, what finally worked, was to set all elevations to the same exact value, in your case 2000 m seemed like an appropriate number, but I guess any constant work the same for the algorithm. This should ensure that the ROI function doesn’t take the beam elevation into account and just draws the “flat pancake” (i.e. the CAPPI).
The code snippet I used:
file1 = “20251103051105_SBAG_CAPPI_2km.nc”
file2 = “20251103051001_SBAL_CAPPI_2km.nc”
file3 = “20251103051038_SDAET_CAPPI_2km.nc”
baguio_radar = pyart.io.read_cfradial(file1)
baler_radar = pyart.io.read_cfradial(file2)
daet_radar = pyart.io.read_cfradial(file3)
# Just for visualisation and debugging, disable the mask:
shap = baguio_radar.fields[‘Reflectivity_CAPPI_2km’][‘data’].data.shape
shap2 = daet_radar.fields[‘Reflectivity_CAPPI_2km’][‘data’].data.shape
baguio_radar.fields[‘Reflectivity_CAPPI_2km’][‘data’].mask[:, :] = np.zeros(shap).astype(bool)
baler_radar.fields[‘Reflectivity_CAPPI_2km’][‘data’].mask[:, :] = np.zeros(shap).astype(bool)
daet_radar.fields[‘Reflectivity_CAPPI_2km’][‘data’].mask[:, :] = np.zeros(shap2).astype(bool)
#Set the altitude to 2000 (or whatever number, guess it just has to be same number for all radars)
baguio_radar.altitude[‘data’].data[0] = 2000
baler_radar.altitude[‘data’].data[0] = 2000
daet_radar.altitude[‘data’].data[0] = 2000
# Plot
grid = pyart.map.grid_from_radars(
(daet_radar, baler_radar, baguio_radar),
#(baler_radar, baguio_radar, daet_radar),
grid_shape=(1, 450, 450),
grid_limits=((0, 10_000), (-500_000, 500_000), (-500_000, 500_000)),
grid_origin=(15.411, 121.725),
fields=["Reflectivity_CAPPI_2km"],
weighting_function="Barnes2",
gridding_algo="map_gates_to_grid",
roi_func='dist_beam',
)
refl = grid.fields[‘Reflectivity_CAPPI_2km’][‘data’][0]
lats = grid.point_latitude[‘data’][0].reshape(refl.shape)
lons = grid.point_longitude[‘data’][0].reshape(refl.shape)
plt.pcolormesh(lons, lats, refl)
This produces the following image, where you can see all three full circles of the radar measurement ranges. Also, adding the gatefilters distorted the image quite a bit, so you will have to play around some more with those, but this is the best I could come up with. Again, someone with better understanding of Pyart can maybe pitch in here and make this make sense (also to me).