xarray_to_patch

function of dascore.xarray.patch source

xarray_to_patch(
    data_array ,
)-> ‘dc.Patch’

Convert an xarray dataarray to a patch.

A units attribute gives the data units unless it is the CF form of data_units; one that cannot be parsed warns and stays an attribute.

Raises

PatchConversionError If a dimension is stacked (has a MultiIndex); call unstack on it first, or reset_index to keep its levels as coordinates along it.