11import datetime
2+ import itertools
23import logging
34import time as ttime
5+ import warnings
46from collections import deque
5- import itertools
67from pathlib import Path
78
89import cv2
910import h5py
1011import numpy as np
11- from area_detector_handlers .handlers import HandlerBase
1212from event_model import compose_resource
1313from ophyd import Component as Cpt
1414from ophyd import Device , Signal
1919logger = logging .getLogger ("vstream" )
2020
2121
22-
2322class VideoStreamDet (Device ):
2423 image = Cpt (ExternalFileReference , kind = "normal" )
2524 mean = Cpt (Signal , value = 0.0 , kind = "hinted" )
@@ -34,6 +33,10 @@ def __init__(
3433 frame_shape = (1080 , 1920 ),
3534 ** kwargs ,
3635 ):
36+ warnings .warn (
37+ f"This class { self .__class__ .__name__ } will be removed in the future."
38+ )
39+
3740 super ().__init__ (* args , ** kwargs )
3841
3942 self ._root_dir = root_dir
@@ -73,13 +76,14 @@ def stage(self):
7376
7477 self ._h5file_desc = h5py .File (self ._data_file , "x" )
7578 group = self ._h5file_desc .create_group ("/entry" )
76- self ._dataset = group .create_dataset ("averaged" ,
77- data = np .full (fill_value = np .nan ,
78- shape = (1 , * self ._frame_shape )),
79- maxshape = (None , * self ._frame_shape ),
80- chunks = (1 , * self ._frame_shape ),
81- dtype = "float64" ,
82- compression = "lzf" )
79+ self ._dataset = group .create_dataset (
80+ "averaged" ,
81+ data = np .full (fill_value = np .nan , shape = (1 , * self ._frame_shape )),
82+ maxshape = (None , * self ._frame_shape ),
83+ chunks = (1 , * self ._frame_shape ),
84+ dtype = "float64" ,
85+ compression = "lzf" ,
86+ )
8387 self ._counter = itertools .count ()
8488
8589 def trigger (self , * args , ** kwargs ):
0 commit comments