merge_compatible_coords_attrs
Merge the coordinates and attributes of patches or raise if incompatible.
The rules for compatibility are:
- The patches must be the same kind: no conflicting values for the attributes named by the config option
patch_kind_attrs(seecheck_kind). - Patches must share the same dimensions unless dim_intersection == True.
- All shared dimensional coordinates must be strictly equal
- If patches share a non-dimensional coordinate they must be equal.
The remaining attributes never decide compatibility: the first patch’s values are kept and attributes only the second has are added. Any coordinates contained by a single patch will be included in the output.
Parameters
| Parameter | Description |
|---|---|
| patch1 | The first patch |
| patch2 | The second patch |
| dim_intersection |
If True, merge if any dimensions overlap, else raise if all do not overlap. |
| validate_coords |
If True, ensure the coords are equal, else the responsibility for this was handled upstream. |