xdas.asdataarray#

xdas.asdataarray(obj, tolerance=None)[source]#

Try to convert given object to a dataarray.

Only supports DataArray or xr.DataArray as input.

Parameters:
  • obj (object) – The objected to convert

  • tolerance (float or datetime64, optional) – For dense coordinates, tolerance error for interpolation representation. For time coordinates, numeric values are considered as seconds. Zero by default.

Returns:

The object converted to a DataArray. Data is not copied.

Return type:

DataArray

Raises:

ValueError – If the object cannot be converted to a DataArray.