pynwb.misc module

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

Bases: TimeSeries

Stores text-based records about the experiment. To use the AnnotationSeries, add records individually through add_annotation(). Alternatively, if all annotations are already stored in a list or numpy array, set the data and timestamps in the constructor.

Parameters:
add_annotation(time, annotation)[source]

Add an annotation.

Parameters:
  • time (float) – The time for the annotation

  • annotation (str) – the annotation

namespace = 'core'
neurodata_type = 'AnnotationSeries'
class pynwb.misc.AbstractFeatureSeries(name, feature_units, features, data=[], resolution=-1.0, conversion=1.0, timestamps=None, starting_time=None, rate=None, comments='no comments', description='no description', control=None, control_description=None, offset=0.0)[source]

Bases: 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

Parameters:
  • name (str) – The name of this TimeSeries dataset

  • feature_units (Iterable) – The unit of each feature

  • features (Iterable) – Description of each feature

  • data (ndarray or list or tuple or Dataset or Array or StrDataset or HDMFDataset or AbstractDataChunkIterator or DataIO or TimeSeries) – The data values. May be 1D or 2D. The first dimension must be time. The optional second dimension represents features

  • 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 Array or StrDataset or HDMFDataset or AbstractDataChunkIterator or DataIO 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

  • offset (float) – Scalar to add to each element in the data scaled by ‘conversion’ to finish converting it to the specified unit.

property features

Description of each feature

property feature_units

The unit of each feature

add_features(time, features)[source]
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, data=[], timestamps=None, comments='no comments', description='no description', control=None, control_description=None)[source]

Bases: 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 machine-readable way.

Parameters:
add_interval(start, stop)[source]
Parameters:
  • start (float) – The start time of the interval

  • stop (float) – The stop time of the interval

property data
property timestamps
namespace = 'core'
neurodata_type = 'IntervalSeries'
class pynwb.misc.Units(name='Units', id=None, columns=None, colnames=None, description=None, electrode_table=None, waveform_rate=None, waveform_unit='volts', resolution=None)[source]

Bases: DynamicTable

Event times of observed units (e.g. cell, synapse, etc.).

Parameters:
waveforms_desc = 'Individual waveforms for each spike. If the dataset is three-dimensional, the third dimension shows the response from different electrodes that all observe this unit simultaneously. In this case, the `electrodes` column of this Units table should be used to indicate which electrodes are associated with this unit, and the electrodes dimension here should be in the same order as the electrodes referenced in the `electrodes` column of this table.'
add_unit(spike_times=None, obs_intervals=None, electrodes=None, electrode_group=None, waveform_mean=None, waveform_sd=None, waveforms=None, id=None)[source]

Add a unit to this table

Parameters:
get_unit_spike_times(index, in_interval=None)[source]
Parameters:
  • index (int or list or tuple or ndarray) – the index of the unit in unit_ids to retrieve spike times for

  • in_interval (tuple or list) – only return values within this interval

get_unit_obs_intervals(index)[source]
Parameters:

index (int) – the index of the unit in unit_ids to retrieve observation intervals for

namespace = 'core'
neurodata_type = 'Units'
property resolution

The smallest possible difference between two spike times

property waveform_rate

Sampling rate of the waveform means

property waveform_unit

Unit of measurement of the waveform means

class pynwb.misc.DecompositionSeries(name, data, metric, description='no description', unit='no unit', bands=None, source_timeseries=None, source_channels=None, resolution=-1.0, conversion=1.0, timestamps=None, starting_time=None, rate=None, comments='no comments', control=None, control_description=None, offset=0.0)[source]

Bases: TimeSeries

Stores product of spectral analysis

Parameters:
  • name (str) – The name of this TimeSeries dataset

  • data (ndarray or list or tuple or Dataset or Array or StrDataset or HDMFDataset or AbstractDataChunkIterator or DataIO or TimeSeries) – The data values. Must be 3D, where the first dimension must be time, the second dimension must be channels, and the third dimension must be bands.

  • metric (str) – metric of analysis. recommended - ‘phase’, ‘amplitude’, ‘power’

  • description (str) – Description of this TimeSeries dataset

  • unit (str) – SI unit of measurement

  • bands (DynamicTable) – a table for describing the frequency bands that the signal was decomposed into

  • source_timeseries (TimeSeries) – the input TimeSeries from this analysis

  • source_channels (DynamicTableRegion) – The channels that provided the source data. In the case of electrical recordings this is typically a DynamicTableRegion pointing to the electrodes table at NWBFile.electrodes, similar to ElectricalSeries.electrodes.

  • 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 Array or StrDataset or HDMFDataset or AbstractDataChunkIterator or DataIO 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

  • control (Iterable) – Numerical labels that apply to each element in data

  • control_description (Iterable) – Description of each control value

  • offset (float) – Scalar to add to each element in the data scaled by ‘conversion’ to finish converting it to the specified unit.

DEFAULT_DATA = array([], shape=(0, 0, 0), dtype=uint8)
property source_timeseries

the input TimeSeries from this analysis

property source_channels

the channels that provided the source data

property metric

metric of analysis. recommended - ‘phase’, ‘amplitude’, ‘power’

property bands

the bands that the signal is decomposed into

add_band(band_name=None, band_limits=None, band_mean=None, band_stdev=None)[source]

Add ROI data to this

Parameters:
namespace = 'core'
neurodata_type = 'DecompositionSeries'