Load.reshape_uniform#

TransformManager.reshape_uniform(var1: ndarray, var2: ndarray | None = None, var3: ndarray | None = None, **kwargs: Unpack[ReshapeKwargs]) tuple[ndarray, ndarray, list[ndarray]][source]

Reshape a non-uniform (cartesian) 2D grid into a uniform grid.

Parameters:
- nx1: int, default len(x1)

The number of grid points in the first direction.

- nx2: int, default len(x2)

The number of grid points in the second direction.

- transpose: True/False, default False

Transposes the variable matrix. Use is not recommended if not really necessary (e.g. in case of highly customized variables and plots).

- var1 (not optional): np.ndarray

The first variable to reshape.

- var2: np.ndarray | None, default None

The second variable to reshape.

- var3: np.ndarray | None, default None

The third variable to reshape.

- x1: np.ndarray, default self.x1

The first grid coordinate.

- x2: np.ndarray, default self.x2

The second grid coordinate.

Returns:
tuple: A tuple containing the reshaped x1, x2 and the variables.

Examples

  • Example #1: Reshape the grid into a uniform grid

    >>> x1new, x2new, varx = reshape_uniform(var, x1=x1, x2=x2)