epsproc.util.listFuncs module

ePSproc list functions.

Define data types and generate lists.

Main function for data types is dataTypesList()

epsproc.util.listFuncs.ADMdimList(sType='stacked')[source]

Return standard list of dimensions for frame definitions, from epsproc.sphCalc.setADMs().

Parameters

sType (string, optional, default = 'stacked') – Selected ‘stacked’ or ‘unstacked’ dimensions. Set ‘sDict’ to return a dictionary of unstacked <> stacked dims mappings for use with xr.stack({dim mapping}).

Returns

list

Return type

set of dimension labels.

epsproc.util.listFuncs.BLMdimList(sType='stacked')[source]

Return standard list of dimensions for calculated BLM.

Parameters

sType (string, optional, default = 'stacked') – Selected ‘stacked’ or ‘unstacked’ dimensions. Set ‘sDict’ to return a dictionary of unstacked <> stacked dims mappings for use with xr.stack({dim mapping}).

Returns

list

Return type

set of dimension labels.

epsproc.util.listFuncs.YLMdimList(sType='stacked')[source]

Return standard list of dimensions for calculated YLMs (spherical harmonics).

Parameters

sType (string, optional, default = 'stacked') – Selected ‘stacked’ or ‘unstacked’ dimensions. Set ‘sDict’ to return a dictionary of unstacked <> stacked dims mappings for use with xr.stack({dim mapping}).

Returns

list

Return type

set of dimension labels.

epsproc.util.listFuncs.YLMtype(dtype=None, kind='complex', normType='ortho', csPhase=True, **kwargs)[source]

Return dict of specified YLM parameters.

epsproc.util.listFuncs.dataTypesList()[source]

Return a dict of allowed dataTypes, corresponding to epsproc processed data.

Each dataType lists ‘source’, ‘desc’ and ‘recordType’ fields.

  • ‘source’ fields correspond to ePS functions which get or generate the data.

  • ‘desc’ brief description of the dataType.

  • ‘recordType’ gives the required segment in ePS files (and associated parser). If the segment is not present in the source file, then the dataType will not be available.

  • ‘def’ provides definition function handle (if applicable).

  • ‘dims’ lists results from def(sType = ‘sDict’)

TODO: best choice of data structure here? Currently nested dictionary.

epsproc.util.listFuncs.eulerDimList(sType='stacked')[source]

Return standard list of dimensions for frame definitions, from epsproc.sphCalc.setPolGeoms().

Parameters

sType (string, optional, default = 'stacked') – Selected ‘stacked’ or ‘unstacked’ dimensions. Set ‘sDict’ to return a dictionary of unstacked <> stacked dims mappings for use with xr.stack({dim mapping}).

Returns

list

Return type

set of dimension labels.

epsproc.util.listFuncs.genLM(Lmax, allM=True)[source]

Return array of (L,M) up to supplied Lmax

If allM=False only M=0 terms will be set.

TODO: add return type options, include conversion to SHtools types.

epsproc.util.listFuncs.getRefDims(data=None, refType=None, sType='sDict')[source]

Get ref dims from dataTypesList() using data or refType.

Convenience wrapper for dataTypesList()[dataType][‘def’](sType=sType).

Parameters
  • data (optional, Xarray) – Data to use for dataType = data.attrs[‘dataType’]

  • refDims (optional, str, list or dict. Default = None.) – Reference dimensions - If None, use data.attrs[‘dataType’] - If string, use dataTypesList()[refDims][‘def’](sType=’sDict’) - Other types will be ignored and returned.

epsproc.util.listFuncs.matEdimList(sType='stacked')[source]

Return standard list of dimensions for matrix elements.

Parameters

sType (string, optional, default = 'stacked') – Selected ‘stacked’ or ‘unstacked’ dimensions. Set ‘sDict’ to return a dictionary of unstacked <> stacked dims mappings for use with xr.stack({dim mapping}).

Returns

list

Return type

set of dimension labels.