wradlib.georef.polar.spherical_to_centroids#
- wradlib.georef.polar.spherical_to_centroids(r, phi, theta, site, *, crs=None)[source]#
- wradlib.georef.polar.spherical_to_centroids(obj: Dataset, **kwargs)
Generate 3-D centroids of the radar bins from the sperical coordinates (r, phi, theta).
Both azimuth and range arrays are assumed to be equidistant and to contain only unique values. The ranges are assumed to define the exterior boundaries of the range bins (thus they must be positive). The angles are assumed to describe the pointing direction fo the main beam lobe.
For further information refer to the documentation of
spherical_to_xyz.- Parameters:
r (
numpy.ndarray) – Array of ranges [m]; r defines the exterior boundaries of the range bins! (not the centroids). Thus, values must be positive!phi (
numpy.ndarray) – Array of azimuth angles containing values between 0° and 360°. The angles are assumed to describe the pointing direction fo the main beam lobe! The first angle can start at any values, but make sure the array is sorted continuously positively clockwise and the angles are equidistant. An angle if 0 degree is pointing north.theta (
float) – Elevation angle of scansite (sequence) – the lon/lat/alt coordinates of the radar location
crs – Coordinate Reference System (CRS). Can be one of:
A
pyproj.crs.CoordinateSysteminstanceA
cartopy.crs.CRSinstanceA
osgeo.osr.SpatialReferenceinstanceA type accepted by
pyproj.crs.CRS.from_user_input(e.g., EPSG code, PROJ string, dictionary, WKT, or any object with a to_wkt() method)
Defaults to AEQD.
- Returns:
output (
numpy.ndarray) – A 3-d array of bin centroids with shape(num_rays, num_bins, 3). The last dimension carries the xyz-coordinates either in aeqd or given crs.aeqd (
pyproj.crs.CoordinateSystem) – Coordinate Reference System (CRS), AEQD, only returned if crs is None.
Note
Azimuth angles of 360 deg are internally converted to 0 deg.