hnn-core icon indicating copy to clipboard operation
hnn-core copied to clipboard

User defined simulation tstart

Open ntolley opened this issue 3 years ago • 3 comments

This was brought up by @jasmainak during #348, it would be nice to be able to define a negative tstart for plotting. This is especially relevant for event related potentials, where the peaks are named by clinical electrophysiologists according to when they appear in time relative to a stimulus. So if we have a simulation where a stimulus occurs at a later point in time, it would be aligned to 0 ms.

At a first pass, it seems like one of the easiest workarounds would be to have a tstart attribute of the network, and substract the from the .timesattribute of the various objects that store it during plotting. I believe there is some internal tests/logic built into CellResponse.times for example that may break if we just edit the .times attribute directly.

ntolley avatar Jun 24 '21 11:06 ntolley

This still looks pretty relevant if someone wants to give it a shot

jasmainak avatar Jan 25 '23 14:01 jasmainak

I guess where this gets weird is that the length of the simulation will change depending on tstart. Are you thinking of just simulate_dipole(net, ..., tstart=-50.0) or something?

ntolley avatar Jan 25 '23 17:01 ntolley

yep, that's exactly the API I was imagining ... one would have to be carefully adjust the times when adding the drives as well, not just the cell responses. E.g.,

net.add_evoked_drive(mu=20., ...)  # 20 ms or whatever is the conduction delay 

for an N20 response ...

jasmainak avatar Mar 20 '23 01:03 jasmainak