pleiades.Component

class pleiades.Component[source]

A Container for representing multiple sets of objects and assigning a Green’s function to the object. Components are like HH coils or Mirror Coils or Vessel Magnets. This is the minimum scale that has its own Green’s function - one for each group.

Variables:
  • groups (list) – A list of all the groups that comprise this Component
  • labels (list of str) – A list of all the names for the groups that comprise this Component. Each label is also accessible as an attribute on the Component as well.
  • num_groups (int) – Number of groups that make up the Component
  • currents (list of float) – A list of currents representing the current in each group in the Component
  • nprocs (int) – The number of processors to use to compute the Green’s functions
  • patches (list of matplotlib.patches.Patch objects) – A list of all the patches that represent the Component
  • patch_mask (iterable of bool) – A list of booleans of the same length as the number of groups where True indicates to hide the patch for that particular group.
  • grid (pleiades.Grid instance) – A grid on which to compute the Green’s functions for flux and magnetic fields
  • gpsi (np.array) – Green’s function for magnetic flux psi
  • gBR (np.array) – Green’s function for magnetic field component BR
  • gBZ (np.array) – Green’s function for magnetic field component BZ
  • psi (np.array) – Magnetic flux evaluated on the grid
  • BR (np.array) – Magnetic field component BR evaluated on the grid
  • BZ (np.array) – Magnetic field component BZ evaluated on the grid
compute_greens()[source]

Compute the Green’s functions for flux (psi) and BR and BZ

classmethod from_dict(cls_dict)[source]

Create Component from a dictionary

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

Plot each group including patches for all the objects in the Component

Parameters:ax (matplotlib.Axes object) – The axis on which to plot the current location
plot_currents(ax, *args, **kwargs)[source]

Plot current locations with markers for +/- for all the objects in the Component

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

Represent the component as a dictionary

update()[source]

Update the patches and Green’s function for the component

update_patches()[source]

Update the patches for the Component