-
Notifications
You must be signed in to change notification settings - Fork 87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bp.count()
needs a time
key word argument
#997
Comments
The |
This has come up a couple times, and we've resisted so far. I'll explain why, and you can decide whether or not you are convinced. :- ) In simpler times, count time was just one parameter and it was common to configure all detectors alike. But now, different detectors parameterize count time differently. Some simple point detectors still have a simple exposure time; but Area Detector specifies exposure time using three parameters. If plans are to generically configure a 'count time', ophyd would need to present some standard API for it to do so, and it's not really clear to us what this API should be. Moreover, it's common to need to configure different detectors differently, so a Where a |
I'm not convinced. Seems like the way forward is to write a extremely strong opinion here At the end of the day, it is the responsibility of the data acquisition system to move movables and to read readables. One part of reading (counting from detectors with variable acquisition time) is to specify for how long. Just because this specification has become a complex decision process does not remove the responsibility. We should not push the process of how to set the counting time to the user. Either we introduce a standard interface to which all such detectors adhere, or we introduce a function that overcomes the complexity. |
We've been talking through this this afternoon. You have convinced @tacaswell and me that bluesky/ophyd can take a more "batteries included" approach toward setting count times. We'd like more consideration and discussion on whether the pre-assembled plans ( You mentioned introducing "a function that overcomes the complexity." Let's start with that. We propose this way forward:
One important consideration here is that changing the count time on a device should notify the RunEngine that the any previously issued EventDescriptor(s) referring to that device should be reissued next time they are read, so that they can record the updated configuration. (Exposure time is typically recorded in the Event Descriptor.) The
Can we make this a separate discussion? This seems, to us, to not generalize beyond Scalers. |
Thanks for the consideration. Agree the count against monitor feature can go separate. It seems to be specific to Scaler devices. So, a detector with the proposed |
Just to make sure we're on the same page: I proposed one or more specially-named class MyDetector:
count_time = Cpt(EpicsSignal, '...')
acquire_period = cpt(EpicsSignal, '...')
def configure_count_time(device, count_time, acquire_period=None):
# ^ That signature is just an initial suggestion.
# It's probably more complicated!
if hasattr(device, 'count_time'):
yield from abs_set(device.count_time, count_time)
if acquire_period is not None and hasattr(device, 'acquire_period'):
yield from abs_set(device.acquire_period, acquire_period) And I think you are proposing a specially-named method: class Mixin:
def configure_count_time(self, ...):
...
def configure_count_time(device, count_time, acquire_period=None):
yield Msg('configure_count_time', device, count_time, acquire_period) For plans to access that method, we would need to add a bunch more stuff:
... which is not necessarily a bad thing! Is that what you have in mind? A new kind of "command" distinct from the generic "set" command, accessing a special new method opposed to a the |
We have documented why we do not build in a concept of exposure time to There are contexts where specifying one |
When counting, it is common to specify the time (seconds) or time basis (monitor counts) to be used. The
bp.count()
plan does not have this option. It is expected that acount()
should be able to specify for how long as an atomic operation, such asbp.count(time=0.2)
.Expected Behavior
When
time
is given, it sets the detector counting time.One convention in common use is that positive time is in seconds, negative time is in monitor (detector) counts which means the monitor detector must be declared in advance.
Current Behavior
Detector count time must be configured before calling
bp.count()
.Possible Solution
Support
time
as an optional keyword tobp.count()
.This will likely involve standardizing how the different detector types implement the count time or counting against a reference signal.
SynSignal
:bps.mv(det.exposure_time, time))
EpicsScaler
:bps.mv(det.preset_time, time)
ScalerCH
:bps.mv(det.preset_time, time)
areadetector.DetectorBase
:bps.mv(det.cam.acquire_time, time)
Supporting negative time to count against a monitor detector is only supported by
EpicsScaler
andScalerCH
in the underlying EPICS record support.Steps to Reproduce (for bugs)
n/a
Context
Converting existing APS SPEC macros to BlueSky and this is a barrier. Many of these macros pass the counting time as a parameter.
Your Environment
The text was updated successfully, but these errors were encountered: