Skip to content

Draft: examples for post scan calculation counters

Linus Pithan requested to merge examples_post_scan_calc into master

Here are very basic examples for a post acquisition calculation using a calc counter. It is meant to serve as an example of what @denolf asked for in #2126. In case this is something that could be useful for DAU we should move the code into a proper place...

If we wanted to go this way only the new classes would need to be provided by the person implementing the processing calculation.

class SumCalcCounterController(PostCalcCounterController):
    def post_compute(self, channels):
        my_sum = numpy.sum(self.data[self.inputs[0].name])
        channels[0].emit(my_sum)


class DiffCalcCounterController(PostCalcCounterController):
    def post_compute(self, channels):
        channels[0].emit(numpy.diff(self.data[self.inputs[0].name]))
Edited by Linus Pithan

Merge request reports