/usr/share/pyshared/neo/core/recordingchannel.py is in python-neo 0.2.0-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 | from neo.core.baseneo import BaseNeo
class RecordingChannel(BaseNeo):
"""
A RecordingChannel is a container for :py:class:`AnalogSignal` objects
that come from the same logical and/or physical channel inside a :py:class:`Block`.
Note that a RecordingChannel can belong to several :py:class:`RecordingChannelGroup`.
*Usage* one Block with 3 Segment and 16 RecordingChannel and 48 AnalogSignal::
bl = Block()
# Create a new RecordingChannelGroup and add to current block
rcg = RecordingChannelGroup(name = 'all channels)
bl.recordingchannelgroups.append(rcg)
for c in range(16):
rc = RecordingChannel(index=c)
rcg.recordingchannels.append(rc) # <- many to many relationship
rc.recordingchannelgroups.append(rcg) # <- many to many relationship
for s in range(3):
seg = Segment(name = 'segment %d' %s, index = s)
bl.segments.append(seg)
for c in range(16):
for s in range(3):
anasig = AnalogSignal( np.rand(100000), sampling_rate = 20*pq.Hz)
bl.segments[s].analogsignals.append(anasig)
rcg.recordingchannels[c].analogsignals.append(anasig)
*Required attributes/properties*:
:index: (int) Index of the channel
*Recommended attributes/properties*:
:coordinate: (Quantity) x, y, z
:name: string
:description: string
:file_origin: string
*Container of*:
:py:class:`AnalogSignal`
:py:class:`IrregularlySampledSignal`
"""
def __init__(self, index=0, coordinate=None, name=None, description=None,
file_origin=None, **annotations):
"""Initialize a new RecordingChannel."""
# Inherited initialization
# Sets universally recommended attributes, and places all others
# in annotations
BaseNeo.__init__(self, name=name, file_origin=file_origin,
description=description, **annotations)
# Store required and recommended attributes
self.index = index
self.coordinate = coordinate
# Initialize contianers
self.analogsignals = [ ]
self.irregularlysampledsignals = [ ]
# Many to many relationship
self.recordingchannelgroups = [ ]
|