diff --git a/pyart/default_config.py b/pyart/default_config.py index 5f519becd9..6b1cb27222 100644 --- a/pyart/default_config.py +++ b/pyart/default_config.py @@ -64,6 +64,7 @@ # Normalized coherent power, signal quality index, SQI, NCP normalized_coherent_power = 'normalized_coherent_power' +logarithmic_cross_correlation_ratio = 'logarithmic_cross_correlation_ratio' # Differential phase shift, PhiDP differential_phase = 'differential_phase' @@ -75,13 +76,18 @@ specific_differential_phase = 'specific_differential_phase' corrected_specific_differential_phase = 'corrected_specific_differential_phase' -# Linear depolarization ration (h - horizontal, v - vertical), LDR +# Linear depolarization ratio (h - horizontal, v - vertical), LDR linear_depolarization_ratio = 'linear_polarization_ratio' linear_depolarization_ratio_h = 'linear_depolarization_ratio_h' linear_depolarization_ratio_v = 'linear_depolarization_ratio_v' +# Circular depolarization ratio +circular_depolarization_ratio = 'circular_depolarization_ratio' + # Misc fields signal_to_noise_ratio = 'signal_to_noise_ratio' +noisedBZ_hh = 'noisedBZ_hh' +noisedBZ_vv = 'noisedBZ_vv' rain_rate = 'rain_rate' radar_estimated_rain_rate = 'radar_estimated_rain_rate' radar_echo_classification = 'radar_echo_classification' @@ -163,6 +169,7 @@ 'corrected_differential_reflectivity': corrected_differential_reflectivity, 'cross_correlation_ratio': cross_correlation_ratio, + 'logarithmic_cross_correlation_ratio': logarithmic_cross_correlation_ratio, 'normalized_coherent_power': normalized_coherent_power, 'differential_phase': differential_phase, 'unfolded_differential_phase': unfolded_differential_phase, @@ -173,7 +180,10 @@ 'linear_depolarization_ratio': linear_depolarization_ratio, 'linear_depolarization_ratio_h': linear_depolarization_ratio_h, 'linear_depolarization_ratio_v': linear_depolarization_ratio_v, + 'circular_depolarization_ratio': circular_depolarization_ratio, 'signal_to_noise_ratio': signal_to_noise_ratio, + 'noisedBZ_hh': noisedBZ_hh, + 'noisedBZ_vv': noisedBZ_vv, 'rain_rate': rain_rate, 'radar_estimated_rain_rate': radar_estimated_rain_rate, 'radar_echo_classification': radar_echo_classification, @@ -534,6 +544,11 @@ 'valid_min': 0.0, 'coordinates': 'elevation azimuth range'}, + logarithmic_cross_correlation_ratio: { + 'units': 'ratio', + 'long_name': 'Logarithmic cross correlation ratio', + 'coordinates': 'elevation azimuth range'}, + normalized_coherent_power: { 'units': 'ratio', 'standard_name': 'normalized_coherent_power', @@ -575,7 +590,6 @@ 'long_name': 'Corrected specific differential phase (KDP)', 'coordinates': 'elevation azimuth range'}, - # Depolarization ratio fields linear_depolarization_ratio: { 'units': 'dB', @@ -595,6 +609,11 @@ 'long_name': 'Linear depolarization ratio vertical', 'coordinates': 'elevation azimuth range'}, + circular_depolarization_ratio: { + 'units': 'dB', + 'long_name': 'Circular depolarization ratio', + 'coordinates': 'elevation azimuth range'}, + # Misc fields signal_to_noise_ratio: { 'units': 'dB', @@ -602,6 +621,16 @@ 'long_name': 'Signal to noise ratio', 'coordinates': 'elevation azimuth range'}, + noisedBZ_hh: { + 'units': 'dBZ', + 'long_name': 'noise in dBZ horizontal', + 'coordinates': 'elevation azimuth range'}, + + noisedBZ_vv: { + 'units': 'dBZ', + 'long_name': 'noise in dBZ vertical', + 'coordinates': 'elevation azimuth range'}, + rain_rate: { 'units': 'kg/m2/s', 'standard_name': 'rain_rate', @@ -1435,6 +1464,7 @@ def spectrum_width_limit(container=None, selection=0): 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', @@ -1446,6 +1476,7 @@ def spectrum_width_limit(container=None, selection=0): 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', @@ -1458,6 +1489,9 @@ def spectrum_width_limit(container=None, selection=0): height: 'pyart_SCook18', interpolated_profile: 'pyart_SCook18', + noisedBZ_hh: 'pyart_HomeyerRainbow', + noisedBZ_vv: 'pyart_HomeyerRainbow', + # Additional reflectivity like fields 'CZ': 'pyart_HomeyerRainbow', 'DZ': 'pyart_HomeyerRainbow', diff --git a/pyart/retrieve/advection.py b/pyart/retrieve/advection.py index 6397ed9724..8d960945fc 100644 --- a/pyart/retrieve/advection.py +++ b/pyart/retrieve/advection.py @@ -6,7 +6,7 @@ import copy import numpy as np -from scipy.ndimage import interpolation +from scipy.ndimage import shift from netCDF4 import num2date from ..config import get_fillvalue @@ -147,7 +147,7 @@ def grid_shift(grid, advection, trim_edges=0, field_list=None): data = np.ma.filled(data, np.nan) # shift the data - shifted_data = interpolation.shift( + shifted_data = shift( data, [0, advection[0], advection[1]], prefilter=False) # mask invalid, trim and place into grid diff --git a/pyart/retrieve/simple_moment_calculations.py b/pyart/retrieve/simple_moment_calculations.py index 96f022efb5..244c2faff4 100644 --- a/pyart/retrieve/simple_moment_calculations.py +++ b/pyart/retrieve/simple_moment_calculations.py @@ -295,7 +295,7 @@ def calculate_velocity_texture(radar, vel_field=None, wind_size=4, nyq=None, vel_texture_field['long_name'] = 'Doppler velocity texture' vel_texture_field['standard_name'] = ( 'texture_of_radial_velocity' + '_of_scatters_away_from_instrument') - vel_texture_field['data'] = ndimage.filters.median_filter(vel_texture, - size=(wind_size, - wind_size)) + vel_texture_field['data'] = ndimage.median_filter(vel_texture, + size=(wind_size, + wind_size)) return vel_texture_field diff --git a/tests/retrieve/test_simple_moment_calculations.py b/tests/retrieve/test_simple_moment_calculations.py index a00c553f2e..01096c54b9 100644 --- a/tests/retrieve/test_simple_moment_calculations.py +++ b/tests/retrieve/test_simple_moment_calculations.py @@ -1,6 +1,7 @@ """ Unit Tests for Py-ART's retrieve/simple_moment_calculation.py module. """ import numpy as np +from numpy.testing import assert_allclose import pyart # Setup a test radar object for various retrievals @@ -66,3 +67,11 @@ def test_calculate_velocity_texture(): texture_field = pyart.retrieve.calculate_velocity_texture( radar, vel_field, wind_size=4, nyq=10) assert np.all(texture_field['data'] == 0) + + # Test none parameters + radar2 = pyart.io.read(pyart.testing.NEXRAD_ARCHIVE_MSG31_FILE) + texture_field = pyart.retrieve.calculate_velocity_texture( + radar2, vel_field=None, wind_size=4, nyq=None) + assert_allclose( + texture_field['data'][-1][-5:], + [0.000363, 0.000363, 0.000363, 0.000363, 0.000363], atol=1e-03)