shxarray.core.shxarbase#

class shxarray.core.shxarbase.ShXrBase(xarray_obj)#

Bases: object

auxcoords()#

Return the auxiliary coordinates of the spherical harmonic data :return: dictionary with auxiliary coordinates :rtype: dict

build_nmindex(suf='')#
drop_nmindex(suf='')#
property gravtype#

Returns the registered gravitational type of the content

static lonlat_grid(nmax, engine='shlib', **kwargs)#

Return a dataset with the required lon/lat coordinates needed for a given maximum degree

Parameters:
  • nmax (int) – Maximum degree of the spherical harmonic expansion

  • engine (str, optional) – The compute engine to use. The default is “shlib”.

  • **kwargs (dict) – Additional keyword arguments to be passed to the engine. For example, the grid type can be set with the gtype keyword

Returns:

A xarray.Dataset with the required lon/lat span as cooridnates

Return type:

xarray.Dataset

property nmax#

maximum degree of the spherical harmonic dataset :return: maximum degree :rtype: int

property nmin#

Minimum degree of the spherical harmonic data :return: minimum degree :rtype: int

set_nmindex(shimi, suf='')#

Sets the spherical harmonic coordinate indesd from a given pandas multiindex

toggle_nm()#

Toggle naming of nm, nm_ multindices and their levels

truncate(nmax=None, nmin=None, dims=['nm'])#

Truncate the maximum and/or minimum degree of the spherical harmonic coordinate and corresponding variables :param nmax: (int) maximum spherical harmonic degree to keep :param nmin: (int) minimum spherical harmonic degree to keep :param dims: list of SH dimensions to truncate over default [‘shi’]. Alternatively specify [’shi_’] or both :return: A new truncated data array :rtype: xarray.DataArray