xradar is in an early stage of development, please report any issues here!

xradar.georeference.transforms.get_x_y_z#

xradar.georeference.transforms.get_x_y_z(ds, earth_radius=None, effective_radius_fraction=None)[source]#

Return Cartesian coordinates from antenna coordinates.

Parameters:
  • ds (xarray.Dataset) – Xarray dataset containing range, azimuth, and elevation

  • earth_radius (float) – Radius of the earth. Defaults to a latitude-dependent radius derived from WGS84 ellipsoid.

  • effective_radius_fraction (float) – Fraction of earth to use for the effective radius (default is 4/3).

Returns:

ds (xarray.Dataset) – Dataset including x, y, and z as coordinates.

Notes

The calculation for Cartesian coordinate is adapted from equations 2.28(b) and 2.28(c) of Doviak and Zrnić [1] assuming a standard atmosphere (4/3 Earth’s radius model).

\begin{gather*} z = \sqrt{r^2+R^2+2*r*R*sin(\theta_e)} - R \\ s = R * arcsin(\frac{r*cos(\theta_e)}{R+z}) \\ x = s * sin(\theta_a) \\ y = s * cos(\theta_a) \end{gather*}

Where r is the distance from the radar to the center of the gate, \(\theta_a\) is the azimuth angle, \(\theta_e\) is the elevation angle, s is the arc length, and R is the effective radius of the earth, taken to be 4/3 the mean radius of earth (6371 km).

References