sdf_xarray.dataarray_accessor.EpochAccessor#
- class sdf_xarray.dataarray_accessor.EpochAccessor(xarray_obj)[source]#
Bases:
object- Parameters:
xarray_obj (xr.DataArray)
Methods
__init__(xarray_obj)animate(*args, **kwargs)Generate animations of Epoch data.
limit(limits[, drop])Drops values outside the specified limits.
plot([hist])Builds upon
xarray.DataArray.plotwhile changing some of its default behaviours.resize(new_shape)Resizes a
xarray.DataArrayto another shape.- animate(*args, **kwargs)[source]#
Generate animations of Epoch data.
- Parameters:
args – Positional arguments passed to
animation().kwargs – Keyword arguments passed to
animation().
- Return type:
Examples
>>> anim = ds["Electric_Field_Ey"].epoch.animate() >>> anim.save("animation.gif") >>> # Or in a jupyter notebook: >>> anim.show()
- plot(hist=False, *args, **kwargs)[source]#
Builds upon
xarray.DataArray.plotwhile changing some of its default behaviours.These changes are:
Flips the default axes order for 2D plots so that x and y are on the correct axes. This exists because plotting of 2D data in xarray uses the
xarray.plot.pcolormeshfunction which takes assumes thatx = dim[1]andy = dim[0].
- Parameters:
hist – If
True, will plot a histogram regardless of dimensionality (default =False).args – Positional arguments passed to
xarray.DataArray.plot.kwargs – Keyword arguments passed to
xarray.DataArray.plot.
- Return type:
DataArrayPlotAccessor
- resize(new_shape)[source]#
Resizes a
xarray.DataArrayto another shape. The returned array must have the same dimensionality as the input array.- Parameters:
new_shape – The shape of the new
xarray.DataArray, must be the same length as self.shape.- Return type: