desc.geometry.FourierRZToroidalSurface.from_values

classmethod FourierRZToroidalSurface.from_values(coords, theta, zeta=None, M=6, N=6, NFP=1, sym=True, check_orientation=True, rcond=None, w=None)Source

Create a surface from given R,Z coordinates in real space.

Parameters:
  • coords (array-like shape(num_points,3) or Grid) – cylindrical coordinates (R,phi,Z) to fit as a FourierRZToroidalSurface

  • theta (ndarray, shape(num_points,)) – Locations in poloidal angle theta where real space coordinates are given. Expects same number of angles as coords (num_points), This determines the poloidal angle for the resulting surface.

  • zeta (ndarray, shape(num_points,)) – Locations in toroidal angle zeta where real space coordinates are given. Expects same number of angles as coords (num_points), This determines the toroidal angle for the resulting surface. if None, defaults to assuming the toroidal angle is the cylindrical phi and so sets zeta = phi = coords[:,1]

  • M (int) – poloidal resolution of basis used to fit surface with. It is recommended to fit with M < num_theta points per toroidal plane, i.e. if num_points = num_theta*num_zeta , then want to ensure M < num_theta

  • N (int) – toroidal resolution of basis used to fit surface with It is recommended to fit with N < num_zeta points per poloidal plane. i.e. if num_points = num_theta*num_zeta , then want to ensure N < num_zeta

  • NFP (int) – number of toroidal field periods for surface

  • sym (bool) – True if surface is stellarator-symmetric

  • check_orientation (bool) – whether to check left-handedness of coordinates and flip if necessary.

  • rcond (float) – Relative condition number of the fit. Singular values smaller than this relative to the largest singular value will be ignored. The default value is len(x)*eps, where eps is the relative precision of the float type, about 2e-16 in most cases.

  • w (array-like, shape(num_points,)) – Weights to apply to the sample coordinates. For gaussian uncertainties, use 1/sigma (not 1/sigma**2).

Returns:

surface (FourierRZToroidalSurface) – Surface with Fourier coefficients fitted from input coords.