Expose detector bank totals to NICOS as derived devices - #1243
Merged
Conversation
NICOS asked for detector counts in the device lists alongside the monitor
counts it already reads. The extraction machinery is generic -- DeviceExtractor
runs in every service's OrchestratingProcessor -- so this is a registry
declaration only: no backend or wire changes.
Unlike monitors, which have a single monitor_histogram spec per instrument, a
detector bank is typically covered by several views that all produce
counts_total_cumulative. Device names must be unique, so each instrument
designates exactly one view per bank; the shared COUNTS_TOTAL_DEVICE constant
keeps the {source_name}_counts_total naming convention in one place for both
monitors and detectors.
A new test asserts every monitor and detector bank of every instrument has a
counts device, so a new bank or instrument cannot silently miss one.
Note that counts_total is the sum of the accumulated histogram and so depends
on the view's TOA/wavelength edges; that pre-existing behaviour is #1242.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
NICOS asked for detector counts in the derived-device lists of all instruments, alongside the monitor counts they already read. Each detector bank now exposes its cumulative total as
{source_name}_counts_totalon{instrument}_livedata_nicos_data, under the same naming convention and the samestart_timegeneration marker as the monitor devices (ADR 0006).No backend or wire changes were needed:
DeviceExtractorruns in every service'sOrchestratingProcessorand the topic routing already exists, so thedetector_dataservice starts publishing the moment the contract designates one of its outputs. The change is a registry declaration plus the regenerated exports.Designation. Monitors have a single
monitor_histogramspec per instrument, so their device is unambiguous. A detector bank is typically covered by several views — a projection, a strip view, a tube view — that all producecounts_total_cumulative, and device names must be unique across an instrument. Each instrument therefore designates exactly one view per bank, generally the primary geometric or whole-bank image. Designating a second one for the same source fails loud at contract construction. The sharedCOUNTS_TOTAL_DEVICEconstant keeps the naming convention in one place for monitors and detectors alike, and its docstring carries the uniqueness rule.Consequence worth knowing. The designated view becomes device-bearing, so the dashboard's confirmation gate now intercepts reset/stop/reconfigure on the primary detector view of every instrument while a job is running, naming the affected devices. Previously only
monitor_histogramwas gated.Not fixed here:
counts_totalis the sum of the accumulated histogram, so events outside the view's TOA or wavelength edges are excluded. This is pre-existing and already applies to the monitor devices; in the default TOA configuration the edges span a full pulse period and nothing is dropped, but a narrowed range or wavelength mode truncates. Raised as #1242 for ESSlivedata and NICOS to settle.Test plan
start_timeandend_time.device_contract.yamlexports are regenerated; the existing drift test guards them.