pleiades.CurrentGroup

class pleiades.CurrentGroup(rz_pts=None, current=1.0, **kwargs)[source]

Grouping of Current objects that have the same current value

Parameters:
  • rz_pts (iterable, optional) – Nx2 iterable representing R,Z current centroids. Defaults to None
  • current (float, optional) – The current in all the current ring in amps, defaults to 1 amp.
  • kwargs (matplotlib patch keyword arguments) –
Variables:
  • current (float) – The current in the CurrentGroup in amps.
  • obj_list (list) – The list of Current objects that comprise the CurrentGroup
  • 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 CurrentGroup
  • patch (matplotlib.patches.Patch object) – The patch object representing the CurrentGroup for plotting
  • patchkwargs (dict) – The keyword arguments used for the patch attribute
build_patchargs(**kwargs)[source]

Build argument tuple for patchcls

classmethod from_dict(cls_dict)[source]

Create Current instance from a dictionary

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

Plot the current locations for the CurrentGroup

Parameters:
  • ax (matplotlib.Axes object) – The axes object for plotting the current locations
  • *args (tuple) – Positional arguments to pass to Current.plot method
  • **kwargs (dict, optional) – Keyword arguments to pass to Current.plot method
plot_currents(ax, *args, **kwargs)[source]

Plot the current locations for the CurrentGroup

Parameters:
  • ax (matplotlib.Axes object) – The axes object for plotting the current locations
  • *args (tuple) – Positional arguments to pass to Current.plot method
  • **kwargs (dict, optional) – Keyword arguments to pass to Current.plot method
rebuild(key, value)[source]

Reset the CurrentGroup based on the key, value pairs passed in

rotate(r0, z0, angle)[source]

Rotate the current group by a given angle around a specified pivot

Parameters:
  • r0 (float) – The R location of the pivot
  • z0 (float) – The Z location of the pivot
  • angle (float) – The angle of the rotation in degrees as measured from the z axis
to_dict()[source]

Represent the CurrentGroup as a dictionary

translate(dr, dz)[source]

Translate the current group by the vector (dr, dz)

Parameters:
  • dr (float) – The displacement in the R direction for the translation
  • dz (float) – The displacement in the Z direction for the translation
update_patch()[source]

Update the patch for the CurrentGroup