coilpy.stellopt#

class coilpy.stellopt.OMFITascii(filename, **kw)[source]#

Bases: object

OMFIT class used to interface with ASCII files

Parameters:
  • filename – filename passed to OMFITobject class

  • fromString – string that is written to file

  • **kw – keyword dictionary passed to OMFITobject class

append(value)[source]#

Append string value to ASCII file

Parameters:

value – string to be written to file

Returns:

string

read()[source]#

Read ASCII file and return content

Returns:

string

write(value)[source]#

Write string value to ASCII file

Parameters:

value – string to be written to file

Returns:

string

class coilpy.stellopt.STELLout(*args, **kwargs)[source]#

Bases: SortedDict, OMFITascii

OMFITobject used to interface with stellopt.* file in STELLOPT outputs.

Parameters:

filename – filename passed to OMFITascii class

All additional key word arguments passed to OMFITascii

load()[source]#

Load the file and parse it into a sorted dictionary

plot(ax=None, all=True, **kwargs)[source]#
plot_balloon(it=-1, ax=None, **kwargs)[source]#

Plot Ballooning instability from COBRAVMEC

Parameters:
  • it (int, optional) – Iteration index to be plotted. Defaults to -1.

  • ax (Matplotlib axis, optional) – Matplotlib axis to be plotted on. Defaults to None.

  • kwargs (dict) – Keyword arguments for matplotlib.pyplot.plot. Defaults to {}.

Returns:

Matplotlib axis plotted on.

Return type:

ax (Matplotlib axis)

plot_helicity(it=-1, ordering=0, mn=(None, None), ax=None, log=True, normalize=False, logical_not=False, **kwargs)[source]#

Plot |B| components in Boozer coordinates from BOOZ_XFORM

Parameters:
  • it (int, optional) – Iteration index to be plotted. Defaults to -1.

  • ordering (integer, optional) – Plot the leading Nordering asymmetric modes. Defaults to 0.

  • mn (tuple, optional) – Plot the particular (m,n) mode. Defaults to (None, None).

  • ax (Matplotlib axis, optional) – Matplotlib axis to be plotted on. Defaults to None.

  • log (bool, optional) – Plot in log scale. Defaults to True.

  • normalize (bool, optionl) – Normalized to B_00. Defaults to False.

  • logical_not (bool, optional) – Unselect mn modes. Defaults to False.

  • kwargs (dict) – Keyword arguments for matplotlib.pyplot.plot. Defaults to {}.

Returns:

Matplotlib axis plotted on.

Return type:

ax (Matplotlib axis)

plot_neo(it=-1, ax=None, **kwargs)[source]#

Plot effective ripple from NEO

Parameters:
  • it (int, optional) – Iteration index to be plotted. Defaults to -1.

  • ax (Matplotlib axis, optional) – Matplotlib axis to be plotted on. Defaults to None.

  • kwargs (dict) – Keyword arguments for matplotlib.pyplot.plot. Defaults to {}.

Returns:

Matplotlib axis plotted on.

Return type:

ax (Matplotlib axis)