Analytic chopper timing: use the experiment and pulse delays, not the total delay
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
Start in ess.reduce.nexus.workflow.to_disk_choppers, where each chopper goes to scippneutron.chopper.DiskChopper.from_nexus, and see how delay becomes the phase. Read the issue's open points first, since the timing reference (event14 vs NiSync) and the meaning of mechanical_delay are unresolved. Done would mean the timing uses experiment_delay and pulse_delay when present, is checked against the three geometries in both rotation directions, and files without experiment_delay are unchanged.
索引モデルが issue の本文から書いたものです。
説明
Now
ess.reduce.nexus.workflow.to_disk_choppers passes each chopper to scippneutron.chopper.DiskChopper.from_nexus. That uses phase if present, and otherwise φ = 2π·f·delay, and applies φ to slit_edges measured from TDC. top_dead_center is not used.
What ESS choppers write
ECDC's BIFROST NeXus template (0.3.0, nexus-json-templates MR !314, now merged) logs four delays for each chopper. The definitions are from ECDC's Confluence page "Choppers":
| NeXus field | PV | units | definition |
|---|---|---|---|
delay |
TotDly |
ns | the total, computed from the three below; the timing event that the drive phase-locks its TDC to |
experiment_delay |
ChopDly-S |
ns | "Phase of the disc, used to configure the mode (which wavelengths get through)"; set by the instrument team through NICOS, and the only one changed during an experiment |
mechanical_delay |
MechDly-S |
deg | "Angle between the TDC and the centre of the reference opening of the disc"; measured by the chopper group with a park scan or laser, otherwise with neutrons during hot commissioning. The IOC fills it per speed from a lookup table keyed on |speed|, because the drive lag grows with speed |
pulse_delay |
BeamPosDly-S |
ns | "Shifts the cascade relative to T0 (proton on target) to match the neutron pulse", e.g. 10 000 ns on every disc so they share one t0; set by the instrument team; fixed during an experiment |
The total, in ns, is TotDly = MechDly/360/|Spd_S|·1e9 + BeamPosDly + ChopDly. That is,
delay = mechanical_delay/(360°·|f_set|) + pulse_delay + experiment_delay.
The intent, in the page's words: "with MechDly set correctly and BeamPosDly = ChopDly = 0, every disc in the cascade has the centre of its reference opening on the beam at the same moment". pulse_delay then moves them together to match the neutron pulse, and experiment_delay selects the wavelengths. So each disc's reference opening has its centre on the beam at ref + pulse_delay + experiment_delay, where ref is the timing event the choppers count from (see Open points).
The problem
The mechanical delay has two parts. The geometric part is the angle from the TDC to the reference opening, which follows from the TDC resolver position, the angle at which the disc parks with the opening centred on the guide, and the direction the resolver counts. The lag, a few degrees (5–8° on the drives measured so far), grows with speed and depends on the direction of rotation. Both are measured per chopper, and they change after maintenance.
from_nexus applies the full delay, mechanical part included, to slit_edges and beam_position. The page defines beam_position = c + k·(tdc − park_open) (mod 360), with c the centre of the reference opening, so the geometric part is meant to be in the file. The computed timing is then right only if:
beam_positionwas filled from the same park scan that setmechanical_delay, and updated with it after maintenance. If it is missing, reduction assumes 0, and a 14 Hz disc "can then come out several milliseconds off";- the lag is negligible. It is in
mechanical_delaybut in no geometric field: 6° is 1.2 ms at 14 Hz.
Proposal
When experiment_delay is present, define the timing by the centre of the disc's reference opening instead of by TDC. This is the point mechanical_delay is measured to. The reference opening is the one that starts at slit_edges[0]: NeXus requires the first edge to be an opening edge, and ESS's NeXus configuration puts it at 0.
- θ_c = (
slit_edges[0]+slit_edges[1])/2. - t_ref =
pulse_delay+experiment_delayis when θ_c is on the beam. - Set φ = 2π·f·t_ref + θ_c − θ̃ (mod 2π), where θ̃ is
beam_positionand f is the NeXus-signedrotation_speed(SpdNexus-R).
Every other edge then follows from its angle to θ_c: an edge at θ is on the beam at t_ref + (θ_c − θ)/(2π·f), modulo the rotation period. Neither the position of TDC on the disc, nor beam_position, nor the drive lag enters the timing. Only the slit edges relative to each other and the two delays do. A geometry with beam_position 180° and edges centred on it gives the same timing as one with edges starting at 0° and beam_position 0°, as long as both describe the same slit.
The reference opening's centre is on the beam at t_ref whichever way the disc turns, and the opening spans t_ref ± w/(2·2π|f|) for an opening w wide. Files without experiment_delay keep today's behaviour.
I checked the formula with scippneutron 26.9.1's DiskChopper. The cases were four geometries (one with three slits), both directions of rotation, discs at half, once and twice the pulse frequency, and several values of t_ref. In every case the midpoint of time_offset_open and time_offset_close for the reference opening is t_ref, modulo the rotation period.
This could live in to_disk_choppers, or in from_nexus, or be selectable by a workflow parameter if other facilities combine their delays differently.
Open points
- The timing reference. ESS has two 14 Hz timing events with a fixed relationship. event14 is the site-wide reference. event16, also called NiSync, is proton-on-target, 6503 µs after event14. ESS-5914805 says "the current plan is to use NiSync for timing NSS choppers and detectors instead of event14". BIFROST requires NiSync for both, which is to be verified during hot commissioning.
event_time_offsetand the chopper delays are then both measured from proton-on-target, so:- the default
SourceBounds(pulse at 0–5 ms) is right; pulse_delayis the small t0 adjustment it is documented as, and belongs in t_ref. If commissioning finds that either side uses event14 instead, the 6503 µs would have to be added to the source or to the chopper phase.
- the default
- A measured alternative. The
top_dead_centertimestamps record when the real sensor fires. EPICS publishes them relative to the latest reference event, and the forwarder adds a reference time back, ideally the same one. The drive locks the sensor to ref +delay, so ((TDC − ref) mod T) −mechanical_delay/(360°·|f|) is the realised t_ref. Here T is the rotation period, which divides the 71.43 ms reference period, so taking it modulo T works whichever reference time the forwarder added. If a chopper were timed from event14 instead of NiSync, this would show it as a constant 6503 µs shift. Its median over a run checks the set points, or replaces them when a chopper is off its set point. Its spread is the phase jitter. - The reference opening on a disc with several slits. The Confluence page measures
mechanical_delayto "the reference opening" without saying which one it is. This proposal takes the opening that starts atslit_edges[0]. That is worth confirming with the chopper group for each multi-slit disc, since a different choice shifts the timing by the angle between the two openings' centres.
- 主要言語
- Python
- スター
- 3
- フォーク
- 6
- 平均マージ
- 2日 13時間
- マージ済み PR(30日)
- 35
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
scipp/ess のほかの issue
-
essreduce
難易度 2/5 1〜3時間 初心者へのやさしさ 69/100
メンテナーはふだん 1 日以内に返信
-
[ESSSPECTROSCOPY] The containers don't record the vertical axis used for the sample-table rotationオープンessspectroscopy
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100
メンテナーはふだん 1 日以内に返信
-
essspectroscopy
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
essspectroscopy
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
メンテナーはふだん 1 日以内に返信
-
[essreduce] A chopper with no `beam_position` is silently placed at 0°対応中かも @TTsangSC が 2 日前に担当しました。 オープンessreduce
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
scipp/ess#923 · コメント 1 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
似ている issue
-
Test: to_hijri() accepts datetime.datetime and uses only the date part対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープンgood first issue
難易度 1/5 1時間未満 初心者へのやさしさ 95/100
omarelshamy25x/shamy-hijri#63 · コメント 3 件 ·
メンテナーはふだん 1 日以内に返信
-
polish
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
521xueweihan/HelloGitHub#4729 ·
-
[Bug]: Score parser reads parts of scientific notation as valid scores対応中かも @AshutoshSingh840 が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
UKGovernmentBEIS/control-arena#992 ·
メンテナーはふだん 3 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 92/100
mvalentsev/awesome-free-ai-coding#70 ·
メンテナーはふだん 1 日以内に返信