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:
name (
str
) – The name of this TimeSeries datasetdata (
ndarray
orlist
ortuple
orDataset
orArray
orStrDataset
orHDMFDataset
orAbstractDataChunkIterator
orDataIO
orTimeSeries
) – The annotations over time. Must be 1D.timestamps (
ndarray
orlist
ortuple
orDataset
orArray
orStrDataset
orHDMFDataset
orAbstractDataChunkIterator
orDataIO
orTimeSeries
) – Timestamps for samples stored in datacomments (
str
) – Human-readable comments about this TimeSeries datasetdescription (
str
) – Description of this TimeSeries dataset
- 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 datasetfeature_units (
Iterable
) – The unit of each featurefeatures (
Iterable
) – Description of each featuredata (
ndarray
orlist
ortuple
orDataset
orArray
orStrDataset
orHDMFDataset
orAbstractDataChunkIterator
orDataIO
orTimeSeries
) – The data values. May be 1D or 2D. The first dimension must be time. The optional second dimension represents featuresresolution (
float
) – The smallest meaningful difference (in specified unit) between values in dataconversion (
float
) – Scalar to multiply each element in data to convert it to the specified unittimestamps (
ndarray
orlist
ortuple
orDataset
orArray
orStrDataset
orHDMFDataset
orAbstractDataChunkIterator
orDataIO
orTimeSeries
) – Timestamps for samples stored in datastarting_time (
float
) – The timestamp of the first samplerate (
float
) – Sampling rate in Hzcomments (
str
) – Human-readable comments about this TimeSeries datasetdescription (
str
) – Description of this TimeSeries datasetcontrol (
Iterable
) – Numerical labels that apply to each element in datacontrol_description (
Iterable
) – Description of each control valueoffset (
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
- 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:
name (
str
) – The name of this TimeSeries datasetdata (
ndarray
orlist
ortuple
orDataset
orArray
orStrDataset
orHDMFDataset
orAbstractDataChunkIterator
orDataIO
orTimeSeries
) – The data values. Must be 1D, where the first dimension must be time. Values are >0 if interval started, <0 if interval ended.timestamps (
ndarray
orlist
ortuple
orDataset
orArray
orStrDataset
orHDMFDataset
orAbstractDataChunkIterator
orDataIO
orTimeSeries
) – Timestamps for samples stored in datacomments (
str
) – Human-readable comments about this TimeSeries datasetdescription (
str
) – Description of this TimeSeries datasetcontrol (
Iterable
) – Numerical labels that apply to each element in datacontrol_description (
Iterable
) – Description of each control value
- 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:
name (
str
) – Name of this Units interfaceid (
ndarray
orlist
ortuple
orDataset
orArray
orStrDataset
orHDMFDataset
orAbstractDataChunkIterator
orDataIO
orElementIdentifiers
) – the identifiers for this tablecolnames (
ndarray
orlist
ortuple
orDataset
orArray
orStrDataset
orHDMFDataset
orAbstractDataChunkIterator
) – the ordered names of the columns in this table. columns must also be provided.description (
str
) – a description of what is in this tableelectrode_table (
DynamicTable
) – the table that the electrodes column indexeswaveform_rate (
float
) – Sampling rate of the waveform meanswaveform_unit (
str
) – Unit of measurement of the waveform meansresolution (
float
) – The smallest possible difference between two spike times
- 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:
spike_times (
ndarray
orlist
ortuple
orDataset
orArray
orStrDataset
orHDMFDataset
orAbstractDataChunkIterator
) – the spike times for each unitobs_intervals (
ndarray
orlist
ortuple
orDataset
orArray
orStrDataset
orHDMFDataset
orAbstractDataChunkIterator
) – the observation intervals (valid times) for each unit. All spike_times for a given unit should fall within these intervals. [[start1, end1], [start2, end2], …]electrodes (
ndarray
orlist
ortuple
orDataset
orArray
orStrDataset
orHDMFDataset
orAbstractDataChunkIterator
) – the electrodes that each unit came fromelectrode_group (
ElectrodeGroup
) – the electrode group that each unit came fromwaveform_mean (
ndarray
orlist
ortuple
orDataset
orArray
orStrDataset
orHDMFDataset
orAbstractDataChunkIterator
) – the spike waveform mean for each unit. Shape is (time,) or (time, electrodes)waveform_sd (
ndarray
orlist
ortuple
orDataset
orArray
orStrDataset
orHDMFDataset
orAbstractDataChunkIterator
) – the spike waveform standard deviation for each unit. Shape is (time,) or (time, electrodes)waveforms (
ndarray
orlist
ortuple
orDataset
orArray
orStrDataset
orHDMFDataset
orAbstractDataChunkIterator
) – 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.id (
int
) – the id for each unit
- 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 datasetdata (
ndarray
orlist
ortuple
orDataset
orArray
orStrDataset
orHDMFDataset
orAbstractDataChunkIterator
orDataIO
orTimeSeries
) – 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 datasetunit (
str
) – SI unit of measurementbands (
DynamicTable
) – a table for describing the frequency bands that the signal was decomposed intosource_timeseries (
TimeSeries
) – the input TimeSeries from this analysissource_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 dataconversion (
float
) – Scalar to multiply each element in data to convert it to the specified unittimestamps (
ndarray
orlist
ortuple
orDataset
orArray
orStrDataset
orHDMFDataset
orAbstractDataChunkIterator
orDataIO
orTimeSeries
) – Timestamps for samples stored in datastarting_time (
float
) – The timestamp of the first samplerate (
float
) – Sampling rate in Hzcomments (
str
) – Human-readable comments about this TimeSeries datasetcontrol (
Iterable
) – Numerical labels that apply to each element in datacontrol_description (
Iterable
) – Description of each control valueoffset (
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:
band_name (
str
) – the name of the frequency bandband_limits (
ndarray
orlist
ortuple
orDataset
orArray
orStrDataset
orHDMFDataset
orAbstractDataChunkIterator
orDataIO
) – low and high frequencies of bandpass filter in Hzband_mean (
float
) – the mean of Gaussian filters in Hzband_stdev (
float
) – the standard deviation of Gaussian filters in Hz
- namespace = 'core'
- neurodata_type = 'DecompositionSeries'