romainbrette / clampy

4 stars 0 forks source link

Computed channels #18

Open romainbrette opened 5 years ago

romainbrette commented 5 years ago

It would be interesting to allow for signals that can be computed on the basis of other signals. I'm thinking typically about electrode compensation. We would set it with something like:

board.set_computed_channel('V_AEC',function = AEC_compensate)

And when board.acquire is called, the functions of computed channels are called to get the computed signals.

This could also be built into the Board class (AEC, bridge etc), but maybe that's a bit messy. Perhaps a class of computed channels. Then you would do:

AEC_compensation = AEC(board, 'V', 'I')
AEC_compensation.kernel_size = 10*ms
board.set_computed_channel('V_AEC', function = AEC_compensation)

And when board.acquire is called, AEC_compensation is called with the same arguments, and returns the computed signal. Then we could do:

AEC_compensation.calibrate()