Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement recording of currents generated by electrodes in Brian #465

Closed
appukuttan-shailesh opened this issue Mar 15, 2017 · 3 comments
Closed

Comments

@appukuttan-shailesh
Copy link
Contributor

appukuttan-shailesh commented Mar 15, 2017

It would be useful to be able to record the currents generated by the electrodes. This is currently possible for the NEURON back-end via the _record() and _get_data() methods. These would be made public methods once the same are implemented for Brian and NEST.

The implementation of these methods for Brian could be as follows:

    def _record(self):        
        self.i_state_monitor = brian.StateMonitor(self.cell_list[0].parent.brian_group[self.indices[0]], 'i_inj', record=0)
        simulator.state.network.add(self.i_state_monitor)

    def _get_data(self):
        return numpy.array((self.i_state_monitor.times / ms, self.i_state_monitor[0] / nA))

The NEST implementation is also more-or-less complete, but awaits the acceptance of the supporting features in the NEST simulator (see: nest/nest-simulator#658). Once approved, the same would be posted separately, and the methods made public.

@apdavison : I split this into individual issues for Brian and NEST as the ability to record currents seemed necessary for testing the fix for issue #445 . Not trivial (and unnecessarily complex I presume) trying to do it without the current traces.

@appukuttan-shailesh
Copy link
Contributor Author

appukuttan-shailesh commented Mar 15, 2017

Here is a sample output for each of the four electrode classes. The test file is here.

Red: ACSource
Blue: DCSource
Green: NoisyCurrentSource
Black: StepCurrentSource
brian_all

@appukuttan-shailesh
Copy link
Contributor Author

The recording of the currents can be tested more rigorously (and updated, if required) once implemented for other simulators (NEST remaining). As of now, one known difference between the Brian and NEURON implementation is that the data for the last time instant is not obtained from Brian. NEST would face the same situation (see here). This can be regularized across simulator back-ends when incorporating this feature for NEST.

@apdavison
Copy link
Member

Fixed in #467

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants