desc.grid.Grid.meshgrid_reshape

Grid.meshgrid_reshape(x, order)Source

Reshape data to match grid coordinates.

Given flattened data on a tensor product grid, reshape the data such that the axes of the array correspond to coordinate values on the grid.

Parameters:
  • x (ndarray, shape(N,) or shape(N,3)) – Data to reshape.

  • order (str) – Desired order of axes for returned data. Should be a permutation of grid.coordinates, eg order="rtz" has the first axis of the returned data correspond to different rho coordinates, the second axis to different theta, etc. order="trz" would have the first axis correspond to theta, and so on.

Returns:

x (ndarray) – Data reshaped to align with grid nodes.