4.1.2.7. pamtra2.helpers

4.1.2.7.1. Module Contents

4.1.2.7.1.1. Classes

AttrDict

Dictionary accesible through attributes

4.1.2.7.1.2. Functions

rayleigh(diameter, K2, frequency)

To do: move this routine into separte module together with t-matrix,

provideArgKwargNames(func)

Provide all arguments and keyword arguments of a function. Does not

concatDicts(*dicts)

concatenate (ordered) dicts

swapListItems(li, i1, i2)

Swap i1 and i2 of li.

dimensionToVariables(darray, dimension, variables)

getInputCoreDims(args, coreDims)

mergeFlattResults(core_shapes=None)

Decorator to merge multiple outputs of a function's result

apply_ufunc_extended(func, *args, **kwargs)

Extended version of xarray's xr.apply_ufunc which can handle with

xrGradient(data, dimension=None)

Wrapper for np.gradient which is not available in xarray

xrFastUnstack(dataset, dim)

Faster version of xarray's unstack. Required until

rayleigh(diameter, K2, frequency)[source]

To do: move this routine into separte module together with t-matrix, mie etc code.

provideArgKwargNames(func)[source]

Provide all arguments and keyword arguments of a function. Does not work with *arg and **kwarg

concatDicts(*dicts)[source]

concatenate (ordered) dicts

swapListItems(li, i1, i2)[source]

Swap i1 and i2 of li.

class AttrDict(*args, **kwargs)[source]

Bases: collections.OrderedDict

Dictionary accesible through attributes

dimensionToVariables(darray, dimension, variables)[source]
getInputCoreDims(args, coreDims)[source]
mergeFlattResults(core_shapes=None)[source]

Decorator to merge multiple outputs of a function’s result into one joined array. Dimensions NOT in core_shapes are preserved.

apply_ufunc_extended(func, *args, **kwargs)[source]

Extended version of xarray’s xr.apply_ufunc which can handle with multiple output of a functions and dask. New keyword output_names required with a list of the names of the returned variables. Note that different types in the results are not preserved.

xrGradient(data, dimension=None)[source]

Wrapper for np.gradient which is not available in xarray

xrFastUnstack(dataset, dim)[source]

Faster version of xarray’s unstack. Required until https://github.com/pydata/xarray/issues/1560 is closed.

Unstack an existing dimension corresponding to a MultiIndex into multiple new dimensions. New dimensions will be added at the end. :param dim: Name of the existing dimension to unstack. :type dim: str

Returns

unstacked – Dataset with unstacked data.

Return type

Dataset

See also

Dataset.stack