Ejemplo n.º 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 = []
Ejemplo n.º 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
Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 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
Ejemplo n.º 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
Ejemplo n.º 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
Ejemplo n.º 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
Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 14
0
Archivo: event.py Proyecto: 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
Ejemplo n.º 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)
Ejemplo n.º 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
Ejemplo n.º 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
Ejemplo n.º 19
0
Archivo: unit.py Proyecto: 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
Ejemplo n.º 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
Ejemplo n.º 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 = []
Ejemplo n.º 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)
Ejemplo n.º 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
Ejemplo n.º 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
Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 29
0
Archivo: spike.py Proyecto: 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
Ejemplo n.º 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)
Ejemplo n.º 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
Ejemplo n.º 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
Ejemplo n.º 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 = [ ]
Ejemplo n.º 35
0
Archivo: segment.py Proyecto: 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
Ejemplo n.º 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
Ejemplo n.º 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
Ejemplo n.º 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 = []
Ejemplo n.º 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)