xdas.combine_by_coords#

xdas.combine_by_coords(objs, dim='first', tolerance=None, squeeze=False, virtual=None, verbose=False)[source]#

Combine several data arrays by coordinates.

The list objs if traversed and data arrays are grouped together as long as they share compatible coordinates. If a change is detected a new group is created. Shape compatibility implies same sampling interval along the combination dimension, exact equality along other dimensions and same dtype. Each group is then concatenated.

Parameters:
  • objs (list of DataArray) – The data arrays to combine.

  • dim (str, optional) – The dimension along which concatenate. Default to “first”.

  • tolerance (float or timedelta64, optional) – The tolerance to consider that the end of a file is continuous with beginning of the following. For time coordinates, numeric values are considered as seconds. Zero by default.

  • squeeze (bool, optional) – Whether to return a Database instead of a DataCollection if the combination results in a data collection containing a unique Database.

  • virtual (bool, optional) – Whether to create a virtual dataset. It requires that all concatenated data arrays are virtual. By default tries to create a virtual dataset if possible.

  • verbose (bool) – Whether to display a progress bar. Default to False.

Returns:

The combined data arrays.

Return type:

DataSequence or DataArray