iter_bliss_scan_data_from_memory_slice do not yield anything if the counter does not exist
import os
from ewoksdata.data.blissdata.blissdatav1 import iter_bliss_scan_data_from_memory_slice, iter_bliss_scan_data_from_memory
from blissdata.redis_engine.exceptions import NoScanAvailable
from blissdata.redis_engine.store import DataStore
import time
data_store = DataStore("redis://localhost:10003")
if __name__ == "__main__":
os.environ["BEACON_HOST"] = "localhost:10001"
DETECTOR_NAME = 'lima_simulator'
COUNTER_NAME = "diode2"
SLICE_RANGE = [5,10]
while True:
timestamp, key = data_store.get_next_scan()
print('#################################')
print()
print(f"New scan key is {key}")
#for ind, ptdata in enumerate(iter_bliss_scan_data_from_memory_slice(
k = 0
for ind, ptdata in enumerate(iter_bliss_scan_data_from_memory(
db_name=key,
lima_names=[
DETECTOR_NAME,
],
counter_names=[
COUNTER_NAME,
],
#slice_range=SLICE_RANGE,
)
):
print(ptdata)
k += 1
print()
print(k)
and running on bliss:
limatake(0.001, 3, save=False)
do not yield anything
because in here:
nyield = min(len(v) for v in buffers.values())
if nyield:
for i in range(nyield):
yield {name: values[i] for name, values in buffers.items()}
buffers = {name: values[nyield:] for name, values in buffers.items()}
the buffer of diode2 is empty
To be discussed because we mentioned that we could change the way the data is retrieved to a pure stream slicing, as I wrote with the new method iter_bliss_scan_data_from_memory_slice