desc.magnetic_fields.SplineMagneticField.from_mgrid
- classmethod SplineMagneticField.from_mgrid(mgrid_file, extcur=1, method='cubic', extrap=False, period=None)Source
Create a SplineMagneticField from an “mgrid” file from MAKEGRID.
- Parameters:
mgrid_file (str or path-like) – path to mgrid file in netCDF format
extcur (array-like) – currents for each subset of the field
method (str) – interpolation method
extrap (bool) – whether to extrapolate beyond the domain of known field values or return nan
period (float) – period in the toroidal direction (usually 2pi/NFP)