wradlib.georef.misc.site_distance(r, theta, binalt, re=None, ke=1.3333333333333333)
$s = k_e r_e \arcsin\left( \frac{r \cos\theta}{k_e r_e + h_n(r, \theta, r_e, k_e)}\right)$
where $$h_n$$ would be provided by bin_altitude.
Parameters: r (numpy.ndarray) – Array of ranges [m] theta (scalar or numpy.ndarray broadcastable to the shape) – of r elevation angles in degrees with 0° at horizontal and +90° pointing vertically upwards from the radar binalt (numpy.ndarray) – site altitude [m] amsl. same shape as r. re (float) – earth’s radius [m] ke (float) – adjustment factor to account for the refractivity gradient that affects radar beam propagation. In principle this is wavelength- dependent. The default of 4/3 is a good approximation for most weather radar wavelengths distance (numpy.ndarray) – Array of great circle arc distances [m]