PyDSD
2016-02-06
1.Introduction
The code is mainly developed for studying Weather Radar Polarimetry course of Dr. Guifu Zhang. And we will give some examples for the problems after the chapters of his new book named as Weather Radar Polarimetry (the same name as his course in the University of Oklahoma) based on this code. The example data are also provided by Dr. Guifu Zhang.
- Download the code.
2.Requirements
3.Installation
To install first clone repository:
$ git clone https:https://github.com/hhuangwx/pydsd.git
Then move to the pydsd directory and run the Python setup script.
$ cd pydsd
$ python setup.py install
4.Usage
4.1 Using Tmatrix
class
This class is used to read scattering amplitudes from the default file and to interpolate them to a given series of raindrop diameters.
Auguments to initialize Tmatrix
:
ScatAmplFile
:
Scattering Amplitude File for raindrops. Scattering Amplitude is usually temperature dependent and wave length dependent. There are three default Scattering Amplitude Files for S-/C-/X-band stored in directory ‘pydsd/SAfile’. These three files are obtained with Tmatrix method.
Reference:
1Vivekanandan, J., W. Adams, and V. Bringi, 1991: Rigorous approach to polarimetric radar modeling of hydrometeor orientation distributions. Journal of Applied Meteorology, 30, 1053-1063.
The methods are as follows:
Methods | Arguments | Description |
---|---|---|
get_scat_ampl | d |
interpolate scattering amplitudes to a given series of raindrop diameters |
replace_SAF | ScatAmplFile |
replace the scattering amplitude file used in the Tmatrix class |
4.2 Using DSD
class
This class is used to read scattering amplitudes from the default file and to interpolate them to a given series of raindrop diameters.
Reference:
[2] Zhang, G., Weather Radar Polarimetry, CRC Press, 2016.
[3]Q. Cao, M. B. Yeary, and G. Zhang, “Efficient ways to learn weather radar polarimetry,” Education, IEEE Transactions on, vol. 55, pp. 58-68, 2012.
Auguments to initialize DSD
:
-
d
:
Equivalent raindrop diameters [mm], (numpy ndarray) vector. Temporarilly only equally spaced d is accepted as our module is mainly designed for 2DVD observations. -
nd
: DSD defined as number of drops in a unit volume for each unit diameter bin [# m^-3 mm^-1], (numpy 2-d array), the second dimension should be corresponding tod
. -
Tmatrix
:
Tmatrix
class, look atTmatrix
to get more information. -
vt
:
Terminal velocity [m s^-1], should either be a vector liked
or a 2d array likend
. This is the parameter designed for the input of observed terminal velocity. Ifvt
is input, rainrate is calculated based on it, otherwise it will computed based on a polynomial equation of raindrop diameter.
Methods | Arguments | Description |
---|---|---|
model_params_fit | None | fitting params. for DSD model |
radar_var_estimation | None | calculate polarimetric radar variables according to the N(d) and the Tmatrix given |
precip_var_estimation | None | calculate polarimetric radar variables according to the N(d) and the vt if given. |
4.3 Using DSDmodel
class
A class of dsd model based on params. N0, mu and lam. The gamma model is used to calculate N(D) for the given N0, mu and lam. N(D)=N0*D\^mu*exp(-lam*D)
see also: DSD
Auguments to initialize DSDmodel
:
N0
mu
lam
:
scalar or list or numpy 1-d array
4.4 Using DSDretri
class
A class of dsd retrieval from \(Z_{\mathrm{H}}\) and \(Z_{\mathrm{DRs}}\).
Reference:
[4] G. Zhang, J. Vivekanandan, and E. Brandes, “A method for estimating rain rate and drop size distribution from polarimetric radar measurements,” Ieee Transactions on Geoscience and Remote Sensing, vol. 39, pp. 830-841, Apr 2001.
Auguments to initialize DSDretri
:
-
Z_H
:
Equivalent raindrop diameters [mm], (numpy ndarray) vector. Temporarilly only equally spaced d is accepted as our module is mainly designed for 2DVD observations. -
Z_DR
: DSD defined as number of drops in a unit volume for each unit diameter bin [# m^-3 mm^-1], (numpy 2-d array), the second dimension should be corresponding tod
. -
Tmatrix
:
Tmatrix
class, look atTmatrix
to get more information.
4.5 Using paramsfit
class
A class for fitting parameters from 2DVD data. These parameters can be used in (differential) attenuation correction, rainrate estimation, calibration, et al. Temporarily, I won’t return a correction coefficient.
The fitting processes in this module are least square non-linear fitting. It is definitely better than simply fitting in a logarithmic domain.
Auguments to initialize paramsfit
:
-
d
:
Equivalent raindrop diameters [mm], (numpy ndarray) vector. Temporarilly only equally spaced d is accepted as our module is mainly designed for 2DVD observations. -
nd
: DSD defined as number of drops in a unit volume for each unit diameter bin [# m^-3 mm^-1], (numpy 2-d array), the second dimension should be corresponding tod
. -
Tmatrix
:
Tmatrix
class, look atTmatrix
to get more information.
Methods | Arguments |Description :————-: | :————-:|:————-:
$A_\mathrm{H}(K_\mathrm{DP})$|None|$A_{\mathrm{H}}=\alpha*K_{\mathrm{DP}}$
ADP\_KDP|None| \\(A_{\mathrm{DP}}=\alpha*K_{\mathrm{DP}}\\)
rainrate\_KDP|None| \\(R=\alpha*K_{\mathrm{DP}}\\)
rainrate\_Zh\_Zdr|None| \\(R=c*Z_{\mathrm{h}}^{a}*Z_{\mathrm{dr}}^{b}\\)
rainrate\_KDP\_Zdr|None| \\(R=c*K_{\mathrm{DP}}^{a}*Z_{\mathrm{dr}}^{b}\\)
rainrate\_Zh|None| \\(R=a*Z_{\mathrm{h}}^{b}\\)
KDP\_Zh\_Zdr|None| \\(K_{\mathrm{DP}}=c*Z_{\mathrm{h}}^{a}*Z_{\mathrm{dr}}^{b}\\)