pemtk.sym._util

Utility functions for symmetrized harmonics routines.

23/03/22

Module Contents

Functions

prefixAxisTitles(p[, prefix, keepTitle])

General get/set title for SHtools plot objects.

listPGs()

Return list of supported Point Groups (libmsym, https://github.com/mcodev31/libmsym).

toePSproc(coeffs[, dimMap, sumDims, dataType, verbose])

Convert/conform Xarray of symmetrized harmonics to reference ePSproc data structures.

toePSman([scatSym, contSym])

Set ePSman style symList from (contSym,scatSym) items.

pemtk.sym._util.prefixAxisTitles(p, prefix='', keepTitle=True)[source]

General get/set title for SHtools plot objects.

Sets title to prefix, plus any existing text. Bit of a hack, but fixes issues with missing grid.plot(title) functionality in some versions.

Required in testing for pyshtool v4.5, matplotlib v3.2.0. Not required for pyshtools v4.9.

Parameters:
  • p (grid.plot() returned object, usually (fig, [axes]), may be nested.) –

  • prefix (str, optional, default = '') – Prefix string to apply. If keepTitle = False this will be used as the title.

  • keepTitle (bool, optional, default = True) – Keep existing title text?

pemtk.sym._util.listPGs()[source]

Return list of supported Point Groups (libmsym, https://github.com/mcodev31/libmsym).

pemtk.sym._util.toePSproc(coeffs, dimMap={'C': 'Cont', 'h': 'it'}, sumDims=[], dataType='BLM', verbose=1)[source]

Convert/conform Xarray of symmetrized harmonics to reference ePSproc data structures.

This allows for quick use of general functions for matrix elements and BLM parameters (e.g. plotting), although may not work in all cases.

Note this requires ep.util.listFuncs for definitions.

Parameters:
  • coeffs (dictionary) – Contains symmetrized harmonic coeffs, as per pemtk.symHarm.symHarm() class definitions.

  • dimMap (dictionary, default = {'C':'Cont','h':'it'}) – Any specific dim remapping required. The default case remaps to ePSproc labels ‘Cont’ and ‘it’.

  • sumDims (list, optional, default = []) – Dims to sum over. This currently supports only unstacked dims in the INPUT array. TODO: better dim handling here.

  • dataType (str, default = 'BLM') – Data type to conform to. See ep.dataTypesList() for all supported types. For harmonics, ‘BLM’ or ‘matE’ are suggested.

Returns:

XR

Return type:

renamed & restacked DataArray

pemtk.sym._util.toePSman(scatSym=None, contSym=None)[source]

Set ePSman style symList from (contSym,scatSym) items.

For symHarm class, use class wrapper self.toePSman, which uses:

scatSym = symBasis.continuum[‘allowed’][‘scatList’] contSym = symBasis.continuum[‘allowed’][‘targList’]

And see also epsman.esData.setePSinputs, which specifies: # Symmetry pairs for ScatSym (==ion x electron symm) and ScatContSym (==electron symm), input file will loop through these Ssym=({’ ‘.join([item[0] for item in symList])}) Csym=({’ ‘.join([item[1] for item in symList])})