wonambi.graphoelement module

This module contains classes of graphoelements.

These graphoelements can be generated by the package “detect”.

class wonambi.graphoelement.Arousals[source]

Bases: Graphoelement

Class containing all the arousals in one dataset.

events
list of arousals, where each arousal contains:
  • start_timefloat

    start time of the arousal

  • end_timefloat

    end time of the arousal

  • chan’: str

    channel label

Type:

list of dict

class wonambi.graphoelement.Graphoelement[source]

Bases: object

Class containing all the events of one type in one dataset.

chan_name

list of channels

Type:

ndarray (dtype=’U’)

to_annot(annot, name=None, chan=None)[source]

Write events to Annotations file.

Parameters:
  • annot (instance of Annotations) – Annotations file

  • name (str) – name for the event type

to_data(parameter, operator=<function mean>)[source]
class wonambi.graphoelement.Ripple[source]

Bases: Graphoelement

class wonambi.graphoelement.SlowWaves[source]

Bases: Graphoelement

Class containing all the slow waves in one dataset.

events
list of slow waves, where each SW contains:
  • start_timefloat

    start time of the SW

  • trough_timefloat

    time of the lowest value

  • zero_timefloat

    time of the neg to pos zero-crossing

  • peak_timefloat

    time of the highest value

  • end_timefloat

    end time of the SW

  • trough_valfloat

    the lowest value

  • peak_valfloat

    the highest value

  • dur: float

    duration of the SW

  • area_under_curvefloat

    sum of all values divided by duration

  • ptpfloat

    peak-to-peak (difference between highest and lowest value)

  • chan’: str

    channel label

Type:

list of dict

class wonambi.graphoelement.Spindles[source]

Bases: Graphoelement

Class containing all the spindles in one dataset.

mean

mean of each channel

Type:

ndarray (dtype=’float’)

std

standard deviation of each channel

Type:

ndarray (dtype=’float’)

det_value

value used for detection for each channel

Type:

ndarray (dtype=’float’)

sel_value

value used for selection for each channel

Type:

ndarray (dtype=’float’)

events
list of spindles, where each spindle contains:
  • start_timefloat

    start time of the spindle

  • end_timefloat

    end time of the spindle

  • peak_timefloat

    time of the highest value

  • peak_valfloat

    the highest value

  • chan’: str

    channel label

Type:

list of dict

wonambi.graphoelement.events_from_csv(source_file, stage=[])[source]

Import events from Wonambi event CSV.

Parameters:
  • source_file (str) – path to file CSV file

  • stage (list of str (optional)) – target stage, eg [‘NREM2’, ‘NREM3’] or [‘REM’]

Returns:

instance of wonambi.Graphoelement – class with events list