pynwb.misc module

class pynwb.misc.AnnotationSeries(name, source, data=[], timestamps=None, comments='no comments', description='no description', parent=None)

Bases: pynwb.base.TimeSeries

Stores text-based records about the experiment. To use the AnnotationSeries, add records individually through add_annotation() and then call finalize(). Alternatively, if all annotations are already stored in a list, use set_data() and set_timestamps()

All time series are created by calls to NWB.create_timeseries(). They should not not be instantiated directly

Parameters:
  • name (str) – The name of this TimeSeries dataset
  • source (str) – Name of TimeSeries or Modules that serve as the source for the data contained here. It can also be the name of a device, for stimulus or acquisition data
  • data (ndarray or list or tuple or Dataset or AbstractDataChunkIterator or DataIO or FORMDataset or TimeSeries) – The data this TimeSeries dataset stores. Can also store binary data e.g. image frames
  • timestamps (ndarray or list or tuple or Dataset or AbstractDataChunkIterator or DataIO or FORMDataset or TimeSeries) – Timestamps for samples stored in data
  • comments (str) – Human-readable comments about this TimeSeries dataset
  • description (str) – Description of this TimeSeries dataset
  • parent (NWBContainer) – The parent NWBContainer for this NWBContainer
add_annotation(time, annotation)

Add an annotation

Parameters:
  • time (float) – The time for the anotation
  • annotation (str) – the annotation
namespace = 'core'
neurodata_type = 'AnnotationSeries'
class pynwb.misc.AbstractFeatureSeries(name, source, feature_units, features, data=[], resolution=0.0, conversion=1.0, timestamps=None, starting_time=None, rate=None, comments='no comments', description='no description', control=None, control_description=None, parent=None)

Bases: pynwb.base.TimeSeries

Represents the salient features of a data stream. Typically this will be used for things like a visual grating stimulus, where the bulk of data (each frame sent to the graphics card) is bulky and not of high value, while the salient characteristics (eg, orientation, spatial frequency, contrast, etc) are what important and are what are used for analysis

All time series are created by calls to NWB.create_timeseries(). They should not not be instantiated directly

Parameters:
  • name (str) – The name of this TimeSeries dataset
  • source (str) – Name of TimeSeries or Modules that serve as the source for the data contained here. It can also be the name of a device, for stimulus or acquisition data
  • feature_units (str or Iterable) – The unit of each feature
  • features (str or Iterable) – Description of each feature
  • data (ndarray or list or tuple or Dataset or AbstractDataChunkIterator or DataIO or FORMDataset or TimeSeries) – The data this TimeSeries dataset stores. Can also store binary data e.g. image frames
  • resolution (float) – The smallest meaningful difference (in specified unit) between values in data
  • conversion (float) – Scalar to multiply each element in data to convert it to the specified unit
  • timestamps (ndarray or list or tuple or Dataset or AbstractDataChunkIterator or DataIO or FORMDataset or TimeSeries) – Timestamps for samples stored in data
  • starting_time (float) – The timestamp of the first sample
  • rate (float) – Sampling rate in Hz
  • comments (str) – Human-readable comments about this TimeSeries dataset
  • description (str) – Description of this TimeSeries dataset
  • control (Iterable) – Numerical labels that apply to each element in data
  • control_description (Iterable) – Description of each control value
  • parent (NWBContainer) – The parent NWBContainer for this NWBContainer
features

Description of each feature

feature_units

The unit of each feature

add_features(time, features)
Parameters:
  • time (float) – the time point of this feature
  • features (list or ndarray) – the feature values for this time point
namespace = 'core'
neurodata_type = 'AbstractFeatureSeries'
class pynwb.misc.IntervalSeries(name, source, data=[], timestamps=[], comments='no comments', description='no description', control=None, control_description=None, parent=None)

Bases: pynwb.base.TimeSeries

Stores intervals of data. The timestamps field stores the beginning and end of intervals. The data field stores whether the interval just started (>0 value) or ended (<0 value). Different interval types can be represented in the same series by using multiple key values (eg, 1 for feature A, 2 for feature B, 3 for feature C, etc). The field data stores an 8-bit integer. This is largely an alias of a standard TimeSeries but that is identifiable as representing time intervals in a machinereadable way.

Parameters:
  • name (str) – The name of this TimeSeries dataset
  • source (str) – Name of TimeSeries or Modules that serve as the source for the data contained here. It can also be the name of a device, for stimulus or acquisition data
  • data (ndarray or list or tuple or Dataset or AbstractDataChunkIterator or DataIO or FORMDataset or TimeSeries) – >0 if interval started, <0 if interval ended.
  • timestamps (ndarray or list or tuple or Dataset or AbstractDataChunkIterator or DataIO or FORMDataset or TimeSeries) – Timestamps for samples stored in data
  • comments (str) – Human-readable comments about this TimeSeries dataset
  • description (str) – Description of this TimeSeries dataset
  • control (Iterable) – Numerical labels that apply to each element in data
  • control_description (Iterable) – Description of each control value
  • parent (NWBContainer) – The parent NWBContainer for this NWBContainer
add_interval(start, stop)
Parameters:
  • start (float) – The name of this TimeSeries dataset
  • stop (float) – The name of this TimeSeries dataset
data
timestamps
namespace = 'core'
neurodata_type = 'IntervalSeries'
class pynwb.misc.UnitTimes(source, unit_ids=[], spike_times=[], spike_times_index=[], name='UnitTimes')

Bases: pynwb.core.NWBDataInterface

Event times of observed units (e.g. cell, synapse, etc.). The UnitTimes group contains a group for each unit. The name of the group should match the value in the source module, if that is possible/relevant (e.g., name of ROIs from Segmentation module).

Parameters:
  • source (str) – Name, path or description of where unit times originated.
  • unit_ids (ndarray or list or tuple or Dataset or AbstractDataChunkIterator or DataIO or FORMDataset or ElementIdentifiers) – the identifiers for the units stored in this interface
  • spike_times (ndarray or list or tuple or Dataset or AbstractDataChunkIterator or DataIO or FORMDataset or VectorData) – a concatenated list of spike times for the units stored in this interface
  • spike_times_index (ndarray or list or tuple or Dataset or AbstractDataChunkIterator or DataIO or FORMDataset or VectorIndex) – the indices in spike_times that correspond to each unit in unit_ids
  • name (str) – Name of this UnitTimes interface
unit_ids

the identifiers for the units stored in this interface

spike_times

a concatenated list of spike times for the units stored in this interface

spike_times_index

the indices in spike_times that correspond to each unit in unit_ids

namespace = 'core'
neurodata_type = 'UnitTimes'
get_unit_spike_times(index)
Parameters:index (int) – the index of the unit in unit_ids to retrieve spike times for
add_spike_times(unit_id, spike_times)
Parameters:
  • unit_id (int) – the unit to add spike times for
  • spike_times (ndarray or list or tuple or Dataset or AbstractDataChunkIterator) – the spike times for the unit
Returns:

the index of the added unit in this UnitTimes

Return type:

int