xarray.DataArray.pr.merge

xarray.DataArray.pr.merge#

DataArray.pr.merge(da_merge: DataArray, tolerance: float = 0.01, error_on_discrepancy: bool = True) DataArray#

Merge with da_merge with a tolerance for discrepancies in values found in both.

If values from the data to merge are already present they are treated as equal if the relative difference is below the tolerance threshold.

Parameters:
da_merge: xr.DataArray

data to merge to the calling object

tolerance: float (optional), default = 0.01

The tolerance to use when comparing data. Tolerance is relative to values in the calling Dataset. Thus by default a 1% deviation of values in da_merge from the calling Dataset is tolerated.

error_on_discrepancy: (optional), default = True

If true throw an exception if false a warning and return values from the calling object in cases of conflict.

combine_attrs (optional), default = “drop_conflicts”

Governs how to combine conflicting attrs. Is passed on to the xr merge functions.

Returns:
merged

xr.DataArray: DataArray with data from da_merge merged into the calling object