wradlib.georef.polar.spherical_to_proj

wradlib.georef.polar.spherical_to_proj(r, phi, theta, sitecoords, proj=None, re=None, ke=1.3333333333333333)

Transforms spherical coordinates (r, phi, theta) to projected coordinates centered at sitecoords in given projection.

It takes the shortening of the great circle distance with increasing elevation angle as well as the resulting increase in height into account.

Parameters
  • r (numpy.ndarray) – Contains the radial distances.

  • phi (numpy.ndarray) – Contains the azimuthal angles.

  • theta (numpy.ndarray) – Contains the elevation angles.

  • sitecoords (a sequence of three floats) – the lon / lat coordinates of the radar location and its altitude a.m.s.l. (in meters) if sitecoords is of length two, altitude is assumed to be zero

  • proj (osr object) – Destination Spatial Reference System (Projection). Defaults to wgs84 (epsg 4326).

  • 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.

Returns

coords (numpy.ndarray) – Array of shape (…, 3). Contains projected map coordinates.

Examples

A few standard directions (North, South, North, East, South, West) with different distances (amounting to roughly 1°) from a site located at 48°N 9°E

>>> r  = np.array([0.,   0., 111., 111., 111., 111.,])*1000
>>> az = np.array([0., 180.,   0.,  90., 180., 270.,])
>>> th = np.array([0.,   0.,   0.,   0.,   0.,  0.5,])
>>> csite = (9.0, 48.0)
>>> coords = spherical_to_proj(r, az, th, csite)
>>> for coord in coords:
...     print( '{0:7.4f}, {1:7.4f}, {2:7.4f}'.format(*coord))
...
 9.0000, 48.0000,  0.0000
 9.0000, 48.0000,  0.0000
 9.0000, 48.9981, 725.7160
10.4872, 47.9904, 725.7160
 9.0000, 47.0017, 725.7160
 7.5131, 47.9904, 1694.2234

Here, the coordinates of the east and west directions won’t come to lie on the latitude of the site because the beam doesn’t travel along the latitude circle but along a great circle.

See Georeferencing and Projection.