sdf_xarray.dataarray_accessor.EpochAccessor

sdf_xarray.dataarray_accessor.EpochAccessor#

class sdf_xarray.dataarray_accessor.EpochAccessor(xarray_obj)[source]#

Bases: object

Parameters:

xarray_obj (xr.DataArray)

__init__(xarray_obj)[source]#
Parameters:

xarray_obj (DataArray)

Methods

__init__(xarray_obj)

animate(*args, **kwargs)

Generate animations of Epoch data.

plot(*args, **kwargs)

Builds upon xarray.DataArray.plot while changing some of its default behaviours.

animate(*args, **kwargs)[source]#

Generate animations of Epoch data.

Parameters:
  • args – Positional arguments passed to animation().

  • kwargs – Keyword arguments passed to animation().

Return type:

FuncAnimation

Examples

>>> anim = ds["Electric_Field_Ey"].epoch.animate()
>>> anim.save("animation.gif")
>>> # Or in a jupyter notebook:
>>> anim.show()
plot(*args, **kwargs)[source]#

Builds upon xarray.DataArray.plot while 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.pcolormesh function which takes assumes that x = dim[1] and y = dim[0].

Parameters:
Return type:

DataArrayPlotAccessor