shxarray.geom.polygons#

shxarray.geom.polygons.polygon2sh(polygeom, nmax: int = 100, auxcoord=None, engine='shlib', **kwargs) DataArray#

Convert a mask defined by a polygon to spherical harmonic coefficients.

Parameters:
  • polygeom (GeoSeries or array_like) – Iterable with polygons which describes the mask (1 inside/0 outside) If the input is a GeoSeries, the crs of the provided geoseries will be used to do the polygon test. E.g. use a Antarctic Polar Stereographic epsg 3031, to do test for polgyons which contain the South Pole

  • nmax (int) – Maximum degree and order of the output

  • auxcoord (named Pandas.Series or dict(dimname=coordvalues)) – Auxiliary coordinate to map to the dimension of polygeom. The default will construct a coordinate with an sequential numerical index and index “id”

  • engine (str, default: 'shlib') – Backend to use for the SH analysis step. Other options could be ‘shtns’ (when installed)

Returns:

A DataArray holding the spherical harmonic coefficients up to maximum degree specified

Return type:

xr.DataArray