Python code for generating a HEKA patchmaster template file that produce a sine wave current with linearly changing frequency.
Similar to what's shown in the figure 1 A1 & B of the paper of Hu et al. Two forms of electrical resonance at theta frequencies, generated by M-current, h-current and persistent Na+ current in rat hippocampal pyramidal cells. The Journal of Physiology. 2002; 545(3):783‑805.
Regarding on how to use the generated template file, refer to HEKA patchmaster tutorial : http://www.heka.com/support/tutorials/tutorials_down/pm_tutorial_stimulustemplate.pdf
The data recorded in the file respect patchmaster indication: Data format: The file must contain one voltage value per stimulus point. The voltage value must be a ”short” (4 byte), binary IEEE-floating point format number. All values must be in volt, i.e., if a voltage of ”-80 mV” has to be output, then the required value is ”-0.080”.
Patchmaster is a multi-channel stimulation/acquisition software with programmable experiment control and automation, software Lock-in amplifier and Photometry/Imaging extension.
Thanks to https://github.com/ChristophKirst/TemplateCreator for showing the way.