desc.equilibrium.Equilibrium.map_coordinates

Equilibrium.map_coordinates(coords, inbasis, outbasis=('rho', 'theta', 'zeta'), guess=None, period=(inf, inf, inf), tol=1e-06, maxiter=30, **kwargs)Source

Given coordinates in inbasis, compute corresponding coordinates in outbasis.

First solves for the computational coordinates that correspond to inbasis, then evaluates outbasis at those locations.

NOTE: this function cannot be JIT compiled or differentiated with AD.

Parameters:
  • coords (ndarray, shape(k,3)) – 2D array of input coordinates. Each row is a different point in space.

  • inbasis (tuple of str) – Labels for input and output coordinates, eg (“R”, “phi”, “Z”) or (“rho”, “alpha”, “zeta”) or any combination thereof. Labels should be the same as the compute function data key

  • outbasis (tuple of str) – Labels for input and output coordinates, eg (“R”, “phi”, “Z”) or (“rho”, “alpha”, “zeta”) or any combination thereof. Labels should be the same as the compute function data key

  • guess (None or ndarray, shape(k,3)) – Initial guess for the computational coordinates [‘rho’, ‘theta’, ‘zeta’] corresponding to coords in inbasis. If None, heuristics are used based on in basis and a nearest neighbor search on a coarse grid.

  • period (tuple of float) – Assumed periodicity for each quantity in inbasis. Use np.inf to denote no periodicity.

  • tol (float) – Stopping tolerance.

  • maxiter (int > 0) – Maximum number of Newton iterations

Returns:

coords (ndarray, shape(k,3)) – Coordinates mapped from inbasis to outbasis. Values of NaN will be returned for coordinates where root finding did not succeed, possibly because the coordinate is not in the plasma volume.