Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 35 additions & 1 deletion nslsii/areadetector/xspress3.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import re
import time as ttime

from collections import deque
from collections import deque, OrderedDict
from pathlib import Path
from uuid import uuid4

Expand Down Expand Up @@ -258,6 +258,40 @@ def _build_data_dir_path(the_datetime, root_path, path_template):
the_full_data_dir_path = Path(root_path) / Path(the_data_dir_path)
return str(the_full_data_dir_path)

def warmup(self):
"""
A convenience method for 'priming' the plugin.

The plugin has to 'see' one acquisition before it is ready to capture.
This sets the array size, etc.

This method overwrites the default warmup method from the HDF5Plugin.
It is the same except that it removes parent.cam.image_mode and
parent.cam.acquire_period, since those PVs are disabled on the
community ioc.
"""
self.enable.set(1).wait()
sigs = OrderedDict(
[
(self.parent.cam.array_callbacks, 1),
(self.parent.cam.trigger_mode, "Internal"),
(self.parent.cam.acquire_time, 1),
(self.parent.cam.acquire, 1),
]
)

original_vals = {sig: sig.get() for sig in sigs}

for sig, val in sigs.items():
ttime.sleep(0.1) # abundance of caution
sig.set(val).wait()

ttime.sleep(2) # wait for acquisition

for sig, val in reversed(list(original_vals.items())):
ttime.sleep(0.1)
sig.set(val).wait()

def stage(self):
logger.debug("staging '%s' of '%s'", self.name, self.parent.name)
staged_devices = super().stage()
Expand Down
Loading