towerpy.eclass.snr#

Towerpy: an open-source toolbox for processing polarimetric radar data.

Classes#

SNR_Classif

A class to compute the Signal-to-Noise Ratio on radar data.

Functions#

signal2noiseratio(Z, rng_km, rc[, scale])

Compute signal-to-noise ratio (SNR).

Module Contents#

class towerpy.eclass.snr.SNR_Classif(radobj=None)[source]#

A class to compute the Signal-to-Noise Ratio on radar data.

Attributes#

elev_anglefloat

Elevation angle at which the scan was taken, in deg.

file_namestr

Name of the file containing radar data.

scandatetimedatetime

Date and time of scan.

site_namestr

Name of the radar site.

min_snrfloat

Reference noise value.

snr_classdict

Results of the SNR method.

varsdict

Radar variables with noise removed.

elev_angle = None[source]#
file_name = None[source]#
scandatetime = None[source]#
site_name = None[source]#
signalnoiseratio(rad_georef, rad_params, rad_vars, min_snr=0, rad_cst=None, snr_linu=False, data2correct=None, classid=None, plot_method=False)[source]#

Compute the SNR and discard data using a reference noise value.

Parameters#

rad_georefdict

Georeferenced data containing descriptors of the azimuth, gates and beam height, amongst others.

rad_paramsdict

Radar technical details.

rad_varsdict

Radar variables used to compute the SNR.

min_snrfloat64, optional

Reference noise value. The default is 0.

data2correctdict, optional

Variables into which noise is removed. The default is None.

plot_methodBool, optional

Plot the SNR classification method. The default is False.

static static_signalnoiseratio(rad_georef, rad_params, rad_vars, min_snr=0, rad_cst=None, snr_linu=False, data2correct=None, plot_method=False)[source]#

Compute the SNR (in dB) and discard data using a reference noise value.

Parameters#

rad_georefdict

Georeferenced data containing descriptors of the azimuth, gates and beam height, amongst others.

rad_paramsdict

Radar technical details.

rad_varsdict

Radar variables used to compute the SNR..

min_snrfloat64, optional

Reference noise value. The default is 0.

data2correctdict, optional

Variables into which noise is removed. The default is None.

plot_methodBool, optional

Plot the SNR classification method. The default is False.

Returns#

Object containing the signal/noise classification.

towerpy.eclass.snr.signal2noiseratio(Z, rng_km, rc, scale='db')[source]#

Compute signal-to-noise ratio (SNR).

Parameters#

Zarray_like or xarray.DataArray

Reflectivity factor [dBZ].

rng_kmarray_like or xarray.DataArray

Range [km].

rcfloat

Radar constant [dB].

scale{“db”, “lin”, “both”}, optional

Output format: - “db” : return SNR in dB (default) - “lin” : return SNR in linear scale - “both” : return dict with both

Returns#

snrndarray, DataArray, or dict

Depending on scale: - “db” → snr_db - “lin” → snr_lin - “both” → {“snr_db”: snr_db, “snr_lin”: snr_lin}