towerpy.georad.georef_rdata#
Towerpy: an open-source toolbox for processing polarimetric radar data.
Functions#
|
Transform Cartesian coordinates to Polar. |
|
Transform polar coordinates to Cartesian. |
|
Calculate the height of the centre of the radar beam above Earth's surface. |
|
Compute the distance (arc length) from the radar to the bins. |
|
Create georeferenced grid for PPI radar scans. |
Module Contents#
- towerpy.georad.georef_rdata.cart2pol(x, y)[source]#
Transform Cartesian coordinates to Polar.
Parameters#
- x, yarray
Cartesian coordinates
Returns#
- rhoarray
Radial coordinate, rho is the distance from the origin to a point in the x-y plane.
- thetaarray
Angular coordinates is the counterclockwise angle in the x-y plane measured in radians from the positive x-axis. The value of the angle is in the range [-pi, pi].
- towerpy.georad.georef_rdata.pol2cart(rho, theta)[source]#
Transform polar coordinates to Cartesian.
Parameters#
- rhoarray
Radial coordinate, rho is the distance from the origin to a point in the x-y plane.
- thetaarray
Angular coordinates is the counterclockwise angle in the x-y plane measured in radians from the positive x-axis. The value of the angle is in the range [-pi, pi].
Returns#
- x, yarray
Cartesian coordinates.
- towerpy.georad.georef_rdata.height_beamc(elev_angle, rad_range, e_rad=6378, std_refr=4 / 3)[source]#
Calculate the height of the centre of the radar beam above Earth’s surface.
Parameters#
- elev_anglefloat
Radar elevation angle in degrees.
- rad_rangearray
Range from the radar in kilometres.
- e_radfloat, optional
Effective Earth’s radius. The default is 6378.
- std_refrfloat, optional
Standard refraction coefficient. The default is 4/3.
Returns#
- harray
Height of the centre of the radar beam in kilometres.
Notes#
The beam height above sea level or radar level for a standard atmosphere is calculated by adapting equation (2.28b) in [1]_:
\(h = \sqrt{r^2+(\frac{4}{3} E_r)^2+2r(\frac{4}{3} E_r)\sin\Theta}-\frac{4}{3} E_r\)
Where:
h : height of the centre of the radar beam above Earth’s surface
r : radar range to the targets in kilometres.
\(\Theta\) : elevation angle of beam in degree
\(E_r\) : effective Earth’s radius [approximately 6378 km]
References#
- towerpy.georad.georef_rdata.cartesian_distance(elev_angle, rad_range, hbeam, e_rad=6378, std_refr=4 / 3)[source]#
Compute the distance (arc length) from the radar to the bins.
Parameters#
- elev_anglefloat
Radar elevation angle in degrees.
- rad_rangearray
Range from the radar in kilometres.
- hbeamfloat
Height of the centre of the radar beam in kilometres.
- e_radfloat, optional
Effective Earth’s radius. The default is 6378.
- std_refrfloat, optional
Standard refraction coefficient. The default is 4/3.
Returns#
- s: array
Distance (arc length) from the radar to the bins in kilometres.
Notes#
The distance in Cartesian coordinates is calculated by adapting equations (2.28b and 2.28c) in [1]_:
\(h = \sqrt{r^2+(\frac{4}{3} E_r)^2+2r(\frac{4}{3} E_r)\sin\Theta}-\frac{4}{3} E_r\)
\(s = \frac{4}{3} E_r * arcsin(\frac{r*cos(\Theta)}{\frac{4}{3} E_r+h})\)
References#
[1] Doviak, R., & Zrnic, D. S. (1993). Electromagnetic Waves and Propagation in Doppler Radar and Weather Observations (pp. 10-29). San Diego: Academic Press, Second Edition. https://doi.org/10.1016/B978-0-12-221422-6.50007-3
- towerpy.georad.georef_rdata.ppi_georef(rparams, georef=None, polarc_exist=True, elev=0.5, gate0=0, gateres=250)[source]#
Create georeferenced grid for PPI radar scans.
Parameters#
- rparamsdict
- Radar parameters dictionary. Must contain:
‘nrays’ : int, number of rays
‘ngates’ : int, number of range gates
‘beamwidth [deg]’ : float, beamwidth in degrees
- georefdict, optional
Existing georeference dictionary with keys ‘azim [rad]’, ‘elev [rad]’, ‘range [m]’. Required if polarc_exist=True.
- polarc_existbool
If True, polar coordinates (range, azimuth, elevation) are read directly from the georef attribute. If False, synthesise elevation, azimuth, and range. The default is True
- elevfloat
Elevation angle in degrees (used if polarc_exist=False). The default is 0.5
- gate0float
Starting range gate in metres (used if polarc_exist=False). The default is 0
- gateresfloat
Gate resolution in metres (used if polarc_exist=False). The default is 250
Returns#
- geogriddict
- Dictionary containing georeferenced arrays:
‘grid_rectx’, ‘grid_recty’ : Cartesian grid coordinates in kilometres
‘beam_height [km]’ : beam centre heights in kilometres
‘beambottom_height [km]’ : beam bottom heights in kilometres
‘beamtop_height [km]’ : beam top heights in kilometres
- basedict
- Dictionary with base polar coordinates (always in radians/metres):
‘azim [rad]’ : azimuth angles in radians
‘elev [rad]’ : elevation angles in radians
‘range [m]’ : range values in metres
Notes#
The rectangular grid is returned in kilometres to match convention.