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, source_description=None, id=None, columns=None, colnames=None, target_tables=None, meanings_tables=None)[source]

Bases: DynamicTable

A column-based table to store information about events, one event per row.

Use EventsTable when each row is anchored at a single timestamp and duration is absent, optional, or mixed across rows. Additional columns may be added to store metadata about each event, such as the duration of the event. Examples include TTL pulses, licks, rewards, stimulus onsets, and detected ripples. Each EventsTable should hold events of a single type, so that all rows share the same set of per-event metadata columns. Events of different types (e.g., licks and stimulus presentations) should be stored in separate EventsTable instances.

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.

  • source_description (str) – Optional short text description of where the events came from, applying to every row in the table. For example, “Acquisition system” for events emitted directly by the acquisition system, “Thresholding of analog signal ANALOG1 at 3 V” for events produced by a detection algorithm, or “Manual video review” for events added by a human annotator.

  • 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'