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:
- dataarray_like
2-D array of data (0th dimension is quantity y, 1st dimension is time)
- timesarray_like
list of datetime objects (or list of serial times). Must be contiguous (constant cadence) and monotonically increasing.
- 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
.- 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 themultisea()
functionMethods
plot
([xquan, yquan, xunits, yunits, zunits, ...])Method called to create basic plot of 2D superposed epoch analysis.
sea
([storedata, quartiles, ci, mad, ...])Perform 2D superposed epoch analysis on data in object
- 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)quanstr
x(y)-axis label. (default = ‘Time since epoch’ (None))
- x(y/z)unitsstr
x(y/z)-axis units. (default = None (None))
- epochlineboolean
put vertical line at zero epoch. (default = True)
- usrlimylist
override automatic y-limits on plot. (default = [])
- showboolean
shows plot; set to false to output plot object to variable (default = True)
- figsizetuple
(width, height) in inches
- dpiint
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]’
- 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:
- storedataboolean
saves matrix of epoch windows as obj.datacube (default = False)
- quartileslist
calculates the inter-quartile range to show the spread (and is default);
- cifloat
will find the bootstrapped confidence interval (and requires ci_quan to be set)
- madfloat
will use the median absolute deviation for the spread;
- ci_quanstring
can be set to ‘median’ or ‘mean’
Notes
A basic plot can be raised with
plot()