pleiades.MagnetGroup

class pleiades.MagnetGroup(**kwargs)[source]

Represent a group of dipole magnets.

Parameters:
  • rz_pts (iterable, optional) – Nx2 iterable representing R,Z current centroids. Defaults to None
  • mu_hats (iterable of float, optional) – A list of the angles of the magnetic moment for each magnet in degrees from the z axis. Defaults to None.
  • current (float, optional) – The current in all the current ring in amps, defaults to 1 amp.
  • kwargs (dict, optional) – A dictionary holding the keyword arguments for each pleiades.Magnet object.
Variables:
  • current (float) – The current in the magnet in amps.
  • obj_list (list) – The list of Current objects that comprise the Magnet
  • rzdir (np.array) – An Nx3 array whos rows are rzdir[i, :] = rloc, zloc, current which describe the current location and current value for each current in the Magnet
  • patches (list of matplotlib.patches.Patch objects) – The patch objects representing the MagnetGroup for plotting
classmethod from_dict(cls_dict)[source]

Create MagnetGroup instance from a dictionary

Parameters:cls_dict (dict) – The dictionary from which to construct a Current.
plot(ax)[source]

Plot magnets

Parameters:ax (matplotlib.Axes object) – The axis on which to plot the magnets
plot_currents(ax)[source]

Plot current locations with markers for +/-

Parameters:ax (matplotlib.Axes object) – The axis on which to plot the current location
rebuild(key, value)[source]

Reset the MAgnetGroup based on the key, value pair passed in

to_dict()[source]

Represent the MagnetGroup as a dictionary

update_patch()[source]

Udate the patches for the MagnetGroup