towerpy.calib.calib_phidp#

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

Classes#

PhiDP_Calibration

A class for calibrating the differential phase \((\Phi_{DP})\).

Module Contents#

class towerpy.calib.calib_phidp.PhiDP_Calibration(radobj=None)[source]#

A class for calibrating the differential phase \((\Phi_{DP})\).

Attributes#

elev_anglefloat

Elevation angle at where the scan was taken, in degrees.

file_namestr

Name of the file containing radar data.

scandatetimedatetime

Date and time of scan.

site_namestr

Name of the radar site.

phidp_offsetdict

Computed \(\Phi_{DP}\) offset

phidp_offset_statsdict

Stats calculated during the computation of the \(\Phi_{DP}\) offset.

varsdict

Offset-corrected \((\Phi_{DP})\) and user-defined radar variables.

elev_angle = None[source]#
file_name = None[source]#
scandatetime = None[source]#
site_name = None[source]#
offsetdetection_vps(pol_profs, mlyr=None, min_h=1.1, max_h=None, zhmin=5, zhmax=30, rhvmin=0.98, minbins=2, stats=False, plot_method=False, rad_georef=None, rad_vars=None)[source]#

Calculate the offset on \(\Phi_{DP}\) using vertical profiles.

Parameters#

pol_profsdict

Profiles of polarimetric variables.

mlyrclass, optional

Melting layer class containing the top and bottom boundaries of the ML.

min_hfloat, optional

Minimum height of usable data within the polarimetric profiles. The default is 1.1.

max_hfloat, optional

Maximum height of usable data within the polarimetric profiles. Use only if ML boundaries are not available. The default is 3.

zhminfloat, optional

Threshold on \(Z_{H}\) (in dBZ) related to light rain. The default is 5.

zhmaxfloat, optional

Threshold on \(Z_{H}\) (in dBZ) related to light rain. The default is 30.

rhvminfloat, optional

Threshold on \(\rho_{HV}\) (unitless) related to light rain. The default is 0.98.

minbinsfloat, optional

Consecutive bins of \(\Phi_{DP}\) related to light rain. The default is 2.

statsdict, optional

If True, the function returns stats related to the computation of the \(\Phi_{DP}\) offset. The default is False.

plot_methodBool, optional

Plot the offset detection method. The default is False.

rad_georefdict, optional

Georeferenced data containing descriptors of the azimuth, gates and beam height, amongst others. The default is None.

rad_varsdict, optional

Radar variables used for plotting the offset correction method. The default is None.

offsetdetection_qvps(pol_profs, mlyr=None, min_h=0.0, max_h=3.0, zhmin=0, zhmax=20, rhvmin=0.985, minbins=4, stats=False)[source]#

Calculate the offset on \(\Phi_{DP}\) using QVPs.

Parameters#

pol_profsdict

Profiles of polarimetric variables.

mlyrclass

Melting layer class containing the top and bottom boundaries of the ML.

min_hfloat, optional

Minimum height of usable data within the polarimetric profiles. The default is 0.

max_hfloat, optional

Maximum height of usable data within the polarimetric profiles. The default is 3.

zhminfloat, optional

Threshold on \(Z_{H}\) (in dBZ) related to light rain. The default is 0.

zhmaxfloat, optional

Threshold on \(Z_{H}\) (in dBZ) related to light rain. The default is 20.

rhvminfloat, optional

Threshold on \(\rho_{HV}\) (unitless) related to light rain. The default is 0.985.

minbinsfloat, optional

Consecutive bins of \(\Phi_{DP}\) related to light rain. The default is 3.

statsdict, optional

If True, the function returns stats related to the computation of the \(\Phi_{DP}\) offset. The default is False.

Notes#

  1. Adapted from the method described in [1]

References#

offsetdetection_ppi(rad_vars, mov_avrgf_len=(1, 3), thr_spdp=10, rhohv_min=0.9, zh_min=5.0, max_off=360, preset=None, preset_tol=5, mode='median', plot_method=False)[source]#

Compute the \(\Phi_{DP}\) offset using PPIs`.

Parameters#

rad_varsdict

Dict containing radar variables to plot. \(\Phi_{DP}\), \(\rho_{HV}\) and \(Z_H\) must be in the dict.

mov_avrgf_len2-element tuple or list, optional

Window size used to smooth \(\Phi_{DP}\) by applying a moving average window. The default is (1, 3). It is recommended to average \(\Phi_{DP}\) along the range, i.e. keep the window size in a (1, n) size.

thr_spdpint or float, optional

Threshold used to discard bins with standard deviations of \(\Phi_{DP}\) greater than the selected value. The default is 10 deg.

rhohv_minfloat, optional

Threshold in \(\rho_{HV}\) used to discard bins related to nonmeteorological signals. The default is 0.90

zh_minfloat, optional

Threshold in \(Z_H\) used to discard bins related to nonmeteorological signals. The default is 5.

max_offfloat or int, optional

Maximum value allowed for \(\Phi_{DP}(0)\). The default is 360.

presetfloat or int, optional

Preset \(\Phi_{DP}(0)\). The default is None.

preset_tolfloat or int, optional

Maximum difference allowed between the preset and computed \(\Phi_{DP}(0)\) values. Offset values that exceed this tolerance value are replaced with the preset value. The default tolerance is 5 deg.

modestr, optional

Resulting \(\Phi_{DP}\) offset. The string has to be one of ‘median’ or ‘multiple’. If median, \(\Phi_{DP}\) offset is computed as a single value (the median of all rays). Otherwise, the \(\Phi_{DP}\) offset is calculated ray-wise. The default is ‘median’.

offset_correction(phidp2calib, phidp_offset=0, data2correct=None)[source]#

Correct the PhiDP offset using a given value.

Parameters#

phidp2calibarray of float

Offset-affected differential phase \((\Phi_{DP})\) in deg.

phidp_offsetfloat

Differential phase offset in deg. The default is 0.

data2correctdict, optional

Dictionary to update the offset-corrected \((\Phi_{DP})\). The default is None.