From d7af253aa5d62dc171ff35e6fb6f1fdc51f85c5e Mon Sep 17 00:00:00 2001 From: Thomas Kluyver Date: Fri, 1 Dec 2023 16:48:44 +0100 Subject: [PATCH] Fix JUNGFRAU raw vs proc keys in mock data --- extra_data/tests/mockdata/jungfrau.py | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/extra_data/tests/mockdata/jungfrau.py b/extra_data/tests/mockdata/jungfrau.py index 2d004b56..aebeaa93 100644 --- a/extra_data/tests/mockdata/jungfrau.py +++ b/extra_data/tests/mockdata/jungfrau.py @@ -3,14 +3,23 @@ class JUNGFRAUModule(DeviceBase): output_channels = ('daqOutput/data',) - instrument_keys = [ - ('adc', 'u2', (16, 512, 1024)), - ('frameNumber', 'u8', (16,)), - ('gain', 'u1', (16, 512, 1024)), - ('mask', 'u2', (16, 512, 1024)), - ('memoryCell', 'u1', (16,)), - ('timestamp', 'f8', (16,)), - ] + def __init__(self, device_id, nsamples=None, raw=False): + super().__init__(device_id, nsamples) + self.raw = raw + + @property + def instrument_keys(self): + return [ + ('frameNumber', 'u8', (16,)), + ('gain', 'u1', (16, 512, 1024)), + ('memoryCell', 'u1', (16,)), + ('timestamp', 'f8', (16,)), + ] + ([ + ('adc', 'u2', (16, 512, 1024)), + ] if self.raw else [ + ('adc', 'f4', (16, 512, 1024)), + ('mask', 'u4', (16, 512, 1024)), + ]) class JUNGFRAUControl(DeviceBase): control_keys = [