lucabaldini / hexsample

Solid-state hybrid detectors with hexagonal sampling.
https://lucabaldini.github.io/hexsample/
GNU General Public License v3.0
2 stars 0 forks source link

Change the signature of the read() functions in the readout structures #51

Open lucabaldini opened 3 months ago

lucabaldini commented 3 months ago

In the current implementation the three different readout classes have different read() signature---HexagonalReadoutRectangular needs the padding, that the other two do not.

Under the reasonable assumption that the chip is configured once outside the event loop, it would make much more sense for the read() hook to have the same signature for all classes, e.g.

def read(self, timestamp: float, x: np.ndarray, y: np.ndarray)

and add a setup() hook for the configuration part (that is, all the stuff that does not change on an event by event basis.)

If we do somthing along the lines of

def setup(**kwargs)

we might event get away by passing the argparse dictionary to the function. (Let's see how this looks.)