wradlib.georef.polar.GeorefPolarMethods#

class wradlib.georef.polar.GeorefPolarMethods[source]#

Bases: object

wradlib xarray SubAccessor methods for Georef Polar Methods.

georeference(**kwargs)[source]#

Georeference Dataset/DataArray.

New in version 1.5.

This function adds georeference data to xarray Dataset/DataArray obj.

Parameters

obj (xarray.Dataset or xarray.DataArray)

Keyword Arguments
  • crs (osgeo.osr.SpatialReference, cartopy.crs.CRS or None) – If GDAL OSR SRS, output is in this projection, else AEQD.

  • 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- dependend. The default of 4/3 is a good approximation for most weather radar wavelengths.

Returns

obj (xarray.Dataset or xarray.DataArray)

spherical_to_xyz(**kwargs)[source]#

Transforms spherical coordinates (r, phi, theta) to cartesian coordinates (x, y, z) centered at site (aeqd).

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

Parameters

obj (xarray.DataArray | xarray.Dataset)

Keyword Arguments
  • re (float) – earth’s radius [m], defaults to None (calculating from given latitude)

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

Returns

spherical_to_proj(**kwargs)[source]#

Transforms spherical coordinates (r, phi, theta) to projected coordinates centered at site 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

obj (xarray.DataArray | xarray.Dataset)

Keyword Arguments
  • crs (osgeo.osr.SpatialReference) – Destination Spatial Reference System (Projection). Defaults to wgs84 (epsg 4326).

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

Returns

coords (xarray.DataArray) – Array of shape (…, 3). Contains projected map coordinates.

spherical_to_polyvert(**kwargs)[source]#

Generate 3-D polygon vertices directly from spherical coordinates (r, phi, theta).

This is an alternative to centroid_to_polyvert which does not use centroids, but generates the polygon vertices by simply connecting the corners of the radar bins.

Both azimuth and range arrays are assumed to be equidistant and to contain only unique values. For further information refer to the documentation of spherical_to_xyz.

Currently only works for PPI.

Parameters

obj (xarray.DataArray | xarray.Dataset)

Keyword Arguments
  • crs (osgeo.osr.SpatialReference) – Destination Spatial Reference System (Projection). Defaults to wgs84 (epsg 4326).

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

Returns

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 (osgeo.osr.SpatialReference) – Destination Spatial Reference System (Projection). Defaults to wgs84 (epsg 4326).

  • 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

Note

Azimuth angles of 360 deg are internally converted to 0 deg.

georeference(**kwargs)

Georeference Dataset/DataArray.

spherical_to_centroids(**kwargs)

Generate 3-D centroids of the radar bins from the sperical coordinates (r, phi, theta).

spherical_to_polyvert(**kwargs)

Generate 3-D polygon vertices directly from spherical coordinates (r, phi, theta).

spherical_to_proj(**kwargs)

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

spherical_to_xyz(**kwargs)

Transforms spherical coordinates (r, phi, theta) to cartesian coordinates (x, y, z) centered at site (aeqd).