desc.magnetic_fields.SumMagneticField.compute_magnetic_field

SumMagneticField.compute_magnetic_field(coords, params=None, basis='rpz', grid=None)Source

Compute magnetic field at a set of points.

Parameters:
  • coords (array-like shape(N,3) or Grid) – cylindrical or cartesian coordinates

  • params (list or tuple of dict, optional) – parameters to pass to underlying fields. If None, uses the default parameters for each field. If a list or tuple, should have one entry for each component field.

  • basis ({"rpz", "xyz"}) – basis for input coordinates and returned magnetic field

  • grid (Grid, int or None) – Grid used to discretize MagneticField object if calculating B from biot savart. If an integer, uses that many equally spaced points.

Returns:

field (ndarray, shape(N,3)) – scaled magnetic field at specified points