xray.align

xray.align(*objects, join='inner', copy=True)

Given any number of Dataset and/or DataArray objects, returns new objects with aligned coordinates.

Array from the aligned objects are suitable as input to mathematical operators, because along each dimension they are indexed by the same coordinates.

Missing values (if join != 'inner') are filled with NaN.

Parameters:

*objects : Dataset or DataArray

Objects to align.

join : {‘outer’, ‘inner’, ‘left’, ‘right’}, optional

Method for joining the coordinates of the passed objects along each dimension:

  • ‘outer’: use the union of object coordinates
  • ‘outer’: use the intersection of object coordinates
  • ‘left’: use coordinates from the first object with each dimension
  • ‘right’: use coordinates from the last object with each dimension

copy : bool, optional

If copy=True, the returned objects contain all new variables. If copy=False and no reindexing is required then the aligned objects will include original variables.

Returns:

aligned : same as *objects

Tuple of objects with aligned coordinates.