pyxpcm.pcm.ravel

pcm.ravel(da, dim=None, feature_name=<class 'str'>)[source]

Extract from N-d array a X(feature,sample) 2-d array and vertical dimension z

Parameters:
da: :class:`xarray.DataArray`

The DataArray to process

dim: str

Name of the vertical dimension in the input xarray.DataArray

feature_name: str

Target PCM feature name for the input xarray.DataArray

Returns:
X: xarray.DataArray

A new DataArray with dimension [‘n_sampling’,’n_features’] Note that data are always dask.array.Array.

z: numpy.array

The vertical axis of data

sampling_dims: dict()

Dictionary where keys are xarray.Dataset variable names of features and values are another dictionary with the list of sampling dimension in DIM_SAMPLING key and the name of the vertical axis in the DIM_VERTICAL key.

Examples

This function is meant to be used internally only

__author__: gmaze@ifremer.fr