grids.mixins.core.GridUtilsMixin.compute_coords_from_slices#

GridUtilsMixin.compute_coords_from_slices(slices: slice | Sequence[slice], /, axes: AxesInput | None = None, origin: Literal['active', 'global'] = 'active', __validate__: bool = True)[source]#

Compute coordinate arrays over a region of the grid specified by slice objects.

Parameters:
  • slices (slice or list of slice) – Slice(s) specifying the region to extract along the selected axes.

  • axes (str or list of str, optional) – Axes to apply the slices to. If None, all axes are used.

  • origin ({"active", "global"}, default "active") – Whether the slices are relative to the active domain (excluding ghost zones) or the full ghost-augmented domain.

  • __validate__ (bool, default True) – Enable or disable all validation procedures. This should only be done in tight loop scenarios where performance is critical and typing is well controlled.

Returns:

Physical coordinate arrays corresponding to the sliced region, one per axis.

Return type:

tuple of np.ndarray