Filtering and retrievals of C-band Dual-pol Radar

Hi greetings. I’m currently working in some radar data, particularly in Tagaytay, Philippine’s C-band dual-pol radar. I’m trying to filter out weather echoes by following the same methodology as in the post for Swiss C-band by using the pyart.filters.moment_and_texture_based_gate_filter as part of the attenuation correction. Unfortunately, when I use the moment and texture based gt, the plot only shows a blank figure.

import matplotlib.pyplot as plt
import pyart
import sounderpy as spy
import numpy as np

cd = spy.get_model_data(‘era5’, [14.089800, 120.908301], ‘2024’, ‘07’, ‘23’, ‘00’) #Tagaytay Station

height = cd[‘z’].m
temp = cd[‘T’].m

file = ‘2045TAG20240723001000_cleaned.uf’
radar = pyart.io.read_uf(file)

height_dict, profile_dict = pyart.retrieve.map_profile_to_gates(temp, height, radar, profile_field=‘TEMP’)
profile_dict.update({
“units”: “degrees Celsius”,
“long_name”: “Temperature”,
“standard_name”: “air_temperature”
})

radar.add_field(‘temperature’, profile_dict, replace_existing=True)
radar.add_field(‘height’, height_dict, replace_existing=True)

ncp_values = np.ones((radar.nrays, radar.ngates))
ncp = pyart.config.get_metadata(‘normalized_coherent_power’)
ncp[‘data’] = ncp_values
radar.add_field(‘normalized_coherent_power’, ncp, replace_existing=True)

snr = pyart.retrieve.calculate_snr_from_reflectivity(radar, refl_field=‘reflectivity’, snr_field=‘snr’)
radar.add_field(‘signal_to_noise_ratio’, snr, replace_existing=True)

phidp, kdp = pyart.correct.phase_proc_lp(radar, 0.0,
fzl=5000,
self_const=60000.0,
LP_solver=‘pyglpk’,
refl_field=‘reflectivity’,
phidp_field=‘differential_phase’,
rhv_field=‘cross_correlation_ratio’,
ncp_field=‘normalized_coherent_power’,
min_rhv=0.85,
min_ncp=0.5,
coef=0.914)

radar.add_field(‘proc_dp_phase_shift’, phidp, replace_existing=True)
radar.add_field(‘recalculated_diff_phase’, kdp, replace_existing=True)

gtfilter = pyart.filters.moment_and_texture_based_gate_filter(radar, rhv_field=‘cross_correlation_ratio’,
phi_field=‘proc_dp_phase_shift’,
refl_field=‘reflectivity’, min_rhv=0.85)
gtfilter.exclude_below(‘signal_to_noise_ratio’, 10)

fig, ax = plt.subplots(1,2, figsize=(10,6), sharex= True, sharey=True)
display = pyart.graph.RadarDisplay(radar)
display.plot_ppi(‘reflectivity’, 0, vmin=0, vmax=60., ax = ax[0], colorbar_label = ‘Raw’, cmap=‘NWSRef’)
display.plot_ppi(‘reflectivity’, 0, vmin=0, vmax=60., gatefilter = gtfilter,
ax = ax[1], colorbar_label = ‘Filtered’, cmap=‘NWSRef’)
ax[0].set_xlim([-100,100])
ax[0].set_ylim([-100,100])
ax[0].set_aspect(‘equal’, ‘box’)
ax[1].set_aspect(‘equal’, ‘box’)

Is there a way to fix this issue? A sample file is attached. https://drive.google.com/file/d/1KFfaUlBOjlIKRsx1ny1hP8Gg-NK3zlXQ/view?usp=sharing

Hey!

Doing some assuming here, but seems like you are accessing the subplot axes correctly in the plot_ppi arguments (i.e. the example works correctly), the only difference I can see is the gatefilter that you apply. Are you sure the gatefilter is doing the expected thing? Or is it just removing everything? Try visualising the filter properties, or just plot the working data in both plots (the second plot_ppi without the gatefilter argument). Then you will see if the problem is plotting or the gatefilter.

Hope this helps!

1 Like

Hi greetings, @jorahu. Thanks for the input.

Upon inspection, I already resolved it by tweaking the SNR’s TOA. Particularly, I have to set it somewhere in between 10000 to 12000 m (instead of the 25000 m as is).

1 Like