pysrw.magnets.CustomMagnet

pysrw.magnets.CustomMagnet#

class pysrw.magnets.CustomMagnet(magField, ranges, numPer=1, centerCoord=[0, 0, 0], interp='bicubic')[source]#

Bases: Magnet

__init__(magField, ranges, numPer=1, centerCoord=[0, 0, 0], interp='bicubic')[source]#

A magnetic device with an arbitrary field.

Parameters:
  • magField – a list with [Bx, By, Bz]. Each element is a numpy tensor which determines the 3D distribution of the corresponding field component.

  • ranges – a list with [rx, ry, rz] which determines the absolute extension of the magnetic region in meters.

  • numPer (optional) – number of repetition of the custom field, useful to create periodic devices with custom fields. Defaults to 1.

  • centerCoord (optional) – magnet centre position. Defaults to [0, 0, 0].

  • interp (optional) – one of the configuration.MAG_INTERP interpolation strategies to adapt the magField to the mesh of the device. Defaults to ‘bicubic’.

Methods

__init__(magField, ranges[, numPer, ...])

A magnetic device with an arbitrary field.