Beispiel #1
0
    def record(self,
               cell,
               location_func=None,
               what=None,
               user_tags=None,
               user_tag_functors=None,
               **kwargs):

        # Indexable by index of cell reference
        if isinstance(cell, int):
            cell = self[cell]
        assert cell in self._nrns

        what = what or Cell.Recordables.MembraneVoltage
        user_tags = user_tags or []
        user_tag_functors = user_tag_functors \
            or StdTagFunctors.get_record_functors_neuron()
        location_func = location_func or (lambda cell: cell.soma)
        cell_location = location_func(cell)

        kw_utf = {
            'cell_location': cell_location,
            'neuron_population': self,
            'neuron': cell
        }

        functor_tags = list(
            itertools.chain(*[utf(**kw_utf) for utf in user_tag_functors]))
        r = self.sim.record(cell,
                            cell_location=location_func(cell),
                            what=what,
                            user_tags=user_tags + functor_tags,
                            **kwargs)
        return r
Beispiel #2
0
    def record(
        self,
        cell,
        location_func=None,
        what=None,
        user_tags=None,
        user_tag_functors=None,
        **kwargs
        ):

        # Indexable by index of cell reference
        if isinstance(cell, int):
            cell = self[cell]
        assert cell in self._nrns

        what = what or Cell.Recordables.MembraneVoltage
        user_tags = user_tags or []
        user_tag_functors = user_tag_functors \
            or StdTagFunctors.get_record_functors_neuron()
        location_func = location_func or (lambda cell: cell.soma)
        cell_location = location_func(cell)

        kw_utf = {'cell_location': cell_location,
                  'neuron_population': self, 'neuron': cell}

        functor_tags = list(itertools.chain(*[utf(**kw_utf) for utf in
                            user_tag_functors]))
        r = self.sim.record(cell, cell_location=location_func(cell),
                            what=what, user_tags=user_tags
                            + functor_tags, **kwargs)
        return r
Beispiel #3
0
    def record(self, synapse, what, user_tags=None, user_tag_functors=None, **kwargs):
        if isinstance(synapse, int):
            synapse = self[synapse]
        assert synapse in self.synapses

        user_tags = user_tags or []
        user_tag_functors = user_tag_functors or StdTagFunctors.get_record_functors_synapse()

        kw_utf = {"synapse": synapse, "synapse_population": self}
        functor_tags = list(itertools.chain(*[utf(**kw_utf) for utf in user_tag_functors]))
        return self.sim.record(synapse, what=what, user_tags=user_tags + functor_tags, **kwargs)
Beispiel #4
0
    def record(self,
               synapse,
               what,
               user_tags=None,
               user_tag_functors=None,
               **kwargs):
        if isinstance(synapse, int):
            synapse = self[synapse]
        assert synapse in self.synapses

        user_tags = user_tags or []
        user_tag_functors = user_tag_functors \
            or StdTagFunctors.get_record_functors_synapse()

        kw_utf = {'synapse': synapse, 'synapse_population': self}
        functor_tags = list(
            itertools.chain(*[utf(**kw_utf) for utf in user_tag_functors]))
        return self.sim.record(synapse,
                               what=what,
                               user_tags=user_tags + functor_tags,
                               **kwargs)