desc.magnetic_fields.read_BNORM_file

class desc.magnetic_fields.read_BNORM_file(fname, surface, eval_grid=None, scale_by_curpol=True)Source

Read BNORM-style .txt file containing Bnormal Fourier coefficients.

Parameters:
  • fname (str) – name of BNORM file to read and use to calculate Bnormal from.

  • surface (Surface or Equilibrium) – Surface to calculate the magnetic field’s Bnormal on. If an Equilibrium is supplied, will use its boundary surface.

  • eval_grid (Grid, optional) – Grid of points on the plasma surface to evaluate the Bnormal at, if None defaults to a LinearGrid with twice the surface grid’s poloidal and toroidal resolutions

  • scale_by_curpol (bool, optional) – Whether or not to un-scale the Bnormal coefficients by curpol before calculating Bnormal, by default True (set to False if it is known that the BNORM file was saved without scaling by curpol) requires an Equilibrium to be passed in

Returns:

Bnormal (ndarray,) – Bnormal distribution from the BNORM Fourier coefficients, evaluated on the given eval_grid