pynwb.misc module
- class pynwb.misc.AnnotationSeries(name, data=[], timestamps=None, comments='no comments', description='no description')[source]
Bases:
TimeSeriesStores 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 (
ndarrayorlistortupleorDatasetorArrayorStrDatasetorHDMFDatasetorAbstractDataChunkIteratororDataIOorTimeSeries) – The annotations over time. Must be 1D.timestamps (
ndarrayorlistortupleorDatasetorArrayorStrDatasetorHDMFDatasetorAbstractDataChunkIteratororDataIOorTimeSeries) – 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:
TimeSeriesRepresents 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 (
ndarrayorlistortupleorDatasetorArrayorStrDatasetorHDMFDatasetorAbstractDataChunkIteratororDataIOorTimeSeries) – 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 (
ndarrayorlistortupleorDatasetorArrayorStrDatasetorHDMFDatasetorAbstractDataChunkIteratororDataIOorTimeSeries) – 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:
TimeSeriesStores 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 (
ndarrayorlistortupleorDatasetorArrayorStrDatasetorHDMFDatasetorAbstractDataChunkIteratororDataIOorTimeSeries) – The data values. Must be 1D, where the first dimension must be time. Values are >0 if interval started, <0 if interval ended.timestamps (
ndarrayorlistortupleorDatasetorArrayorStrDatasetorHDMFDatasetorAbstractDataChunkIteratororDataIOorTimeSeries) – 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, target_tables=None, description=None, electrode_table=None, waveform_rate=None, waveform_unit='volts', resolution=None)[source]
Bases:
DynamicTableEvent times of observed units (e.g. cell, synapse, etc.).
- Parameters:
name (
str) – Name of this Units interfaceid (
ndarrayorlistortupleorDatasetorArrayorStrDatasetorHDMFDatasetorAbstractDataChunkIteratororDataIOorElementIdentifiers) – the identifiers for this tablecolnames (
ndarrayorlistortupleorDatasetorArrayorStrDatasetorHDMFDatasetorAbstractDataChunkIterator) – 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).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 (
ndarrayorlistortupleorDatasetorArrayorStrDatasetorHDMFDatasetorAbstractDataChunkIterator) – the spike times for each unit in secondsobs_intervals (
ndarrayorlistortupleorDatasetorArrayorStrDatasetorHDMFDatasetorAbstractDataChunkIterator) – 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 (
ndarrayorlistortupleorDatasetorArrayorStrDatasetorHDMFDatasetorAbstractDataChunkIterator) – the electrodes that each unit came fromelectrode_group (
ElectrodeGroup) – the electrode group that each unit came fromwaveform_mean (
ndarrayorlistortupleorDatasetorArrayorStrDatasetorHDMFDatasetorAbstractDataChunkIterator) – the spike waveform mean for each unit. Shape is (time,) or (time, electrodes)waveform_sd (
ndarrayorlistortupleorDatasetorArrayorStrDatasetorHDMFDatasetorAbstractDataChunkIterator) – the spike waveform standard deviation for each unit. Shape is (time,) or (time, electrodes)waveforms (
ndarrayorlistortupleorDatasetorArrayorStrDatasetorHDMFDatasetorAbstractDataChunkIterator) – 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.FrequencyBandsTable(id=None, columns=None, colnames=None, target_tables=None)[source]
Bases:
DynamicTableTable for describing the bands that DecompositionSeries was generated from.
- Parameters:
id (
ndarrayorlistortupleorDatasetorArrayorStrDatasetorHDMFDatasetorAbstractDataChunkIteratororDataIOorElementIdentifiers) – the identifiers for this tablecolnames (
ndarrayorlistortupleorDatasetorArrayorStrDatasetorHDMFDatasetorAbstractDataChunkIterator) – 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).
- add_band(band_name, band_limits, band_mean=None, band_stdev=None)[source]
- Parameters:
band_name (
str) – Name of the band, e.g. theta.band_limits (
ndarrayorlistortupleorDatasetorArrayorStrDatasetorHDMFDatasetorAbstractDataChunkIteratororDataIO) – Low and high limit of each band in Hz.band_mean (
float) – The mean Gaussian filters, in Hz.band_stdev (
float) – The standard deviation Gaussian filters, in Hz.
- namespace = 'core'
- neurodata_type = 'FrequencyBandsTable'
- 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:
TimeSeriesStores product of spectral analysis
- Parameters:
name (
str) – The name of this TimeSeries datasetdata (
ndarrayorlistortupleorDatasetorArrayorStrDatasetorHDMFDatasetorAbstractDataChunkIteratororDataIOorTimeSeries) – 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 (
FrequencyBandsTable) – 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 (
ndarrayorlistortupleorDatasetorArrayorStrDatasetorHDMFDatasetorAbstractDataChunkIteratororDataIOorTimeSeries) – 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, band_limits, band_mean=None, band_stdev=None)[source]
Add a frequency band to the bands table of this DecompositionSeries.
- Parameters:
band_name (
str) – the name of the frequency bandband_limits (
ndarrayorlistortupleorDatasetorArrayorStrDatasetorHDMFDatasetorAbstractDataChunkIteratororDataIO) – 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'