spacepy.seapy.Sea2d

class spacepy.seapy.Sea2d(data, times, epochs, window=3.0, delta=1.0, verbose=False, y=[])[source]

SeaPy 2D Superposed epoch analysis object

Initialize object with data (n element vector), times(y*n array), epochs, window (half-width), delta (optional), and y (two-element vector with max and min of y;optional) ‘times’ and epochs should be in some useful format Includes method to perform superposed epoch analysis of input data series

Parameters:

data : array_like

2-D array of data (0th dimension is quantity y, 1st dimension is time)

times : array_like

list of datetime objects (or list of serial times)

epochs : array_like

list of datetime objects (or serial times) for zero epochs in SEA

window : datetime.timedelta

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

delta : datetime.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

sea([storedata, quartiles, ci, mad, …]) Perform 2D superposed epoch analysis on data in object
plot([xquan, yquan, xunits, yunits, zunits, …]) Method called to create basic plot of 2D superposed epoch analysis.
sea(storedata=False, quartiles=True, ci=False, mad=False, ci_quan='median', nmask=1, **kwargs)[source]

Perform 2D 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:
 

storedata : boolean

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

quartiles : list

calculates the inter-quartile range to show the spread (and is default);

ci : float

will find the bootstrapped confidence interval (and requires ci_quan to be set)

mad : float

will use the median absolute deviation for the spread;

ci_quan : string

can be set to ‘median’ or ‘mean’

Notes

A basic plot can be raised with plot()

plot(xquan='Time Since Epoch', yquan='', xunits='', yunits='', zunits='', epochline=True, usrlimy=[], show=True, zlog=True, figsize=None, dpi=300)[source]

Method called to create basic plot of 2D superposed epoch analysis.

Uses object attributes created by sea().

Other Parameters:
 

x(y)quan : str

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

x(y/z)units : str

x(y/z)-axis units. (default = None (None))

epochline : boolean

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

usrlimy : list

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

show : boolean

shows plot; set to false to output plot object to variable (default = True)

figsize : tuple

(width, height) in inches

dpi : int

figure resolution in dots per inch (default=300)

Notes

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