Skip to content

Commit

Permalink
Merge pull request #204 from mrakitin/dep-webcam
Browse files Browse the repository at this point in the history
Deprecate the webcam class
  • Loading branch information
skarakuzu authored Oct 30, 2024
2 parents a3d4cc2 + fd74170 commit 7c6cfbe
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 11 deletions.
24 changes: 14 additions & 10 deletions nslsii/detectors/webcam.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import datetime
import itertools
import logging
import time as ttime
import warnings
from collections import deque
import itertools
from pathlib import Path

import cv2
import h5py
import numpy as np
from area_detector_handlers.handlers import HandlerBase
from event_model import compose_resource
from ophyd import Component as Cpt
from ophyd import Device, Signal
Expand All @@ -19,7 +19,6 @@
logger = logging.getLogger("vstream")



class VideoStreamDet(Device):
image = Cpt(ExternalFileReference, kind="normal")
mean = Cpt(Signal, value=0.0, kind="hinted")
Expand All @@ -34,6 +33,10 @@ def __init__(
frame_shape=(1080, 1920),
**kwargs,
):
warnings.warn(
f"This class {self.__class__.__name__} will be removed in the future."
)

super().__init__(*args, **kwargs)

self._root_dir = root_dir
Expand Down Expand Up @@ -73,13 +76,14 @@ def stage(self):

self._h5file_desc = h5py.File(self._data_file, "x")
group = self._h5file_desc.create_group("/entry")
self._dataset = group.create_dataset("averaged",
data=np.full(fill_value=np.nan,
shape=(1, *self._frame_shape)),
maxshape=(None, *self._frame_shape),
chunks=(1, *self._frame_shape),
dtype="float64",
compression="lzf")
self._dataset = group.create_dataset(
"averaged",
data=np.full(fill_value=np.nan, shape=(1, *self._frame_shape)),
maxshape=(None, *self._frame_shape),
chunks=(1, *self._frame_shape),
dtype="float64",
compression="lzf",
)
self._counter = itertools.count()

def trigger(self, *args, **kwargs):
Expand Down
Empty file added nslsii/motors/__init__.py
Empty file.
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
appdirs
bluesky>=1.8.1
bluesky-kafka>=0.8.0
bluesky>=1.8.1
caproto
databroker
h5py
Expand All @@ -12,6 +12,7 @@ matplotlib
msgpack >=1.0.0
msgpack-numpy
numpy
opencv-python
ophyd
ophyd-async
packaging
Expand Down

0 comments on commit 7c6cfbe

Please sign in to comment.