Skip to content

Commit 7c6cfbe

Browse files
authored
Merge pull request #204 from mrakitin/dep-webcam
Deprecate the webcam class
2 parents a3d4cc2 + fd74170 commit 7c6cfbe

File tree

3 files changed

+16
-11
lines changed

3 files changed

+16
-11
lines changed

nslsii/detectors/webcam.py

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
import datetime
2+
import itertools
23
import logging
34
import time as ttime
5+
import warnings
46
from collections import deque
5-
import itertools
67
from pathlib import Path
78

89
import cv2
910
import h5py
1011
import numpy as np
11-
from area_detector_handlers.handlers import HandlerBase
1212
from event_model import compose_resource
1313
from ophyd import Component as Cpt
1414
from ophyd import Device, Signal
@@ -19,7 +19,6 @@
1919
logger = logging.getLogger("vstream")
2020

2121

22-
2322
class 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):

nslsii/motors/__init__.py

Whitespace-only changes.

requirements.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
appdirs
2-
bluesky>=1.8.1
32
bluesky-kafka>=0.8.0
3+
bluesky>=1.8.1
44
caproto
55
databroker
66
h5py
@@ -12,6 +12,7 @@ matplotlib
1212
msgpack >=1.0.0
1313
msgpack-numpy
1414
numpy
15+
opencv-python
1516
ophyd
1617
ophyd-async
1718
packaging

0 commit comments

Comments
 (0)