This is a properly articulated version of an old question.
I\'m working on condensing some code written for a neuroscience paper: https://doi.org/10.1371/journal.pcbi.10