ITADN

Can StandardDetector be collectable instead of writing asset streams?

#1248Opencanismarko 创建于 2026-04-18
C
canismarkocommented
I have a question that might also be a feature request. I am trying to apply the new StandardDetector() to some new devices that can be used in fly scanning, but cannot write data to disk. - Struck SIS3820 scaler - MeasComp USB CTR-08 counter - TetrAmm electrometer These devices have inputs for hardware triggering and we use them for fly scanning, so I need to be able to pass these devices to `bps.collect()` and have it produce the right event docs (I think they would be event docs in this case, right?). With some custom data provider and data logic classes, I have the devices working for regular step-scan triggering, However, since the providers and logics don't seem to have a way to collect for fly scanning, I tried implementing `def collect(self)` or `def collect_pages(self)` on the `StandardDetector` class. In either case, it doesn't seem like these methods are getting called (`assert False` doesn't raise an exception). I suspect this is because the [bluesky bundler](https://github.com/bluesky/bluesky/blob/4390e3dce0b04472157664b7de3111b18469f59c/src/bluesky/bundlers.py#L1148) only uses `collect()` if the device is not a `WritesStreamAssests`, which StandardDetector is. I could do this without using StandardDetector, but I still want all the triggering, arming, preparing support in the StandardDetector. The only option I see right now is to copy the entire StandardDetector definition and omit `def collect_asset_docs()`. I'm wondering if there's a recommended way to make an ophyd-async detector that implements `EventCollectable` or `EventPageCollectable` but not `WritesStreamAssets`? I wrote a test to check whether any event documents are created, and only `"start"`, `"descriptor"`, and `"stop"` documents are emitted: https://github.com/spc-group/haven/blob/3e23a1a52a75f1ca3c7da87d5810902aa277ad40/tests/haven/devices/test_ion_chamber_scaler.py#L40 Here is the current (incomplete) implementation of the device: https://github.com/spc-group/haven/blob/3e23a1a52a75f1ca3c7da87d5810902aa277ad40/src/haven/devices/detectors/ion_chamber_scaler.py#L120 ## Acceptance Criteria - A StandardDetector() device can be created that will produce event documents when given to `bps.collect()` without writing to disk.
0 条评论