wradlib.georef.polar.GeorefPolarMethods.spherical_to_centroids#
- GeorefPolarMethods.spherical_to_centroids(**kwargs)[source]#
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:
obj (
xarray.DataArray|xarray.Dataset)- Keyword Arguments:
crs –
Coordinate Reference System (CRS) of the coordinates. Must be provided and 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.
ke (
float) – adjustment factor to account for the refractivity gradient that affects radar beam propagation. In principle this is wavelength- dependend. The default of 4/3 is a good approximation for most weather radar wavelengths.PPI. (Currently only works for)
- Returns:
xyz (
xarray.DataArray) – Array of shape (…, 3). Contains cartesian coordinates.crs (
pyproj.crs.CoordinateSystem) – Reference System (CRS), AEQD, only returned if crs is None.
Note
Azimuth angles of 360 deg are internally converted to 0 deg.