Пример #1
0
    def __init__(self,
                 index=0,
                 coordinate=None,
                 name=None,
                 description=None,
                 file_origin=None,
                 **annotations):
        '''
        Initialize a new :class:`RecordingChannel` instance.
        '''
        # 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 = []
Пример #2
0
    def __init__(self,
                 time=0 * pq.s,
                 waveform=None,
                 sampling_rate=None,
                 left_sweep=None,
                 name=None,
                 description=None,
                 file_origin=None,
                 **annotations):
        '''
        Initialize a new :class:`Spike` instance.
        '''
        BaseNeo.__init__(self,
                         name=name,
                         file_origin=file_origin,
                         description=description,
                         **annotations)

        self.time = time

        self.waveform = waveform
        self.left_sweep = left_sweep
        self.sampling_rate = sampling_rate

        self.segment = None
        self.unit = None
Пример #3
0
 def __init__(self, times=None, durations=None, labels=None, units=None,
              name=None, description=None, file_origin=None, **annotations):
     '''
     Initialize a new :class:`Epoch` instance.
     '''
     BaseNeo.__init__(self, name=name, file_origin=file_origin,
                      description=description, **annotations)
Пример #4
0
    def __init__(self, array_annotations=None, **annotations):
        # this for py27 str vs py3 str in neo attributes ompatibility
        annotations = check_annotations(annotations)
        if 'file_origin' not in annotations:
            # the str is to make compatible with neo_py27 where attribute
            # used to be str so raw bytes
            annotations['file_origin'] = str(self._rawio.source_name())

        if array_annotations is None:
            array_annotations = {}
        for k, v in array_annotations.items():
            array_annotations[k] = np.asarray(v)

        # clean array annotations that are not 1D
        # TODO remove this once multi-dimensional array_annotations are possible
        array_annotations = {
            k: v
            for k, v in array_annotations.items() if v.ndim == 1
        }

        # this mock the array annotations to avoid inherits DataObject
        self.array_annotations = ArrayDict(self.shape[-1])
        self.array_annotations.update(array_annotations)

        BaseNeo.__init__(self, **annotations)
Пример #5
0
    def __init__(self,
                 times=None,
                 durations=None,
                 labels=None,
                 name=None,
                 description=None,
                 file_origin=None,
                 **annotations):
        '''
        Initialize a new :class:`EpochArray` instance.
        '''
        BaseNeo.__init__(self,
                         name=name,
                         file_origin=file_origin,
                         description=description,
                         **annotations)

        if times is None:
            times = np.array([]) * pq.s
        if durations is None:
            durations = np.array([]) * pq.s
        if labels is None:
            labels = np.array([], dtype='S')

        self.times = times
        self.durations = durations
        self.labels = labels

        self.segment = None
Пример #6
0
    def __init__(self,
                 channel_names=None,
                 channel_indexes=None,
                 name=None,
                 description=None,
                 file_origin=None,
                 **annotations):
        """Initialize a new RecordingChannelGroup."""
        # Inherited initialization
        # Sets universally recommended attributes, and places all others
        # in annotations
        BaseNeo.__init__(self,
                         name=name,
                         file_origin=file_origin,
                         description=description,
                         **annotations)

        # Defaults
        if channel_indexes is None:
            channel_indexes = np.array([])
        if channel_names is None:
            channel_names = np.array([])

        # Store recommended attributes
        self.channel_names = channel_names
        self.channel_indexes = channel_indexes

        # Initialize containers for child objects
        self.analogsignalarrays = []
        self.units = []
        # Many to many relationship
        self.recordingchannels = []

        self.block = None
Пример #7
0
    def __init__(self,
                 name=None,
                 description=None,
                 file_origin=None,
                 file_datetime=None,
                 rec_datetime=None,
                 index=None,
                 **annotations):
        BaseNeo.__init__(self,
                         name=name,
                         file_origin=file_origin,
                         description=description,
                         **annotations)
        self.file_datetime = file_datetime
        self.rec_datetime = rec_datetime
        self.index = index

        self.epochs = []
        self.epocharrays = []
        self.events = []
        self.eventarrays = []
        self.analogsignals = []
        self.analogsignalarrays = []
        self.irregularlysampledsignals = []
        self.spikes = []
        self.spiketrains = []

        self.block = None
Пример #8
0
    def __init__(self, channel_names=None, channel_indexes=None, name=None,
                 description=None, file_origin=None, **annotations):
        """Initialize a new RecordingChannelGroup."""
        # Inherited initialization
        # Sets universally recommended attributes, and places all others
        # in annotations
        BaseNeo.__init__(self, name=name, file_origin=file_origin,
                         description=description, **annotations)

        # Defaults
        if channel_indexes is None:
            channel_indexes = np.array([])
        if channel_names is None:
            channel_names = np.array([])

        # Store recommended attributes
        self.channel_names = channel_names
        self.channel_indexes = channel_indexes

        # Initialize containers for child objects
        self.analogsignalarrays = []
        self.units = []
        # Many to many relationship
        self.recordingchannels = []

        self.block = None
Пример #9
0
    def __init__(self,
                 times,
                 t_stop,
                 units=None,
                 dtype=np.float,
                 copy=True,
                 sampling_rate=1.0 * pq.Hz,
                 t_start=0.0 * pq.s,
                 waveforms=None,
                 left_sweep=None,
                 name=None,
                 file_origin=None,
                 description=None,
                 **annotations):
        '''
        Initializes a newly constructed :class:`SpikeTrain` instance.
        '''
        # This method is only called when constructing a new SpikeTrain,
        # not when slicing or viewing. We use the same call signature
        # as __new__ for documentation purposes. Anything not in the call
        # signature is stored in annotations.

        # Calls parent __init__, which grabs universally recommended
        # attributes and sets up self.annotations
        BaseNeo.__init__(self,
                         name=name,
                         file_origin=file_origin,
                         description=description,
                         **annotations)
Пример #10
0
    def __init__(self,
                 signal,
                 units=None,
                 dtype=None,
                 copy=True,
                 t_start=0 * pq.s,
                 sampling_rate=None,
                 sampling_period=None,
                 name=None,
                 file_origin=None,
                 description=None,
                 **annotations):
        '''
        Initializes a newly constructed :class:`AnalogSignal` instance.
        '''
        # This method is only called when constructing a new AnalogSignal,
        # not when slicing or viewing. We use the same call signature
        # as __new__ for documentation purposes. Anything not in the call
        # signature is stored in annotations.

        # Calls parent __init__, which grabs universally recommended
        # attributes and sets up self.annotations
        BaseNeo.__init__(self,
                         name=name,
                         file_origin=file_origin,
                         description=description,
                         **annotations)
Пример #11
0
 def __init__(self, times=None, durations=None, labels=None, units=None,
              name=None, description=None, file_origin=None, **annotations):
     '''
     Initialize a new :class:`Epoch` instance.
     '''
     BaseNeo.__init__(self, name=name, file_origin=file_origin,
                      description=description, **annotations)
 def __init__(self, times, signal, units=None, time_units=None, dtype=None,
              copy=True, name=None, file_origin=None, description=None,
              **annotations):
     '''
     Initializes a newly constructed :class:`IrregularlySampledSignal`
     instance.
     '''
     BaseNeo.__init__(self, name=name, file_origin=file_origin,
                      description=description, **annotations)
Пример #13
0
 def __init__(self, signal, units=None, dtype=None, copy=True,
              t_start=0 * pq.s, sampling_rate=None, sampling_period=None,
              name=None, file_origin=None, description=None,
              channel_index=None, **annotations):
     '''
     Initializes a newly constructed :class:`AnalogSignalArray` instance.
     '''
     BaseNeo.__init__(self, name=name, file_origin=file_origin,
                      description=description, **annotations)
Пример #14
0
Файл: event.py Проект: tkf/neo
 def __init__(self, time, label, name=None, description=None,
              file_origin=None, **annotations):
     """Initialize a new Event."""
     BaseNeo.__init__(self, name=name, file_origin=file_origin,
                      description=description, **annotations)
     self.time = time
     self.label = label
     
     self.segment =None
Пример #15
0
 def __init__(self, signal, units=None, dtype=None, copy=True,
              t_start=0 * pq.s, sampling_rate=None, sampling_period=None,
              name=None, file_origin=None, description=None,
              channel_index=None, **annotations):
     '''
     Initializes a newly constructed :class:`AnalogSignalArray` instance.
     '''
     BaseNeo.__init__(self, name=name, file_origin=file_origin,
                      description=description, **annotations)
 def __init__(self, times, signal, units=None, time_units=None, dtype=None,
              copy=True, name=None, description=None, file_origin=None,
              **annotations):
     '''
     Initializes a newly constructed :class:`IrregularlySampledSignal`
     instance.
     '''
     BaseNeo.__init__(self, name=name, file_origin=file_origin,
                      description=description, **annotations)
Пример #17
0
    def __init__(self, times=np.array([]) * pq.s,
                 labels=np.array([], dtype='S'), name=None, description=None,
                 file_origin=None, **annotations):
        """Initialize a new EventArray."""
        BaseNeo.__init__(self, name=name, file_origin=file_origin,
                         description=description, **annotations)
        self.times = times
        self.labels = labels

        self.segment = None
Пример #18
0
    def __init__(self, time, label, name=None, description=None,
                 file_origin=None, **annotations):
        '''
        Initialize a new :class:`Event` instance.
        '''
        BaseNeo.__init__(self, name=name, file_origin=file_origin,
                         description=description, **annotations)
        self.time = time
        self.label = label

        self.segment = None
Пример #19
0
Файл: unit.py Проект: tkf/neo
 def __init__(self, name=None, description=None, file_origin=None, 
                             channel_indexes = None, **annotations):
     """Initialize a new neuronal Unit (spike source)"""
     BaseNeo.__init__(self, name=name, file_origin=file_origin,
                      description=description, **annotations)
     
     self.channel_indexes = channel_indexes
     
     self.spiketrains = [ ]
     self.spikes = [ ]
     
     self.recordingchannelgroup = None
Пример #20
0
 def __init__(self, times, values,
               name=None, description=None,
              file_origin=None, **annotations):
     """Initalize a new IrregularlySampledSignal."""
     BaseNeo.__init__(self, name=name, file_origin=file_origin,
                      description=description, **annotations)
     
     self.times = times
     self.values = values
     
     self.segment = None
     self.recordingchannel = None
Пример #21
0
    def __init__(self, name=None, description=None, file_origin=None,
                 file_datetime=None, rec_datetime=None, index=None,
                 **annotations):
        """Initalize a new Block."""
        BaseNeo.__init__(self, name=name, file_origin=file_origin,
                         description=description, **annotations)

        self.file_datetime = file_datetime
        self.rec_datetime = rec_datetime
        self.index = index

        self.segments = []
        self.recordingchannelgroups = []
Пример #22
0
    def __init__(self, array_annotations=None, **annotations):
        # this for py27 str vs py3 str in neo attributes ompatibility
        annotations = check_annotations(annotations)
        if 'file_origin' not in annotations:
            # the str is to make compatible with neo_py27 where attribute
            # used to be str so raw bytes
            annotations['file_origin'] = str(self._rawio.source_name())

        # this mock the array annotaions to avoid inherits DataObject
        self.array_annotations = ArrayDict(self.shape[-1])
        if array_annotations is not None:
            self.array_annotations.update(array_annotations)

        BaseNeo.__init__(self, **annotations)
Пример #23
0
    def __init__(self, times=None, labels=None, name=None, description=None, file_origin=None, **annotations):
        """
        Initialize a new :class:`EventArray` instance.
        """
        BaseNeo.__init__(self, name=name, file_origin=file_origin, description=description, **annotations)
        if times is None:
            times = np.array([]) * pq.s
        if labels is None:
            labels = np.array([], dtype="S")

        self.times = times
        self.labels = labels

        self.segment = None
Пример #24
0
    def __init__(self, name=None, description=None, file_origin=None,
                 channel_indexes=None, **annotations):
        '''
        Initialize a new :clas:`Unit` instance (spike source)
        '''
        BaseNeo.__init__(self, name=name, file_origin=file_origin,
                         description=description, **annotations)

        self.channel_indexes = channel_indexes

        self.spiketrains = []
        self.spikes = []

        self.recordingchannelgroup = None
Пример #25
0
    def __init__(self, array_annotations=None, **annotations):
        # this for py27 str vs py3 str in neo attributes ompatibility
        annotations = check_annotations(annotations)
        if 'file_origin' not in annotations:
            # the str is to make compatible with neo_py27 where attribute
            # used to be str so raw bytes
            annotations['file_origin'] = str(self._rawio.source_name())

        # this mock the array annotaions to avoid inherits DataObject
        self.array_annotations = ArrayDict(self.shape[-1])
        if array_annotations is not None:
            self.array_annotations.update(array_annotations)

        BaseNeo.__init__(self, **annotations)
Пример #26
0
    def __init__(self, times, t_stop, units=None,  dtype=np.float,
                 copy=True, sampling_rate=1.0 * pq.Hz, t_start=0.0 * pq.s,
                 waveforms=None, left_sweep=None, name=None, file_origin=None,
                 description=None, **annotations):
        """Initializes newly constructed SpikeTrain."""
        # This method is only called when constructing a new SpikeTrain,
        # not when slicing or viewing. We use the same call signature
        # as __new__ for documentation purposes. Anything not in the call
        # signature is stored in annotations.

        # Calls parent __init__, which grabs universally recommended
        # attributes and sets up self.annotations
        BaseNeo.__init__(self, name=name, file_origin=file_origin,
                         description=description, **annotations)
Пример #27
0
    def __init__(self, name=None, description=None, file_origin=None, array_annotations=None,
                 **annotations):
        """
        This method is called by each data object and initializes the newly created object by
        adding array annotations and calling __init__ of the super class, where more annotations
        and attributes are processed.
        """

        if not hasattr(self, 'array_annotations') or not self.array_annotations:
            self.array_annotations = ArrayDict(self._get_arr_ann_length())
        if array_annotations is not None:
            self.array_annotate(**array_annotations)

        BaseNeo.__init__(self, name=name, description=description, file_origin=file_origin,
                         **annotations)
Пример #28
0
    def __init__(self, name=None, description=None, file_origin=None, array_annotations=None,
                 **annotations):
        """
        This method is called by each data object and initializes the newly created object by
        adding array annotations and calling __init__ of the super class, where more annotations
        and attributes are processed.
        """

        if not hasattr(self, 'array_annotations') or not self.array_annotations:
            self.array_annotations = ArrayDict(self._get_arr_ann_length())
        if array_annotations is not None:
            self.array_annotate(**array_annotations)

        BaseNeo.__init__(self, name=name, description=description, file_origin=file_origin,
                         **annotations)
Пример #29
0
Файл: spike.py Проект: tkf/neo
 def __init__(self, time=0*pq.s, waveform=None, sampling_rate=None,
              left_sweep=None, name=None, description=None,
              file_origin=None, **annotations):
     """Initialize a new Spike."""
     BaseNeo.__init__(self, name=name, file_origin=file_origin,
                      description=description, **annotations)
     
     self.time = time
     
     self.waveform = waveform
     self.left_sweep = left_sweep
     self.sampling_rate = sampling_rate
     
     self.segment = None
     self.unit = None
Пример #30
0
    def __init__(self, signal, units=None, dtype=None, copy=True,
                 t_start=0 * pq.s, sampling_rate=None, sampling_period=None,
                 name=None, file_origin=None, description=None,
                 channel_index=None, **annotations):
        '''
        Initializes a newly constructed :class:`BaseAnalogSignal` instance.
        '''
        # This method is only called when constructing a new BaseAnalogSignal,
        # not when slicing or viewing. We use the same call signature
        # as __new__ for documentation purposes. Anything not in the call
        # signature is stored in annotations.

        # Calls parent __init__, which grabs universally recommended
        # attributes and sets up self.annotations
        BaseNeo.__init__(self, name=name, file_origin=file_origin,
                         description=description, **annotations)
 def __init__(self,
              times,
              signal,
              units=None,
              time_units=None,
              dtype=None,
              copy=True,
              name=None,
              description=None,
              file_origin=None,
              **annotations):
     """Initalize a new IrregularlySampledSignal."""
     BaseNeo.__init__(self,
                      name=name,
                      file_origin=file_origin,
                      description=description,
                      **annotations)
Пример #32
0
    def __init__(self,
                 times=np.array([]) * pq.s,
                 labels=np.array([], dtype='S'),
                 name=None,
                 description=None,
                 file_origin=None,
                 **annotations):
        """Initialize a new EventArray."""
        BaseNeo.__init__(self,
                         name=name,
                         file_origin=file_origin,
                         description=description,
                         **annotations)
        self.times = times
        self.labels = labels

        self.segment = None
Пример #33
0
    def __init__(self,
                 time,
                 label,
                 name=None,
                 description=None,
                 file_origin=None,
                 **annotations):
        """Initialize a new Event."""
        BaseNeo.__init__(self,
                         name=name,
                         file_origin=file_origin,
                         description=description,
                         **annotations)
        self.time = time
        self.label = label

        self.segment = None
Пример #34
0
 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 = [ ]
Пример #35
0
Файл: segment.py Проект: tkf/neo
 def __init__(self, name=None, description=None, file_origin=None,
              file_datetime=None, rec_datetime=None, index=None, **annotations):
     BaseNeo.__init__(self, name=name, file_origin=file_origin,
                      description=description, **annotations)
     self.file_datetime = file_datetime
     self.rec_datetime = rec_datetime
     self.index = index        
     
     self.epochs = [ ]
     self.epocharrays = [ ]
     self.events = [ ]
     self.eventarrays = [ ]
     self.analogsignals = [ ]
     self.analogsignalarrays = [ ]
     self.irregularlysampledsignals = [ ]
     self.spikes = [ ]
     self.spiketrains = [ ]
     
     self.block = None
Пример #36
0
    def __init__(self,
                 name=None,
                 description=None,
                 file_origin=None,
                 channel_indexes=None,
                 **annotations):
        """Initialize a new neuronal Unit (spike source)"""
        BaseNeo.__init__(self,
                         name=name,
                         file_origin=file_origin,
                         description=description,
                         **annotations)

        self.channel_indexes = channel_indexes

        self.spiketrains = []
        self.spikes = []

        self.recordingchannelgroup = None
Пример #37
0
    def __init__(self, times=None, durations=None, labels=None,
                 name=None, description=None, file_origin=None, **annotations):
        '''
        Initialize a new :class:`EpochArray` instance.
        '''
        BaseNeo.__init__(self, name=name, file_origin=file_origin,
                         description=description, **annotations)

        if times is None:
            times = np.array([]) * pq.s
        if durations is None:
            durations = np.array([]) * pq.s
        if labels is None:
            labels = np.array([], dtype='S')

        self.times = times
        self.durations = durations
        self.labels = labels

        self.segment = None
Пример #38
0
    def __init__(self,
                 name=None,
                 description=None,
                 file_origin=None,
                 file_datetime=None,
                 rec_datetime=None,
                 index=None,
                 **annotations):
        """Initalize a new Block."""
        BaseNeo.__init__(self,
                         name=name,
                         file_origin=file_origin,
                         description=description,
                         **annotations)

        self.file_datetime = file_datetime
        self.rec_datetime = rec_datetime
        self.index = index

        self.segments = []
        self.recordingchannelgroups = []
Пример #39
0
    def __init__(self,
                 name=None,
                 description=None,
                 file_origin=None,
                 channel_indexes=None,
                 **annotations):
        '''
        Initialize a new :clas:`Unit` instance (spike source)
        '''
        BaseNeo.__init__(self,
                         name=name,
                         file_origin=file_origin,
                         description=description,
                         **annotations)

        self.channel_indexes = channel_indexes

        self.spiketrains = []
        self.spikes = []

        self.recordingchannelgroup = None
 def __init__(self, times, signal, units=None, time_units=None, dtype=None,
              copy=True, name=None, description=None, file_origin=None,
              **annotations):
     """Initalize a new IrregularlySampledSignal."""
     BaseNeo.__init__(self, name=name, file_origin=file_origin,
                      description=description, **annotations)