Load.reshape_uniform#

pyPLUTO.Load.reshape_uniform(self, x1, x2, *args, **kwargs)[source]#

Reshapes 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: bool, default False

If True, the variable is transposed.

- var: np.ndarray

The variable to convert.

- x1: int

The first index of the variable.

- x2: int

The second index of the variable.

—-
Returns:
tuple: A tuple containing the reshaped x1, x2, varx, and vary.

Examples

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

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