McsPyDataTools API Reference¶
McsPy¶
McsPy is a Python module/package to read, handle and operate on HDF5-based raw data files converted from recordings of devices of the Multi Channel Systems MCS GmbH.
copyright: |
|
---|---|
license: | see LICENSE for more details |
-
class
McsPy.
McsHdf5Protocols
[source]¶ Class of supported MCS-HDF5 protocol types and version ranges
Entry: (Protocol Type Name => Tuple of supported version range from (including) the first version entry up to (including) the second version entry)
-
classmethod
check_hdf5_protocol_version
(protocol_name, version)[source]¶ Check if the given version of the HDF5 protocol is supported
Parameters: - protocol_name – name of the protocol that is tested
- version – version number that should be checked
Returns: is true if the given protocol and version is supported
-
classmethod
check_protocol_type_version
(protocol_type_name, version)[source]¶ Check if the given version of a protocol is supported by the implementation
Parameters: - protocol_type_name – name of the protocol that is tested
- version – version number that should be checked
Returns: is true if the given protocol and version is supported
-
classmethod
-
class
McsPy.
McsHdf5Types
[source]¶ Class of supported MCS-HDF5 file structure types and version ranges
Entry: (Protocol TypeID => Tuple of supported version range from (including) the first version entry up to (including) the second version entry)
-
classmethod
get_mcs_class_name
(typeID)[source]¶ Returns the McsPy class name, that corresponds to a given Mcs HDF5 file structure type. The function also checks if the requested class supports the Mcs HDF5 file structure type version
Parameters: typeID – name of the type that is tested Returns: a McsCMOSMEA class if the given type and version is supported
-
classmethod
The ‘’McsData’’ module¶
-
class
McsPy.McsData.
RawData
(raw_data_path)[source]¶ This class holds the information of a complete MCS raw data file
Parameters: - raw_data_path – path to the HDF5 file
- h5_file – h5py File handle
- mcs_hdf5_protocol_type – protocol type. Currently, only “RawData” is supported
- mcs_hdf5_protocol_type_version – protocol version
- comment – comment string
- clr_date – recording date string
- date_in_clr_ticks – recording date in CLR ticks (100 ns)
- date –
datetime
object representing the recording date - file_guid – file GUID
- mea_layout – name of the MEA layout
- mea_sn – serial number of the MEA
- mea_name – name of the MEA
- program_name – name of the recording software that created the file
- program_version – version of the recording software that created the file
-
recordings
¶ Access recordings
-
class
McsPy.McsData.
Recording
(recording_grp)[source]¶ Container class for one recording
Parameters: - comment – recording comment
- duration – duration of the recording in microseconds
- label – recording label
- recording_id – recording ID
- recording_type – recording type
- timestamp – recording timestamp
Provides the content of the HDF5 Folder “Recording_x” in Python.
-
analog_streams
¶ Access all analog streams - collection of
AnalogStream
objects
-
frame_streams
¶ Access all frame streams - collection of
FrameStream
objects
-
event_streams
¶ Access event streams - collection of
EventStream
objects
-
segment_streams
¶ Access segment streams - collection of
SegementStream
objects
-
timestamp_streams
¶ Access timestamp streams - collection of
TimestampStream
objects
-
duration_time
¶ Duration of the recording
Data-Stream-Structures containing the data¶
-
class
McsPy.McsData.
Stream
(stream_grp, info_type_name=None)[source]¶ Base class for all stream types
-
class
McsPy.McsData.
AnalogStream
(stream_grp)[source]¶ Container class for one analog stream of several channels. Description for each channel is provided by a channel-associated object of
ChannelInfo
Parameters: - channel_data – numpy array (channels x samples) with channel data
- timestamp_index – numpy array (segment x 3) defining the timestamps for each data segment as [first_timestamp, first_index, last_index]. Interpretation: All samples in channel_data between first_index and last_index (inclusive) are in a continuous data segment and the timestamp of the samples at first_index is first_timestamp
- channel_infos – dict with channel metadata. Key: ChannelID, Value:
ChannelInfo
object - info_version – version of the Info structure
- data_subtype – type of stream data (“Electrode”, “Auxiliary”, “Digital”, …)
- label – the stream label
- source_stream_guid – the GUID of the source stream
- stream_guid – the stream GUID
- stream_type – the stream type (“Analog”)
Provides the content of the HDF5 Sub-folder “Stream_x” of “AnalogStream” in Python.
-
get_channel
(channel_id)[source]¶ Get the signal of the given channel over the course of time and in its measured range.
Parameters: channel_id – ID of the channel Returns: Tuple (vector of the signal, unit of the values)
-
get_channel_in_range
(channel_id, idx_start=0, idx_end=None)[source]¶ Get the signal of the given channel over the course of time and in its measured range.
Parameters: - channel_id – ID of the channel
- idx_start – index of the first sampled signal value that should be returned (0 <= idx_start < idx_end <= count samples). Default: 0
- idx_end – index of the last sampled signal value that should be returned (0 <= idx_start < idx_end <= count samples). Default: None (= last index)
Returns: Tuple (vector of the signal, unit of the values)
-
get_channel_sample_timestamps
(channel_id, idx_start=0, idx_end=None)[source]¶ Get the timestamps of the sampled values.
Parameters: - channel_id – ID of the channel
- idx_start – index of the first signal timestamp that should be returned (0 <= idx_start < idx_end <= count samples). Default: 0
- idx_end – index of the last signal timestamp that should be returned (0 <= idx_start < idx_end <= count samples). Default: None (= last index)
Returns: Tuple (vector of the timestamps, unit of the timestamps)
-
class
McsPy.McsData.
FrameStream
(stream_grp)[source]¶ Container class for one frame stream with different entities
Parameters: - frame_entity – list of
FrameEntity
objects - info_version – version of the Info structure
- data_subtype – type of stream data
- label – the stream label
- source_stream_guid – the GUID of the source stream
- stream_guid – the stream GUID
- stream_type – the stream type (“Frame”)
Provides the content of the HDF5 Subfolder “Stream_x” of “FrameStream” in Python.
- frame_entity – list of
-
class
McsPy.McsData.
FrameEntity
(frame_entity_group, frame_info)[source]¶ Contains the stream of a specific frame entity. Meta-Information for this entity is available via an associated object of
FrameEntityInfo
Parameters: - data – numpy array (sensors_X x sensors_Y x time) of sensor data in ADC steps. Multiply with info.conversion_factors to get voltages.
- info –
FrameEntityInfo
object with Frame metadata - timestamp_index – start timestamp of the Frame
Provides the content of the HDF5 Subfolder “Stream_x” of “FrameStream” and Subfolder “FrameDataEntity_x” in Python.
-
get_sensor_signal
(sensor_x, sensor_y, idx_start, idx_end)[source]¶ Get the signal of a single sensor over the curse of time and in its measured range.
Parameters: - sensor_x – x coordinate of the sensor
- sensor_y – y coordinate of the sensor
- idx_start – index of the first sampled frame that should be returned (0 <= idx_start < idx_end <= count frames)
- idx_end – index of the last sampled frame that should be returned (0 <= idx_start < idx_end <= count frames)
Returns: Tuple (vector of the signal, unit of the values)
-
get_frame_timestamps
(idx_start, idx_end)[source]¶ Get the timestamps of the sampled frames.
Parameters: - idx_start – index of the first sampled frame that should be returned (0 <= idx_start < idx_end <= count frames)
- idx_end – index of the last sampled frame that should be returned (0 <= idx_start < idx_end <= count frames)
Returns: Tuple (vector of the timestamps, unit of the timestamps)
-
class
McsPy.McsData.
EventStream
(stream_grp)[source]¶ Container class for one event stream with different entities
Parameters: - event_entity – dict of event entities. Key: event ID, value: a
EventEntity
object - info_version – version of the Info structure
- data_subtype – type of stream data (“DigitalInput”, “UserData”, …)
- label – the stream label
- source_stream_guid – the GUID of the source stream
- stream_guid – the stream GUID
- stream_type – the stream type (“Event”)
Provides the content of the HDF5 Subfolder “Stream_x” of “EventStream” in Python.
- event_entity – dict of event entities. Key: event ID, value: a
-
class
McsPy.McsData.
EventEntity
(event_data, event_info)[source]¶ Contains the event data of a specific entity. Meta-Information for this entity is available via an associated object of
EventEntityInfo
Parameters: - data – numpy array (5 x n_events) of event data. row 0: event timestamp in microsecond; row 1: event duration in microseconds; row 2: event type; row 3-4: reserved
- info –
EventEntityInfo
object with the event metadata
Maps data event entity content of the HDF5 Subfolder “Stream_x” of “EventStream” to Python structures.
-
count
¶ Number of contained events
-
get_events
(idx_start=None, idx_end=None)[source]¶ Get all n events of this entity of the given index range (idx_start <= idx < idx_end)
Parameters: - idx_start – start index of the range (including), if nothing is given -> 0
- idx_end – end index of the range (excluding, if nothing is given -> last index
Returns: Tuple of (2 x n matrix of timestamp (1. row) and duration (2. row), Used unit of time)
-
get_event_timestamps
(idx_start=None, idx_end=None)[source]¶ Get all n event timestamps of this entity of the given index range
Parameters: - idx_start – start index of the range, if nothing is given -> 0
- idx_end – end index of the range, if nothing is given -> last index
Returns: Tuple of (n-length array of timestamps, Used unit of time)
-
get_event_durations
(idx_start=None, idx_end=None)[source]¶ Get all n event durations of this entity of the given index range
Parameters: - idx_start – start index of the range, if nothing is given -> 0
- idx_end – end index of the range, if nothing is given -> last index
Returns: Tuple of (n-length array of duration, Used unit of time)
-
class
McsPy.McsData.
SegmentStream
(stream_grp)[source]¶ Container class for one segment stream of different segment entities
Parameters: - segment_entity – dict of segment entities. Key: segment ID, value: for data_subtype == “Cutout”:
SegmentEntity
object, for data_subtype == “Average:AverageSegmentEntity
object - info_version – version of the Info structure
- data_subtype – type of stream data (“Cutout”, “Average”, …)
- label – the stream label
- source_stream_guid – the GUID of the source stream
- stream_guid – the stream GUID
- stream_type – the stream type (“Segment”)
Provides the content of the HDF5 Subfolder “Stream_x” of “SegmentStream” in Python.
- segment_entity – dict of segment entities. Key: segment ID, value: for data_subtype == “Cutout”:
-
class
McsPy.McsData.
SegmentEntity
(segment_data, segment_ts, segment_info)[source]¶ Segment entity class, Meta-Information for this entity is available via an associated object of
SegmentEntityInfo
Parameters: - data – numpy array (n_segments x samples) or (n_segments x n_multi x samples) with segment data
- data_ts – numpy vector (n_segments) with timestamps for every segment
- info –
segment metadata as a
SegmentEntityInfo
objectDataSubType != Average → Maps segement entity content of the HDF5 Subfolder “Stream_x” of “SegmentStream” to Python structures.
-
segment_sample_count
¶ Number of contained samples of segments (2d) or multi-segments (3d)
-
segment_count
¶ Number of segments that are sampled for one time point (2d) -> 1 and (3d) -> n
-
get_segment_in_range
(segment_id, flat=False, idx_start=None, idx_end=None)[source]¶ Get the a/the segment signals in its measured range.
Parameters: - segment_id – id resp. number of the segment (0 if only one segment is present or the index inside the multi-segment collection)
- flat – true -> one-dimensional vector of the sequentially ordered segments, false -> k x n matrix of the n segments of k sample points
- idx_start – index of the first segment that should be returned (0 <= idx_start < idx_end <= count segments)
- idx_end – index of the last segment that should be returned (0 <= idx_start < idx_end <= count segments)
Returns: Tuple (of a flat vector of the sequentially ordered segments or a k x n matrix of the n segments of k sample points depending on the value of flat , and the unit of the values)
-
get_segment_sample_timestamps
(segment_id, flat=False, idx_start=None, idx_end=None)[source]¶ Get the timestamps of the sample points of the measured segment.
Parameters: - segment_id – id resp. number of the segment (0 if only one segment is present or the index inside the multi-segment collection)
- flat – true -> one-dimensional vector of the sequentially ordered segment timestamps, false -> k x n matrix of the k timestamps of n segments
- idx_start – index of the first segment for that timestamps should be returned (0 <= idx_start < idx_end <= count segments)
- idx_end – index of the last segment for that timestamps should be returned (0 <= idx_start < idx_end <= count segments)
Returns: Tuple (of a flat vector of the sequentially ordered segments or a k x n matrix of the n segments of k sample points depending on the value of flat , and the unit of the values)
-
class
McsPy.McsData.
AverageSegmentTuple
(mean, std_dev, time_tick_unit, signal_unit)¶ Named tuple that describe one or more average segments (mean, std_dev, time_tick_unit, signal_unit).
Note
mean
- mean signal valuesstd_dev
- standard deviation of the signal value (it is 0 if there was only one sample segment)time_tick_unit
- sampling interval with time unitsignal_unit
- measured unit of the signal
-
mean
¶ Alias for field number 0
-
signal_unit
¶ Alias for field number 3
-
std_dev
¶ Alias for field number 1
-
time_tick_unit
¶ Alias for field number 2
-
class
McsPy.McsData.
AverageSegmentEntity
(segment_average_data, segment_average_annotation, segment_info)[source]¶ Contains a number of signal segments that are calcualted as averages of number of segments occured in a given time range. Meta-Information for this entity is available via an associated object of
SegmentEntityInfo
Parameters: - data – numpy array (2 x n_samples x n_averages) with averages and standard deviations. First row is the mean per sample data, second row is the standard deviation per sample data.
- data_annotation – numpy array (3 x n_averages) with metadata describing how each average was created. row 0 and 1: start and end timestamp in microseconds of the time window in which signal segments were averaged. row 2: number of averaged signal segments in this time window
- info – metadata for the average as a
SegmentEntityInfo
object
DataSubType == Average → Maps segment entity content of the HDF5 DataSubType-Average: Subfolder “Stream_x” of “SegmentStream” to Python structures.
-
number_of_averages
¶ Number of average segments inside this average entity
-
sample_length
¶ Number of sample points of an average segment
-
time_ranges
()[source]¶ List of time range tuples for all contained average segments
Returns: List of tuple with start and end time point
-
time_range
(average_segment_idx)[source]¶ Get the time range for that the average segment was calculated
Parameters: average_segment_idx – index resp. number of the average segment Returns: Tuple with start and end time point
-
average_counts
()[source]¶ List of counts of samples for all contained average segments
Parameters: average_segment_idx – id resp. number of the average segment Returns: sample count
-
average_count
(average_segment_idx)[source]¶ Count of samples that were used to calculate the average
Parameters: average_segment_idx – id resp. number of the average segment Returns: sample count
-
get_scaled_average_segments
()[source]¶ Get all contained average segments in its measured physical range.
Returns: AverageSegmentTuple
containing the k x n matrices for mean and standard deviation of all contained average segments n with the associated sampling and measuring information
-
get_scaled_average_segment
(average_segment_idx)[source]¶ Get the selected average segment in its measured physical range.
Parameters: segment_idx – index resp. number of the average segment Returns: AverageSegmentTuple
containing the mean and standard deviation vector of the average segment with the associated sampling and measuring information
-
get_average_segments
()[source]¶ Get all contained average segments AD-offset in ADC values with its measuring conditions
Returns: AverageSegmentTuple
containing the mean and standard deviation vector of the average segment in ADC steps with sampling tick and ADC-Step definition
-
get_average_segment
(average_segment_idx)[source]¶ Get the AD-offset corrected average segment in ADC values with its measuring conditions
Parameters: segment_id – id resp. number of the segment Returns: AverageSegmentTuple
containing the k x n matrices for mean and standard deviation of all contained average segments in ADC steps with sampling tick and ADC-Step definition
-
class
McsPy.McsData.
TimeStampStream
(stream_grp)[source]¶ Container class for one timestamp stream with different entities
Parameters: - timestamp_entity – dict of timestamp entities. Key: timestamp ID, value: a
TimeStampEntity
object - info_version – version of the Info structure
- data_subtype – type of stream data
- label – the stream label
- source_stream_guid – the GUID of the source stream
- stream_guid – the stream GUID
- stream_type – the stream type (“Timestamp”)
Provides the content of the HDF5 Subfolder “Stream_x” of “TimeStampStream” in Python.
- timestamp_entity – dict of timestamp entities. Key: timestamp ID, value: a
-
class
McsPy.McsData.
TimeStampEntity
(timestamp_data, timestamp_info)[source]¶ Time-Stamp entity class, Meta-Information for this entity is available via an associated object of
TimestampEntityInfo
Parameters: - data – numpy vector (n_timestamps) with timestamp data
- info – timestamp metadata as a
TimeStampEntityInfo
object
Maps data timestamp entity data of the HDF5 Subfolder “Stream_x” of “TimeStampStream” to Python structures.
-
count
¶ Number of contained timestamps
-
get_timestamps
(idx_start=None, idx_end=None)[source]¶ Get all n time stamps of this entity of the given index range (idx_start <= idx < idx_end)
Parameters: - idx_start – start index of the range (including), if nothing is given -> 0
- idx_end – end index of the range (excluding, if nothing is given -> last index
Returns: Tuple of (n-length array of timestamps, Used unit of time)
Info-Classes containing Meta-Information for the data¶
-
class
McsPy.McsData.
Info
(info_data)[source]¶ Base class of all info classes
Derived classes contain meta information for data structures and fields.
-
group_id
¶ Get the id of the group that the objects belongs to
-
label
¶ Label of this object
-
data_type
¶ Raw data type of this object
-
-
class
McsPy.McsData.
ChannelInfo
(info_version, info)[source]¶ Contains all describing meta data for one sampled channel
Parameters: info – dict containing the channel metadata -
channel_id
¶ Get the ID of the channel
-
row_index
¶ Get the index of the row that contains the associated channel data inside the data matrix
-
adc_step
¶ Size and unit of one ADC step for this channel
-
version
¶ Version number of the Type-Definition
-
-
class
McsPy.McsData.
InfoSampledData
(info)[source]¶ Base class of all info classes for evenly sampled data
-
sampling_frequency
¶ Get the used sampling frequency in Hz
-
sampling_tick
¶ Get the used sampling tick
-
-
class
McsPy.McsData.
EventEntityInfo
(info_version, info)[source]¶ Contains all meta data for one event entity
Parameters: info – dict containing the event metadata -
id
¶ Event ID
-
raw_data_bytes
¶ Length of raw data in bytes
-
source_channel_ids
¶ IDs of all channels that were involved in the event generation.
-
source_channel_labels
¶ Labels of the channels that were involved in the event generation.
-
version
¶ Version number of the type definition
-
-
class
McsPy.McsData.
SegmentEntityInfo
(info_version, info, source_channel_infos)[source]¶ Contains all meta data for one segment entity
Parameters: - info – dict containing the segment metadata
- source_channel_of_segment – dict containing the channel metadata for each source channel of the segment. Key: source channel index, value:
ChannelInfo
object
-
id
¶ Segment ID
-
pre_interval
¶ Interval [start of the segment <- defining event timestamp]
-
post_interval
¶ Interval [defining event timestamp -> end of the segment]
-
type
¶ Type of the segment like ‘Average’ or ‘Cutout’
-
count
¶ Count of segments inside the segment entity
-
version
¶ Version number of the Type-Definition
-
class
McsPy.McsData.
TimeStampEntityInfo
(info_version, info)[source]¶ Contains all meta data for one timestamp entity
Parameters: info – dict containing the timestamp metadata -
id
¶ Timestamp entity ID
-
unit
¶ Unit in which the timestamps are measured
-
exponent
¶ Exponent for the unit in which the timestamps are measured
-
measuring_unit
¶ Unit in which the timestamp entity was measured
-
data_type
¶ DataType for the timestamps
-
source_channel_ids
¶ ID’s of all channels that were involved in the timestamp generation.
-
source_channel_labels
¶ Labels of the channels that were involved in the timestamp generation.
-
version
¶ Version number of the Type-Definition
-
The ‘’McsCMOSMEA’’ module¶
-
class
McsPy.McsCMOSMEA.
McsCMOSMEAData
(cmos_data_path)[source]¶ This class holds the information of a complete MCS CMOS-MEA data file system
-
class
McsPy.McsCMOSMEA.
McsGroup
(h5py_group_object)[source]¶ this class subclasses the h5py.Group object and extends it with McsPy toolbox functionality
-
class
IDSetGroup
(h5py, mcs_instanceid, mcspy, mcs_typeid)¶ -
h5py
¶ Alias for field number 0
-
mcs_instanceid
¶ Alias for field number 1
-
mcs_typeid
¶ Alias for field number 3
-
mcspy
¶ Alias for field number 2
-
-
class
IDSetDataset
(h5py, mcs_instanceid, mcspy, mcs_typeid)¶ -
h5py
¶ Alias for field number 0
-
mcs_instanceid
¶ Alias for field number 1
-
mcs_typeid
¶ Alias for field number 3
-
mcspy
¶ Alias for field number 2
-
-
ischild
(id)[source]¶ Takes an identifier and checks if it is a valid identifier for a child of this group:
Parameters: id – mcs instanceid, h5py name , mcspy name as instance of ‘str’ Returns: False if id is not valid, set of identifiers of the child
-
tree
(name='mcspy', mcs_type=False, max_level=None)[source]¶ builds the hdf5 hierarchy beginning with the current group then traversing all subentities depth first as a string
Parameters: - name – cfg variable for the type of name that is to be printed for each entity in the h5py group, default: ‘h5py’, options: ‘mcspy’
- mcs_type – cfg variable to show mcs type in the tree, default: False
- max_level – cfg variable to limit the number of tree levels shown, default: None (show all)
-
class
-
class
McsPy.McsCMOSMEA.
McsDataset
(h5py_dataset_object)[source]¶ This class subclasses the h5py.Dataset object and extends it with McsPy toolbox functionality
Raw Data (.cmcr) files¶
-
class
McsPy.McsCMOSMEA.
Acquisition
(acquisition_group)[source]¶ Container class for acquisition data.
Acquisition Group can hold different types of streams: Analog Streams, Event Streams, Timestamp Streams, Segment Streams, Spike Streams
-
class
McsPy.McsCMOSMEA.
McsStream
(stream_grp, data_typeid, meta_typeid, *args)[source]¶ Base class for all stream types
-
Data
¶ Access all datasets - collection of McsDataset objects
-
Meta
¶ Access meta data
-
-
class
McsPy.McsCMOSMEA.
McsChannelStream
(channel_stream_grp)[source]¶ Container class for one analog stream of several channels.
-
DataChunk
¶ The continuous data segments in the stream
-
-
class
McsPy.McsCMOSMEA.
McsChannelEntity
(channel_stream_entity_dataset, mcspy_parent)[source]¶ Container class for one ChannelStream Entity.
-
Meta
¶ reads the subset of Meta data that belongs to the channels
-
-
class
McsPy.McsCMOSMEA.
McsEventStream
(event_stream_grp)[source]¶ Container class for one Event Stream.
-
EventData
¶ All events of all event entities in the stream
-
EventMeta
¶ The meta data for all event entities
-
EventEntity
¶ All event entities in the stream
-
-
class
McsPy.McsCMOSMEA.
McsEventEntity
(parent, event_id)[source]¶ Container class for Event Entity object
-
events
¶ The ids, timestamps and durations of the occurences of the event entity
-
meta
¶ The meta data for an event entity
-
-
class
McsPy.McsCMOSMEA.
McsSensorStream
(sensor_stream_grp)[source]¶ Container class for one Event Stream.
-
DataChunk
¶ The groups of data that have been acquired. Intended for acquisition of multiple time windows
-
Regions
¶ The regions of interest (ROI) on the sensor for which data has been acquired, usually from a rectangular subset of the sensors
-
SensorData
¶ The sensor data as a numpy array of shape (frames x sensors_Y x sensors_X)
-
SensorMeta
¶ The meta data for the acquired sensor data
-
-
class
McsPy.McsCMOSMEA.
McsSensorEntity
(sensor_stream_entity_dataset, mcspy_parent)[source]¶ Container class for one McsSensorEntity - a sensor stream entity.
-
class
McsPy.McsCMOSMEA.
McsSpikeStream
(spike_stream_grp, spike_data_typeid='3e8aaacc-268b-4057-b0bb-45d7dc9ec73b')[source]¶ Container class for one Spike Stream.
-
get_spikes_at_sensor
(sensor_id)[source]¶ retrieves all spikes that occured at the sensor with id sensor_id
Parameters: sensor_id – valid identifier for a sensor on the MCS CMOS chip as int: 1 <= sensor_id <= 65*65 Returns: numpy structured array of all spikes that have been detected on the sensor with id sensor_id
-
get_spikes_in_interval
(interval)[source]¶ Retrieves all spikes that occured in a given time interval. Intervals exceeding the time range of the dataset will throw a warning, and retrieval of maximally sized subset of the interval is attempted.
Parameters: interval – - interval in s as instance of
- list(start,stop) of length 2
- tuple(start,stop) of length 2
start must be a number, stop must be a number or the keyword ‘end’, start and stop must satisfy start < stop
Result: numpy structured array which includes all spikes occuring in the given interval
-
get_spike_timestamps_at_sensors
(sensor_ids)[source]¶ Retrieves all spike timestamps for all given sensors as a dictionary
Parameters: sensor_ids – valid identifiers for sensors on the MCS CMOS chip as int: 1 <= sensor_id <= 65*65 Returns: dictionary of all spike timestamps that have been detected on the given sensors. Key: sensor_id, value: spike timestamps
-
get_spike_cutouts_at_sensor
(sensor_id)[source]¶ Retrieves the spike cutouts for all spikes for the given sensor_id
Parameters: sensor_id – valid identifier for a sensor on the MCS CMOS chip as int: 1 <= sensor_id <= 65*65 Returns: Numpy array spikes x samples of the spike cutouts
-
SpikeData
¶ The detected spikes, each with a sensor ID, a timestamp and (optionally) with a cutout
-
SpikeMeta
¶ The meta data for spike detection, e.g. pre- and post interval
-
-
class
McsPy.McsCMOSMEA.
McsSpikeEntity
(spike_stream_entity_dataset, mcspy_parent)[source]¶ Container class for one SpikeStream Entity.
-
class
McsPy.McsCMOSMEA.
McsSegmentStream
(segment_stream_grp)[source]¶ Container class for one segment stream of different segment entities
Processed Data (.cmtr) files¶
-
class
McsPy.McsCMOSMEA.
NetworkExplorer
(network_explorer_group)[source]¶ Container class for a NetworkExplorer object
-
get_sta_entity_by_sourceID
(key)[source]¶ Retrieve the STA Entity for the given source ID.
Parameters: key – A valid source ID. See the sourceIDs attribute for a list of valid source IDs Returns: The STA Entity for the given source ID
-
get_sta_entity_by_sensorID
(key)[source]¶ Retrieve the STA Entity for the given sensor ID.
Parameters: key – A valid sensor ID. See the sensorIDs attribute for a list of valid sensor IDs Returns: The STA Entity for the given sensor ID
-
get_sta_entity
(key)[source]¶ Retrieve the STA Entity for the given key.
Parameters: key – A valid key, either a sensor or a source ID, depending on the sta_key_type attribute Returns: The STA Entity for the given key
-
get_axon_for_entity_by_sourceID
(key, axon=1, segment=1)[source]¶ Retrieve the path of the axon for a given sensor or source ID.
Parameters: - key – A valid key, either a sensor or a source ID, depending on the sta_key_type attribute
- axon – A valid axon ID, in case multiple axons have been found for a unit. Default: 1
- segment – A valid axon ID, in case multiple segments have been found for an axon. Default: 1
Returns: The axon path as a list of (X,Y) tuples in sensor coordinates. Returns None if no axon is found
-
sta_key_type
¶ The type of key used in the access functions. Either ‘sourceID’ or ‘sensorID’
-
sourceIDs
¶ A list of valid source IDs
-
sensorIDs
¶ A list of valid sensor IDs
-
-
class
McsPy.McsCMOSMEA.
STAEntity
(sta_explorer, sta_entity, spikes_entity=None, stastddev_entity=None, axon=None)[source]¶ Container Class for a STAEntity object
-
data
¶ The STA data as a numpy array of shape (frames x sensors_Y x sensor_X)
-
spikes
¶ Detected spikes in the STA
-
sta_stddev
¶ Returns the standard deviation for each channel in the STA. Used for spike detection on the STA
-
sensor_coordinates
¶ Returns the STA source coordinates on the chip as [X,Y]. Note: X and Y are 1-based
-
axon
¶ Returns the axon path as a list of (X,Y) tuples in sensor coordinates. None if no axon has been found
-
-
class
McsPy.McsCMOSMEA.
SpikeExplorer
(spike_explorer_group)[source]¶ Container Class for an SpikeExplorer object
-
class
McsPy.McsCMOSMEA.
SpikeSorter
(spike_sorter_group)[source]¶ Container for SpikeSorter object
-
get_unit
(unit_id)[source]¶ Retrieves a single unit by its UnitID
Parameters: unit_id – A valid unit ID.
-
get_units_by_measure
(measure, descending=True)[source]¶ Returns a list of units ordered by the given quality measure.
Parameters: - measure – The name of a quality measure. See get_unit_measures() for a list of valid quality measure names.
- descending – The ordering of the list. Default: True (=descending order)
-
-
class
McsPy.McsCMOSMEA.
SpikeSorterUnitEntity
(unit_group)[source]¶ Container for Spike Sorter Units
-
get_peaks_timestamps
()[source]¶ Retrieves the timestamps for all peaks in the source signal where the ‘IncludePeak’ flag is set.
-
get_peaks_amplitudes
()[source]¶ Retrieves the peak amplitudes for all peaks in the source signal where the ‘IncludePeak’ flag is set.
-