pynwb.event module

class pynwb.event.TimestampVectorData(name, description, data=[], resolution=None)[source]

Bases: VectorData

A 1-dimensional VectorData that stores timestamps in seconds from the session start time.

Parameters:
  • name (str) – Name of this TimestampVectorData

  • description (str) – Description of this TimestampVectorData

  • data (ndarray or list or tuple or Dataset or Array or StrDataset or HDMFDataset or AbstractDataChunkIterator or DataIO) – a dataset where the first dimension is a concatenation of multiple vectors

  • resolution (float) – The temporal resolution of the timestamps, in seconds. This is typically the sampling period (1 / sampling_rate), also known as the clock period, of the data acquisition system from which the timestamps were recorded or derived.

property unit

The unit of measurement for the timestamps, fixed to ‘seconds’.

namespace = 'core'
neurodata_type = 'TimestampVectorData'
class pynwb.event.DurationVectorData(name, description, data=[], resolution=None)[source]

Bases: VectorData

A 1-dimensional VectorData that stores durations in seconds.

Parameters:
  • name (str) – Name of this DurationVectorData

  • description (str) – Description of this DurationVectorData

  • data (ndarray or list or tuple or Dataset or Array or StrDataset or HDMFDataset or AbstractDataChunkIterator or DataIO) – a dataset where the first dimension is a concatenation of multiple vectors

  • resolution (float) – The temporal resolution of the durations, in seconds. This is typically the sampling period (1 / sampling_rate), also known as the clock period, of the data acquisition system from which the durations were recorded or derived.

property unit

The unit of measurement for the durations, fixed to ‘seconds’.

namespace = 'core'
neurodata_type = 'DurationVectorData'
class pynwb.event.EventsTable(name, description, id=None, columns=None, colnames=None, target_tables=None, meanings_tables=None)[source]

Bases: DynamicTable

A column-based table to store information about events (event instances), one event per row. Additional columns may be added to store metadata about each event, such as the duration of the event.

Parameters:
  • name (str) – Name of this EventsTable

  • description (str) – A description of the events stored in the table, including information about how the event times were computed.

  • id (ndarray or list or tuple or Dataset or Array or StrDataset or HDMFDataset or AbstractDataChunkIterator or DataIO or ElementIdentifiers) – the identifiers for this table

  • columns (tuple or list) – the columns in this table

  • colnames (ndarray or list or tuple or Dataset or Array or StrDataset or HDMFDataset or AbstractDataChunkIterator) – the ordered names of the columns in this table. columns must also be provided.

  • target_tables (dict) – dict mapping DynamicTableRegion column name to the table that the DTR points to. The column is added to the table if it is not already present (i.e., when it is optional).

  • meanings_tables (tuple or list) – MeaningsTable objects that provide meanings for values in VectorData columns. Each MeaningsTable must have a name of “{column_name}_meanings” where column_name is the name of the target column in this DynamicTable. The target column must exist in this table.

add_event(timestamp, duration=None, annotation=None)[source]

Add an event to the table.

Parameters:
  • timestamp (float) – The time that the event occurred, in seconds, from the session start time.

  • duration (float) – The duration of the event, in seconds. Use NaN for events without a duration.

  • annotation (str) – User annotation about the event.

namespace = 'core'
neurodata_type = 'EventsTable'