Line

class threadcount.lines.Line(center, plus=15, minus=15, label='', save_str='', **kwargs)[source]

Bases: object

Line object containing center and wavelength range.

Create a Line instance, defining center, bandwidth, and plot/save strings.

A Line contains the information used to define the window that threadcount will use to fit the line, as well as the display and save information. You may use one of the predefined lines, or define your own. See Examples below.

Parameters:
  • center (float) – The rest wavelength of the line, in Angstroms

  • plus (float, optional) – The number of Angstroms to add to the center, by default 15

  • minus (float, optional) – The number (positive) of Angstroms to subtract from the center, by default 15

  • label (str, optional) – The string to display in plots. May contain spaces and latex symbols, by default “”

  • save_str (str, optional) – The string to prepend to filenames, by default the center wavelength rounded to integer.

Examples

Create your own Line:

>>> from threadcount.lines import Line
>>> OIII5007 = 5006.843
>>> my_line = Line(OIII5007, plus=15, minus=15, label="[OIII] 5007")

Use one of the pre-defined Lines in this module threadcount.lines (look for the Variables beginning with “L_”):

>>> import threadcount as tc
>>> my_line = tc.lines.L_OIII4959

Methods Summary

plot([ax, linestyle, color, autolabel])

Plot a vertical line at the Line center using matplotlib.axes.Axes.axvline().

Methods Documentation

plot(ax=None, linestyle='--', color='black', autolabel=True, **kwargs)[source]

Plot a vertical line at the Line center using matplotlib.axes.Axes.axvline().

Parameters:
  • ax (matplotlib.axes.Axes, optional) – axis to plot on. If none, use current axis, by default None

  • linestyle (str, optional) – valid linestyle passed to axvline(), by default “–”

  • color (str, optional) – valid color passed to axvline(), by default “black”

  • autolabel (bool, optional) – Whether to use self.label for the axvline label, by default True. Overridden by any explicit label keyword.

  • **kwargs (dict, optional) – keword arguments passed to matplotlib.axes.Axes.axvline()

Return type:

matplotlib.pyplot.axes.Axes