wonambi.ioeeg.openephys module

Module to read open-ephys .continuous files

Todo

It assumes that the lenght of a block (i.e. record) is 1024 data points but this might change in the future.

class wonambi.ioeeg.openephys.OpenEphys(filename, session=1)[source]

Bases: object

Provide class OpenEphys, which can be used to read the folder containing Open-Ephys .continuous files

Parameters:
  • filename (Path) – Full path for the OpenEphys folder

  • session (int) – session number (starting at 1, based on open-ephys convention)

channels

list of filenames referring to channels which are actually on disk

Type:

list of dict

blocks

length of each block, in samples (currently 1024)

Type:

1D array

gain

gain to convert digital to microvolts (one value per channel)

Type:

1D array

return_dat(chan, begsam, endsam)[source]

Read the data for some/all of the channels

Parameters:
  • chan (list of int) – indices of the channels to read

  • begsam (int) – start sample to read

  • endsam (int) – end sample to read (exclusive)

Returns:

2D array – chan X samples recordings

return_hdr()[source]

Return the header for further use.

Returns:

  • subj_id (str) – subject identification code

  • start_time (datetime) – start time of the dataset

  • s_freq (float) – sampling frequency

  • chan_name (list of str) – list of all the channels

  • n_samples (int) – number of samples in the dataset

  • orig (dict) – currently empty for open-ephys

return_markers()[source]

Read the markers from the .events file