spacepy.pybats.kyoto.KyotoKp¶
- class spacepy.pybats.kyoto.KyotoKp(lines=None, *args, **kwargs)[source]¶
Handles global Kp index from Kyoto WDC.
Use the specialized constructor functions
fetch()
and load() to instantiate from the web or from file.- __init__(lines=None, *args, **kwargs)[source]¶
Base class for “Data Model” representation data
Abstract method, reimplement
- Attributes:
- attrsdict
dictionary of the attributes of the SpaceData object
Methods
add_histplot
([target, loc, label, ...])Make a quick histogram-style plot of the Kp data.
Attributes
- add_histplot(target=False, loc=111, label='Kyoto $K_{p}$', time_range=None, filled=False, level_kwargs={}, **kwargs)[source]¶
Make a quick histogram-style plot of the Kp data.
- Returns:
- figmatplotlib figure object
- axmatplotlib axes object
- Other Parameters:
- targetFigure or Axes
If None (default), a new figure is generated from scratch. If a matplotlib Figure object, a new axis is created to fill that figure. If a matplotlib Axes object, the plot is placed into that axis.
- locint
Use to specify the subplot placement of the axis (e.g. loc=212, etc.) Used if target is a Figure or None. Default 111 (single plot).
- labelstring
The label applied to the line when a legend is added to the axes. Defaults to ‘Kyoto $K_{p}$’.
- time_rangetuple of datetimes
The time range to plot. Only the first and last values in the tuple (or list) are used if the number of elements is greater than two. Defaults to None, meaning that the full time range available is used.
- filledBoolean
If True, make a filled ‘traffic light’ plot of Kp using spacepy.plot.levelPlot. Extra keyword arguments for levelPlot can be supplied via level_kwargs.
- Extra keyword arguments are passed to :func:`matplotlib.pyplot.plot`
- to customize the line style (and are ignored if filled is True).
Examples
>>> import matplotlib.pyplot as plt >>> import spacepy.pybats.kyoto as kt >>> kp = kt.fetch('kp', (1981, 11), (1981, 11)) >>> kp.add_histplot(lw=2.0, color='r', label='Example Kp') >>> ax = plt.gca() >>> kp.add_histplot(filled=True)
- attrs: collections.abc.Mapping¶