spacepy.seapy.Sea

class spacepy.seapy.Sea(data, times, epochs, window=3.0, delta=1.0, verbose=True)[source]

SeaPy Superposed epoch analysis object

Initialize object with data, times, epochs, window (half-width) and delta (optional). ‘times’ and epochs should be in some useful format Includes method to perform superposed epoch analysis of input data series

Parameters:
dataarray_like

list or array of data

timesarray_like

list of datetime objects (or list of serial times). Must be contiguous (constant cadence) and monotonically increasing.

Changed in version 0.5.0: Issues a warning for non-contiguous/non-monotonic times.

epochsarray_like

list of datetime objects (or serial times) for zero epochs in SEA. For a suitable SEA, this should be substantially shorter than times.

Changed in version 0.5.0: Issues a warning for too many epochs; arbitrarily defined as more than half the number of times.

windowdatetime.timedelta

size of the half-window for the SEA (can also be given as serial time)

deltadatetime.timedelta

resolution of the input data series, which must be uniform (can also be given as serial time)

Notes

Output can be nicely plotted with plot(), or for multiple objects use the multisea() function

__init__(data, times, epochs, window=3.0, delta=1.0, verbose=True)[source]

Methods

plot([xquan, yquan, xunits, yunits, ...])

Method called to create basic plot of superposed epoch analysis.

sea(**kwargs)

Method called to perform superposed epoch analysis on data in object.

plot(xquan='Time Since Epoch', yquan='', xunits='', yunits='', epochline=True, usrlimy=[], show=True, target=None, loc=111, figsize=None, dpi=None, transparent=True, color='#7F7FFF')[source]

Method called to create basic plot of superposed epoch analysis.

Parameters:
Uses object attributes created by the obj.sea() method.
Other Parameters:
xquanstr

(default = ‘Time since epoch’ ) - x-axis label.

yquanstr

default None - yaxus label

xunitsstr

(default = None) - x-axis units.

yunitsstr

(default = None) - y-axis units.

epochlineboolean

(default = True) - put vertical line at zero epoch.

usrlimylist

(default = []) - override automatic y-limits on plot.

transparentboolean

(default True): make patch for low/high bounds transparent

colorstr

Color to use for the patch if not transparent. (default #7F7FFF, a medium blue)

Notes

If both quan and units are supplied, axis label will read ‘Quantity Entered By User [Units]’

sea(**kwargs)[source]

Method called to perform superposed epoch analysis on data in object.

Uses object attributes obj.data, obj.times, obj.epochs, obj.delta, obj.window, all of which must be available on instantiation.

Other Parameters:
storedataboolean

saves matrix of epoch windows as obj.datacube (default = False)

quartileslist

calculates the quartiles as the upper and lower bounds (and is default);

cifloat

will find the bootstrapped confidence intervals of ci_quan at the ci percent level (default=95)

madfloat

will use +/- the median absolute deviation for the bounds;

ci_quanstring

can be set to ‘median’ (default) or ‘mean’

Notes

A basic plot can be raised with plot()