pynwb.epoch module

class pynwb.epoch.Epoch(name, source, start, stop, description=None, tags=[], parent=None)

Bases: pynwb.core.NWBContainer

Epoch object Epochs represent specific experimental intervals and store references to desired time series that overlap with the interval. The references to those time series indicate the first index in the time series that overlaps with the interval, and the duration of that overlap.

Epochs should be created through NWBFile.create_epoch(). They should not be instantiated directly

Parameters:
  • name (str) – the name of the epoch, as it will appear in the file
  • source (str) – the source of the data
  • start (float) – the starting time of the epoch
  • stop (float) – the ending time of the epoch
  • description (str) – a description of this epoch
  • tags (tuple or list) – tags for this epoch
  • parent (NWBContainer) – The parent NWBContainer for this NWBContainer
add_ignore_interval(start, stop)

Each epoch has a list of intervals that can be flagged to be ignored, for example due electrical noise or poor behavior of the subject. Intervals are trimmed to fit within epoch boundaries, but no further logic is performed (eg, if overlapping intervals are specified, those overlaps will be stored)

Parameters:
Returns:

nothing

add_tag(tag)

Append string annotation to epoch. This will be stored in the epoch’s ‘tags’ dataset. Additionally, it will be added to a master tag list stored as an attribute on the root ‘epoch/’ group. Each epoch can have multiple tags. The root epoch keeps a list of unique tags

Parameters:*tag* (text) –
Returns:nothing
add_timeseries(timeseries, in_epoch_name=None)

Associates time series with epoch. This will create a link to the specified time series within the epoch and will calculate its overlaps.

Parameters:
  • *in_epoch_name* (text) –
  • the epoch (this can be different than the actual (in) –
  • series name) (time) –
  • *timeseries* (text or TimeSeries object) –
  • hdf5 path to time series that's being added, (Full) –
  • the TimeSeries object itself (or) –
Returns:

nothing

description
get_timeseries(name)
Parameters:name (str) – The name of this TimeSeries dataset
set_description(desc)

Convenience function to set the value of the ‘description’ dataset in the epoch

Parameters:*desc* (text) –
Returns:nothing
start_time
stop_time
tags
timeseries
class pynwb.epoch.EpochTimeSeries(source, ts, idx_start, count, name=None, parent=None)

Bases: pynwb.core.NWBContainer

Parameters:
  • source (str) – the source of the data
  • ts (TimeSeries) – the TimeSeries object
  • idx_start (int) – the index of the start time in this TimeSeries
  • count (int) – the number of samples available in the TimeSeries
  • name (str) – the name of this alignment
  • parent (NWBContainer) – The parent NWBContainer for this NWBContainer
count
idx_start
timeseries