Version used in Shipley et al Frontiers of Neural Circuits 2014
This is the version of the code used in Shipley et al "Simultaneous optogenetic manipulation and calcium imaging in freely moving C. elegans" Frontiers in Neural Circuits 2014
http://www.ncbi.nlm.nih.gov/pmc/articles/PMC3970007/